nischi / MMM-Face-Reco-DNN

Face recognition with opencv and deep neural network
MIT License
91 stars 46 forks source link

Error while running the command python3 encode.py -i ../dataset/ -e encodings.pickle -d hog #59

Closed dangopea closed 4 years ago

dangopea commented 4 years ago

Hi, I have a few errors when I run the command python3 encode.py -i ../dataset/ -e encodings.pickle -d hog. Log below:-

Traceback (most recent call last): File "encode.py", line 5, in from imutils import paths File "/home/pi/.local/lib/python3.7/site-packages/imutils/init.py", line 8, in from .convenience import translate File "/home/pi/.local/lib/python3.7/site-packages/imutils/convenience.py", line 6, in import cv2 File "/usr/local/lib/python3.7/dist-packages/cv2/init.py", line 89, in bootstrap() File "/usr/local/lib/python3.7/dist-packages/cv2/init.py", line 79, in bootstrap import cv2 ImportError: libtesseract.so.4: cannot open shared object file: No such file or directory


How do I solve this?

nischi commented 4 years ago

seems do you have not all dependencies. how did you installed opencv?

dangopea commented 4 years ago

Oh, I forgot to install OpenCV. I just did and I did not get the error. Thank you!

nikolasdas commented 3 years ago

Hey! I have the same problem, but even with openCV installed as explained in the readme... Any idea why?

nischi commented 3 years ago

can you verify you installed imutils with pip3?

nikolasdas commented 3 years ago

Yes, imutils 0.5.3 is installed :/

nischi commented 3 years ago

Do you run the module in a virtual environment?

nikolasdas commented 3 years ago

no. At least I never set one up, I just followed the guide in the readme on a fresh install of Raspberry Pi OS

nischi commented 3 years ago

can you please send me the whole error log?

nikolasdas commented 3 years ago
$ python3 encode.py 
Traceback (most recent call last):
  File "encode.py", line 5, in <module>
    from imutils import paths
  File "/home/pi/.local/lib/python3.7/site-packages/imutils/__init__.py", line 8, in <module>
    from .convenience import translate
  File "/home/pi/.local/lib/python3.7/site-packages/imutils/convenience.py", line 6, in <module>
    import cv2
  File "/usr/local/lib/python3.7/dist-packages/cv2/__init__.py", line 89, in <module>
    bootstrap()
  File "/usr/local/lib/python3.7/dist-packages/cv2/__init__.py", line 79, in bootstrap
    import cv2
ImportError: libtesseract.so.4: cannot open shared object file: No such file or directory
nischi commented 3 years ago

did aou installed opencv with this commands?


wget https://github.com/cyysky/OpenCV-4.1.2-for-Raspbian/raw/master/opencv_4.1.2-1_armhf.deb
sudo dpkg -i opencv_4.1.2-1_armhf.deb
sudo apt-get -f install
sudo dpkg -i opencv_4.1.2-1_armhf.deb
nikolasdas commented 3 years ago

Yes I did

nischi commented 3 years ago

Sorry it's a little bit of a trail and error. But can you try following?

python
import cv2
cv2.__version__

First command will start a python instance. Second will import openCV and third will get you the version of installed OpenCV. Can you push the output? With exit() you can close python.

And can you please send me your config of MagicMirror? (Without Passwords)

nikolasdas commented 3 years ago

I just took a look at https://github.com/cyysky/OpenCV-Raspberry-Pi-4-Package-for-Python and found the error... After running sudo apt-get install tesseract-ocr the error disappeared and it seems to run now... Thank you @nischi for the help!