-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error whe try to run "detect_emotions" method #13
Comments
I'm running on Windows 10. |
Hi Lucas, can you run python and see if your cv2 has a CascadeClassifier
method?
import cv2; print(cv2.CascadeClassifier)
…On Fri, Sep 4, 2020 at 2:46 AM Lucas da Silva Postingher < ***@***.***> wrote:
When I try to run this code, I have an exception
from fer import FER
import cv2 as cv
img = cv.imread(temp_file_name)
detector = FER()
detector.detect_emotions(img=img)
Traceback (most recent call last):
File "c:/Dev/Python/vocacional-server/photo/emotion.py", line 17, in <module>
detector.detect_emotions(img=img)
File "C:\Users\lucas.postingher\AppData\Local\Programs\Python\Python36\lib\site-packages\fer\fer.py", line 236, in detect_emotions
face_rectangles = self.find_faces(img, bgr=True)
File "C:\Users\lucas.postingher\AppData\Local\Programs\Python\Python36\lib\site-packages\fer\fer.py", line 180, in find_faces
if isinstance(self.__face_detector, cv2.CascadeClassifier):
TypeError: isinstance() arg 2 must be a type or tuple of types
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#13>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACOLMZHX5QVPE7VWY45XT7LSEA2FVANCNFSM4QWTPCDQ>
.
|
Hi Justin, this is the output on my windows machine.
Today I tried to run the same script on my linux machine, and it works fine. |
Interesting, it appears related to the Windows OpenCV build.
Can you please share the output of:
hasattr(cv2.CascadeClassifier, "detectMultiScale")
…On Wed, Sep 9, 2020 at 12:13 AM Lucas da Silva Postingher < ***@***.***> wrote:
Hi Justin, this is the output on my windows machine.
>>> import cv2
>>> print(cv2.CascadeClassifier)
<built-in function CascadeClassifier>
Today I tried to run the same script on my linux macinhe, and it works
fine.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#13 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACOLMZHY4VBEHDEUKBUUZ3LSE2T7XANCNFSM4QWTPCDQ>
.
|
Sure.
|
It's not clear to me what is different about your OpenCV library but I
expected CascadeClassifier would be a class, not a function.
A few more things to debug: print(cv2.__version__) and print(dir(cv2))
Are you able to follow these instructions for Face recognition:
https://www.datacamp.com/community/tutorials/face-detection-python-opencv?
Otherwise, we may have to find the appropriate pip file to install on
your system.
…On Wed, Sep 9, 2020 at 11:02 PM Lucas da Silva Postingher < ***@***.***> wrote:
Sure.
>>> import cv2
>>> hasattr(cv2.CascadeClassifier, "detectMultiScale")
False
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#13 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACOLMZBW5LJM4FINUDWZ7B3SE7UNDANCNFSM4QWTPCDQ>
.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When I try to run this code, I have an exception
The text was updated successfully, but these errors were encountered: