Update DeepFace.py

functional may come from keras or tf.keras. hard to manage in typing. used any for build_model.
This commit is contained in:
Sefik Ilkin Serengil 2023-12-18 09:31:54 +00:00 committed by GitHub
parent 8a5f2875fc
commit e4a43fd86b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -7,7 +7,6 @@ import pickle
import logging import logging
from typing import Any, Dict, List, Tuple, Union from typing import Any, Dict, List, Tuple, Union
from keras.engine.functional import Functional from keras.engine.functional import Functional
from deepface.basemodels import DlibResNet, SFace
# 3rd party dependencies # 3rd party dependencies
import numpy as np import numpy as np
@ -48,7 +47,7 @@ if tf_version == 2:
# ----------------------------------- # -----------------------------------
def build_model(model_name: str) -> Union[Functional, DlibResNet.DlibResNet, SFace.SFaceModel]: def build_model(model_name: str) -> Any:
""" """
This function builds a deepface model This function builds a deepface model
Parameters: Parameters: