Skip to content

OpenCV gives an error after a few seconds of opening the window #25

@sheikhartin

Description

@sheikhartin

I wanted to try FaceLib with the emotion detector from my webcam, but I got an error after a few seconds when a frame opens!

Code (from the README file):

from facelib import WebcamEmotionDetector

detector = WebcamEmotionDetector()
detector.run()

Error message:

loading ...
from EmotionDetector: weights loaded
type q for exit
Traceback (most recent call last):
  File "/home/sheikhartin/w/.tmp/facelib_demo.py", line 15, in <module>
    detector.run()
  File "/home/sheikhartin/.local/lib/python3.10/site-packages/facelib/FacialExpression/from_camera.py", line 27, in run
    special_draw(frame, b, landmarks[i], name=emotions[i], score=emo_probs[i])
  File "/home/sheikhartin/.local/lib/python3.10/site-packages/facelib/InsightFace/models/utils.py", line 117, in special_draw
    cv2.rectangle(img, c1, c2, color, thickness=tl)
cv2.error: OpenCV(4.6.0) :-1: error: (-5:Bad argument) in function 'rectangle'
> Overload resolution failed:
>  - Can't parse 'pt1'. Sequence item with index 0 has a wrong type
>  - Can't parse 'pt1'. Sequence item with index 0 has a wrong type
>  - argument for rectangle() given by name ('thickness') and position (4)
>  - argument for rectangle() given by name ('thickness') and position (4)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions