mirror of
https://github.com/serengil/deepface.git
synced 2025-06-08 12:35:22 +00:00
Update DeepFace.py
build_model return type
This commit is contained in:
parent
e91e48bd6c
commit
19f7cf620d
@ -43,10 +43,13 @@ os.environ["TF_CPP_MIN_LOG_LEVEL"] = "3"
|
|||||||
tf_version = int(tf.__version__.split(".", maxsplit=1)[0])
|
tf_version = int(tf.__version__.split(".", maxsplit=1)[0])
|
||||||
if tf_version == 2:
|
if tf_version == 2:
|
||||||
tf.get_logger().setLevel(logging.ERROR)
|
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
|
This function builds a deepface model
|
||||||
Parameters:
|
Parameters:
|
||||||
@ -55,7 +58,7 @@ def build_model(model_name: str) -> Any:
|
|||||||
Age, Gender, Emotion, Race for facial attributes
|
Age, Gender, Emotion, Race for facial attributes
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
built deepface model (keras.engine.Functional)
|
built deepface model ( (tf.)keras.models.Model )
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# singleton design pattern
|
# singleton design pattern
|
||||||
|
Loading…
x
Reference in New Issue
Block a user