Open joshwongg opened 1 day ago
When running the code if an error occurred you should see an error message starting with 'Error in facial emotion calculation...'. The fact that you don't suggests that maybe the machine running it quits for some reason which is harder to debug; do you find that to be the case? You could check it by running the code in Python line-by-line and see if it exits Python or the terminal when running the emotional_expressivity
function.
Additionally you can try this code, to ensure the issue doesn't come from Deepface
running it on a single frame of your video:
import cv2
import pandas as pd
from deepface import DeepFace
cap = cv2.VideoCapture(filepath)
ret, img = cap.read()
if not ret:
raise ValueError("Error: Couldn't read the video.")
img_rgb = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
face_analysis = DeepFace.analyze(img_path=img_rgb, actions=['emotion'])
emotions = face_analysis[0]['emotion']
print(face_analysis)
print(emotions)
Hi,
I've been trying to run the emotional expressivity function, however, all my results come up with "NaN". I've tested to see if the files open, as well as the video quality, and it is all fine. There is no error message that occurs when I am running the code either. I'm running the code below through miniconda.
Any help is greatly appreciated! Thanks :)