amannirala13 / HAAR-Cascade-Trainer-Linux

🖼️ This is a HAAR Cascade Classifier training GUI application for Linux. This application make it really easy to train classifiers for object detection and tracking using opencv by providing a Graphical user interface to set parameters and perform necessary steps.
https://amannirala13.github.io/HAAR-Cascade-Creator-OpenCV/
MIT License
32 stars 8 forks source link

trainer is not working #4

Open Determine06 opened 4 years ago

Determine06 commented 4 years ago

Nice job for making the trainer!

I am getting an error: Environment ready! objc[40735]: Class FIFinderSyncExtensionHost is implemented in both /System/Library/PrivateFrameworks/FinderKit.framework/Versions/A/FinderKit (0x7fff94ee23d8) and /System/Library/PrivateFrameworks/FileProvider.framework/OverrideBundles/FinderSyncCollaborationFileProviderOverride.bundle/Contents/MacOS/FinderSyncCollaborationFileProviderOverride (0x122b4bf50). One of the two will be used. Which one is undefined. Positive Dir selected: /Users/nishchay/Dropbox/My Mac (Nishchay’s MacBook Pro)/Desktop/Training/Positive Negative Dir selected: /Users/nishchay/Dropbox/My Mac (Nishchay’s MacBook Pro)/Desktop/Training/Negative Positive Dir selected: /Users/nishchay/Dropbox/My Mac (Nishchay’s MacBook Pro)/Desktop/Training/Positive Negative Dir selected: /Users/nishchay/Dropbox/My Mac (Nishchay’s MacBook Pro)/Desktop/Training/Negative (base) Nishchays-MacBook-Pro:app nishchay$ chmod -R a+x ./app chmod: ./app: No such file or directory (base) Nishchays-MacBook-Pro:app nishchay$ python3 main.py Starting... git version 2.28.0 sh: opencv_createsamples: command not found Environment ready! objc[40763]: Class FIFinderSyncExtensionHost is implemented in both /System/Library/PrivateFrameworks/FinderKit.framework/Versions/A/FinderKit (0x7fff94ee23d8) and /System/Library/PrivateFrameworks/FileProvider.framework/OverrideBundles/FinderSyncCollaborationFileProviderOverride.bundle/Contents/MacOS/FinderSyncCollaborationFileProviderOverride (0x128c25f50). One of the two will be used. Which one is undefined. Positive Dir selected: /Users/nishchay/Dropbox/My Mac (Nishchay’s MacBook Pro)/Desktop/Training/Positive Negative Dir selected: /Users/nishchay/Dropbox/My Mac (Nishchay’s MacBook Pro)/Desktop/Training/Negative Output Dir selected: /Users/nishchay/Dropbox/My Mac (Nishchay’s MacBook Pro)/Desktop/Training sh: -c: line 0: syntax error near unexpected token (' sh: -c: line 0:find /Users/nishchay/Dropbox/My Mac (Nishchay’s MacBook Pro)/Desktop/Training/Negative -name '.png' -o -name '.jpg' > /Users/nishchay/Dropbox/My Mac (Nishchay’s MacBook Pro)/Desktop/Training/Negative/index.txt' Successfully generated negative images index sh: -c: line 0: syntax error near unexpected token (' sh: -c: line 0:find /Users/nishchay/Dropbox/My Mac (Nishchay’s MacBook Pro)/Desktop/Training/Positive -name '.png' -o -name '.jpg' > /Users/nishchay/Dropbox/My Mac (Nishchay’s MacBook Pro)/Desktop/Training/Positive/index.txt' Successfully generated positive images index ERROR: Unable to open positive images index file.

amannirala13 commented 4 years ago

Thanks for your comment @Determine06 I am looking into this issue. This is the same issue as this one.

The issue is because you don't have essential build tools installed or not included in the path. Check in the terminal if you can run "opencv_traincascade" and "opencv_createsamples" in your terminal.

This is a very common yet not popular issue with the installation of OpenCV. I am looking into the issue and would probably add the instructions soon.

StevePirateX commented 3 years ago

Might be because of openv-cv v4 - The main app might have to be forced to installing only v3 in case it installs v4 in line 35 of main.py? The open-cv documentation mentions that opencv_createsamples and opencv_traincascade is deprecated in open-cv v4: https://docs.opencv.org/3.4/dc/d88/tutorial_traincascade.html


if 'opencv' in missing:
            if python_version[0] =='3':
                os.system('sudo apt-get install -y python3-opencv')
            else:
                os.system('sudo apt-get install -y python-opencv')```