2015-01-04 11:08:40 -0600 | commented answer | pyopencv_from and pyopencv_to for KeyPoint class @berak - here is the issue and fix in the code posted. traindata should be declared a numpy ndarray and NOT a list. So when the bow_extract is returning bowdescriptors it will be loaded into the traindata array one descriptor per index. The shape of the traindata ndarray should be x * y where x = number of images trained and y = number of features of bow_trainer. code changes: Thanks for the help. BOW for python works like a charm !! |
2015-01-04 09:30:17 -0600 | received badge | ● Supporter (source) |
2015-01-04 09:29:55 -0600 | commented answer | pyopencv_from and pyopencv_to for KeyPoint class @berak - Thanks for the advice. Sorry but here is what i see. traindata is a list, of numpy.ndarrays and if i print it this what i see. svm.train takes numpy arrays for both samples(train data) and response (train labels) so if i print np.array(train data) Any advices on this? and if i use the above i still get the error |
2015-01-04 09:26:12 -0600 | answered a question | pyopencv_from and pyopencv_to for KeyPoint class @berak - Thanks for the advice. Sorry but here is what i see. traindata is a list, of numpy.ndarrays and if i print it this what i see. svm.train takes numpy arrays for both samples(train data) and response (train labels) so if i print np.array(train data) Any advices on this? |
2015-01-04 08:20:06 -0600 | commented answer | pyopencv_from and pyopencv_to for KeyPoint class Thanks for wrapping BOW in python. I tried using the above code and the below line Throws this error here is what my train data (samples) look like (Apparently after doing some googling I did traindata = np.float32(traindata) and same for trainlabels) here is what my train labels (responses) look like Am i missing something, please point out what am I doing wrong. |
2015-01-04 08:20:06 -0600 | answered a question | pyopencv_from and pyopencv_to for KeyPoint class Thanks for wrapping BOW in python. I tried using the above code and the below line Throws this error here is what my train data (samples) look like (Apparently after doing some googling I did traindata = np.float32(traindata) and same for trainlabels) here is what my train labels (responses) look like Am i missing something, please point out what am I doing wrong. |