Skip to content
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

Closed
lpostingher opened this issue Sep 4, 2020 · 6 comments
Closed

Error whe try to run "detect_emotions" method #13

lpostingher opened this issue Sep 4, 2020 · 6 comments

Comments

@lpostingher
Copy link

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
@lpostingher
Copy link
Author

lpostingher commented Sep 4, 2020

I'm running on Windows 10.
Python 3.6.1.

@JustinShenk
Copy link
Owner

JustinShenk commented Sep 8, 2020 via email

@lpostingher
Copy link
Author

lpostingher commented Sep 8, 2020

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 machine, and it works fine.

@JustinShenk
Copy link
Owner

JustinShenk commented Sep 9, 2020 via email

@lpostingher
Copy link
Author

Sure.

>>> import cv2
>>> hasattr(cv2.CascadeClassifier, "detectMultiScale")
False

@JustinShenk
Copy link
Owner

JustinShenk commented Sep 10, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants