Add new predictor.

This commit is contained in:
h-alice 2025-01-06 11:51:49 +08:00
parent 5a1881492f
commit 72b94d11de
No known key found for this signature in database
GPG Key ID: 5708F34144A70909
4 changed files with 8 additions and 8 deletions

View File

@ -54,8 +54,8 @@ class ApparentAgeClient(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)
# Batch prediction # Prediction
age_predictions = self.model.predict_on_batch(imgs) age_predictions = self._predict_internal(imgs)
# Calculate apparent ages # Calculate apparent ages
apparent_ages = np.array( apparent_ages = np.array(

View File

@ -78,8 +78,8 @@ class EmotionClient(Demography):
# Add channel dimension for grayscale images # Add channel dimension for grayscale images
processed_imgs = np.expand_dims(processed_imgs, axis=-1) processed_imgs = np.expand_dims(processed_imgs, axis=-1)
# Batch prediction # Prediction
predictions = self.model.predict_on_batch(processed_imgs) predictions = self._predict_internal(processed_imgs)
return predictions return predictions

View File

@ -54,8 +54,8 @@ class GenderClient(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)
# Batch prediction # Prediction
predictions = self.model.predict_on_batch(imgs) predictions = self._predict_internal(imgs)
return predictions return predictions

View File

@ -54,8 +54,8 @@ class RaceClient(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)
# Batch prediction # Prediction
predictions = self.model.predict_on_batch(imgs) predictions = self._predict_internal(imgs)
return predictions return predictions