jacobgil / pyfishervector

Python implementation for Image Classification based on GMM dictionaries and fisher vectors.
137 stars 56 forks source link

how to use this code? #1

Closed albertyou2 closed 7 years ago

albertyou2 commented 7 years ago

@jacobgil hi Sorry for raising this issue.But when I tried to use fisher.py for cluster my images by using this command:

python fisher.py -d ./images

An error occupied.The log is here:

('Calculating descriptos. Number of images is', 0) Traceback (most recent call last): File "fisher.py", line 129, in gmm = load_gmm(working_folder) if args.loadgmm else generate_gmm(working_folder, args.number) File "fisher.py", line 76, in generate_gmm words = np.concatenate([folder_descriptors(folder) for folder in glob.glob(input_folder + '/*')]) File "fisher.py", line 26, in folder_descriptors return np.concatenate([image_descriptors(file) for file in files]) ValueError: need at least one array to concatenate

The "./images" folder just included all the images in it and has no sub folders : ./images --img1.jpg --img2.jpg ...

Could you please give some help? Thank you !

hugos94 commented 7 years ago

I had the same problem. I tried several ways, without success.

hugos94 commented 7 years ago

I found the "error". Your images are probably not in ".jpg" format. The code is intended to work only with images in this format. I just changed the format of the code by the format I use and it worked.

albertyou2 commented 7 years ago

@hugos94 Yes ! It's solved! thank you !