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
|
# Optional dependency
|
||||||
try:
|
try:
|
||||||
from facenet_pytorch import MTCNN as fast_mtcnn
|
from facenet_pytorch import MTCNN as fast_mtcnn
|
||||||
except ModuleNotFoundError:
|
except ModuleNotFoundError as e:
|
||||||
print("This is an optional detector, ensure the library is installed. \
|
raise ImportError("This is an optional detector, ensure the library is installed. \
|
||||||
Please install using 'pip install facenet-pytorch' ")
|
Please install using 'pip install facenet-pytorch' ") from e
|
||||||
|
|
||||||
|
|
||||||
face_detector = fast_mtcnn(image_size=160,
|
face_detector = fast_mtcnn(image_size=160,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user