mirror of
https://github.com/serengil/deepface.git
synced 2025-06-08 20:45:22 +00:00
refactor try block
This commit is contained in:
parent
cca3422b54
commit
1bcc065a11
@ -8,9 +8,9 @@ def build_model():
|
||||
# Optional dependency
|
||||
try:
|
||||
from facenet_pytorch import MTCNN as fast_mtcnn
|
||||
except ModuleNotFoundError:
|
||||
print("This is an optional detector, ensure the library is installed. \
|
||||
Please install using 'pip install facenet-pytorch' ")
|
||||
except ModuleNotFoundError as e:
|
||||
raise ImportError("This is an optional detector, ensure the library is installed. \
|
||||
Please install using 'pip install facenet-pytorch' ") from e
|
||||
|
||||
|
||||
face_detector = fast_mtcnn(image_size=160,
|
||||
|
Loading…
x
Reference in New Issue
Block a user