feat: visual emotion recognition agent #54
@@ -33,13 +33,11 @@ class DeepFaceEmotionRecognizer(VisualEmotionRecognizer):
|
||||
self.load_model()
|
||||
|
||||
def load_model(self):
|
||||
print("Loading Deepface Emotion Model...")
|
||||
dummy_img = np.zeros((224, 224, 3), dtype=np.uint8)
|
||||
# analyze does not take a model as an argument, calling it once on a dummy image to load
|
||||
# the model
|
||||
DeepFace.analyze(dummy_img, actions=['emotion'], enforce_detection=False)
|
||||
print("Deepface Emotion Model loaded.")
|
||||
|
||||
|
||||
def sorted_dominant_emotions(self, image) -> list[str]:
|
||||
analysis = DeepFace.analyze(image,
|
||||
actions=['emotion'],
|
||||
|
||||
Reference in New Issue
Block a user