Skip to content

Commit

Permalink
Update DeepFace.py
Browse files Browse the repository at this point in the history
build_model return type
  • Loading branch information
serengil authored Dec 18, 2023
1 parent e91e48b commit 19f7cf6
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions deepface/DeepFace.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,13 @@
tf_version = int(tf.__version__.split(".", maxsplit=1)[0])
if tf_version == 2:
tf.get_logger().setLevel(logging.ERROR)
from tensorflow.keras.models import Model
else:
from keras.models import Model
# -----------------------------------


def build_model(model_name: str) -> Any:
def build_model(model_name: str) -> Union[Model, Any]:
"""
This function builds a deepface model
Parameters:
Expand All @@ -55,7 +58,7 @@ def build_model(model_name: str) -> Any:
Age, Gender, Emotion, Race for facial attributes
Returns:
built deepface model (keras.engine.Functional)
built deepface model ( (tf.)keras.models.Model )
"""

# singleton design pattern
Expand Down

0 comments on commit 19f7cf6

Please sign in to comment.