Closed trohit920 closed 6 years ago
You can alter the script to do what you want. This are basic python jobs
To save result:
if emotion_text == 'angry':
color = emotion_probability * np.asarray((255, 0, 0))
file_to_write = open('myfile.csv', 'a')
file_to_write.write('angry,')
file_to_write.close()
To read from video file just replace 0
(that represents video camera) with the path to the video file:
video_capture = cv2.VideoCapture("path/video/file.mp4")
This isn't a issue per se.
hello mirceaciu...i got this error:
Traceback (most recent call last):
File "video_emotion_gender_demo.py", line 104, in
@mirceaciu @oarriaga What i mean here is to save the result as video file like .mp4 or .avi as i know cv2.VideoWriter_fourcc with different codec can be used but it is producing me an error like:
cv2.error: /home/rohit/opencv-3.3.0/modules/imgcodecs/src/loadsave.cpp:604: error: (-2) could not find a writer for the specified extension in function imwrite_
Can you advice me what can be done to save the result as video file ?
Hi @oarriaga ,
I am wondering is there a way, by which we can save the detected result e.g. emotion detected after running the script video_emotion_color_demo.py . Also can we run this script on video files (mp4) saved on local system for emotion detection or gender classification ? If yes can you modify the code or tell me how to do it ?