bikz05 / bag-of-words

Python Implementation of Bag of Words for Image Recognition using OpenCV and sklearn
217 stars 106 forks source link

Training Error #9

Open gitDawn opened 7 years ago

gitDawn commented 7 years ago

Hi,

I've got some error after ruuning the training with python findFeatures.py -t dataset/train/ which states

Traceback (most recent call last): File "findFeatures.py", line 35, in fea_det = cv2.FeatureDetector_create("SIFT") AttributeError: module 'cv2' has no attribute 'FeatureDetector_create'

Could you publish the packages version you have used for this build so I'll check if I'm using the same opencv version?

Thanks, Shahar

willard-yuan commented 7 years ago

OpenCV removes the opencv_contrib since the version 3.0. So you need to compile OpenCVwith opencv_contrib. In my opinion, it's a good idea to choose OpenCv 2.X to run the code.

gregorej commented 7 years ago

@gitDawn take a look at my pull request #10. It solves this issue

You will need opencv with opencv_contrib for this.

Khanjan14 commented 7 years ago

While training According to descriptor.py we must have equal number of images in both classes which may not be possible for all the database given to you. Here we can count no of images in train folder for both types and than proceed instead of dividing images in first half as class 0 and second half in Class 1.

Thanks.

chifaa commented 1 year ago

hi plz i hav anacanda

and i try to run the code and have that issu

File "C:\Users\wiam\findFeatures.py", line 8, in import sklearn.external.joblib as extjoblib ModuleNotFoundError: No module named 'sklearn.external'

chifaa commented 1 year ago

While training According to descriptor.py we must have equal number of images in both classes which may not be possible for all the database given to you. Here we can count no of images in train folder for both types and than proceed instead of dividing images in first half as class 0 and second half in Class 1.

Thanks.

plz how we can do this.im new in python