mirror of
https://github.com/serengil/deepface.git
synced 2025-06-06 11:35:21 +00:00
patch: emotion dimension.
This commit is contained in:
parent
72b6db19d6
commit
a23893a5fa
@ -72,14 +72,7 @@ class EmotionClient(Demography):
|
||||
# Preprocessing input image or image list.
|
||||
imgs = self._preprocess_batch_or_single_input(img)
|
||||
|
||||
if imgs.shape[0] == 1:
|
||||
# Preprocess single image and add channel dimension for grayscale images
|
||||
processed_imgs = np.expand_dims(np.array([self._preprocess_image(img) for img in imgs]), axis=0)
|
||||
else:
|
||||
# Preprocess batch of images and add channel dimension for grayscale images
|
||||
processed_imgs = np.expand_dims(np.array([self._preprocess_image(img) for img in imgs]), axis=-1)
|
||||
# Reshape input for model (expected shape=(n, 48, 48, 1)), where n is the batch size
|
||||
processed_imgs = processed_imgs.reshape(processed_imgs.shape[0], 48, 48, 1)
|
||||
processed_imgs = np.expand_dims(np.array([self._preprocess_image(img) for img in imgs]), axis=-1)
|
||||
|
||||
# Prediction
|
||||
predictions = self._predict_internal(processed_imgs)
|
||||
|
Loading…
x
Reference in New Issue
Block a user