Emotion-recognition icon indicating copy to clipboard operation
Emotion-recognition copied to clipboard

How to turn the real time webcame to detect on pre-recorded video?

Open C45513 opened this issue 5 years ago • 3 comments

Hi,

I'm new to OpenCV and computer vision. I'm grateful for your detailed instruction and I managed to run it with no sweat and pull up the real time webcam detector. However, how can I change the script to detect from the recorded video rather from the webcam?

Also, how can the result (probabilities of the emotions) be automatically recorded in the system?

Thank you very much.

C45513 avatar Nov 16 '20 02:11 C45513

Hey @C45513, You can change the code from real-time to recorded video by replacing the camera = cv2.VideoCapture(0) while True: with camera = cv2.VideoCapture('path of the video file') while(cap.isOpened()):

Be sure to add some try and except for error handling

version0chiro avatar Feb 11 '21 13:02 version0chiro

hey @version0chiro what is cap here? Also would the solution be the same if I wanted to detect emotions in just one image? Thanks.

AjeelAhmed1998 avatar May 23 '21 05:05 AjeelAhmed1998

Nevermind I figured it out.

In case anyone else is looking for it: here's the link to my Stack overflow post.

AjeelAhmed1998 avatar May 23 '21 08:05 AjeelAhmed1998