Emotion-recognition
Emotion-recognition copied to clipboard
How to turn the real time webcame to detect on pre-recorded video?
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.
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
hey @version0chiro what is cap here? Also would the solution be the same if I wanted to detect emotions in just one image? Thanks.
Nevermind I figured it out.
In case anyone else is looking for it: here's the link to my Stack overflow post.