From edcef02511d6c789734842693e787655951fbdb4 Mon Sep 17 00:00:00 2001 From: Nat Lee Date: Tue, 31 Dec 2024 17:30:28 +0800 Subject: [PATCH] [update] remove dummy functions --- deepface/models/demography/Age.py | 26 -------------------------- deepface/models/demography/Gender.py | 21 --------------------- 2 files changed, 47 deletions(-) diff --git a/deepface/models/demography/Age.py b/deepface/models/demography/Age.py index 236bbdf..57ffbcf 100644 --- a/deepface/models/demography/Age.py +++ b/deepface/models/demography/Age.py @@ -75,32 +75,6 @@ class ApparentAgeClient(Demography): return apparent_ages - - def predicts(self, imgs: List[np.ndarray]) -> np.ndarray: - """ - Predict apparent ages of multiple faces - Args: - imgs (List[np.ndarray]): (n, 224, 224, 3) - Returns: - apparent_ages (np.ndarray): (n,) - """ - # Convert list to numpy array - imgs_:np.ndarray = np.array(imgs) - # Remove batch dimension if exists - imgs_ = imgs_.squeeze() - # Check if the input is a single image - if len(imgs_.shape) == 3: - # Add batch dimension if not exists - imgs_ = np.expand_dims(imgs_, axis=0) - # Batch prediction - age_predictions = self.model.predict_on_batch(imgs_) - apparent_ages = np.array( - [find_apparent_age(age_prediction) for age_prediction in age_predictions] - ) - return apparent_ages - - - def load_model( url=WEIGHTS_URL, ) -> Model: diff --git a/deepface/models/demography/Gender.py b/deepface/models/demography/Gender.py index 2ef4cc2..1c06a76 100644 --- a/deepface/models/demography/Gender.py +++ b/deepface/models/demography/Gender.py @@ -70,27 +70,6 @@ class GenderClient(Demography): return predictions - - def predicts(self, imgs: List[np.ndarray]) -> np.ndarray: - """ - Predict apparent ages of multiple faces - Args: - imgs (List[np.ndarray]): (n, 224, 224, 3) - Returns: - apparent_ages (np.ndarray): (n,) - """ - # Convert list to numpy array - imgs_:np.ndarray = np.array(imgs) - # Remove redundant dimensions - imgs_ = imgs_.squeeze() - # Check if the input is a single image - if len(imgs_.shape) == 3: - # Add batch dimension - imgs_ = np.expand_dims(imgs_, axis=0) - return self.model.predict_on_batch(imgs_) - - - def load_model( url=WEIGHTS_URL, ) -> Model: