mirror of
https://github.com/serengil/deepface.git
synced 2025-06-07 03:55:21 +00:00
[update] make process to one-line
This commit is contained in:
parent
85e2d8d863
commit
ba0d0c5bb6
@ -72,13 +72,11 @@ class EmotionClient(Demography):
|
|||||||
# Preprocessing input image or image list.
|
# Preprocessing input image or image list.
|
||||||
imgs = self._preprocess_batch_or_single_input(img)
|
imgs = self._preprocess_batch_or_single_input(img)
|
||||||
|
|
||||||
# Preprocess each image
|
# Preprocess each image and add channel dimension for grayscale images
|
||||||
processed_imgs = np.array([self._preprocess_image(img) for img in imgs])
|
processed_imgs = np.expand_dims(np.array([self._preprocess_image(img) for img in imgs]), axis=0)
|
||||||
|
|
||||||
# Add channel dimension for grayscale images
|
|
||||||
processed_imgs = np.expand_dims(processed_imgs, axis=-1)
|
|
||||||
|
|
||||||
# Prediction
|
# Prediction
|
||||||
|
# Emotion model input shape is (48, 48, 1, n), where n is the batch size
|
||||||
predictions = self._predict_internal(processed_imgs)
|
predictions = self._predict_internal(processed_imgs)
|
||||||
|
|
||||||
return predictions
|
return predictions
|
||||||
|
Loading…
x
Reference in New Issue
Block a user