mirror of
https://github.com/serengil/deepface.git
synced 2025-06-07 12:05:22 +00:00
Add error msg for failed import
This commit is contained in:
parent
c53366b75a
commit
cca3422b54
@ -6,7 +6,11 @@ from deepface.detectors import FaceDetector
|
|||||||
|
|
||||||
def build_model():
|
def build_model():
|
||||||
# Optional dependency
|
# Optional dependency
|
||||||
from facenet_pytorch import MTCNN as fast_mtcnn
|
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' ")
|
||||||
|
|
||||||
|
|
||||||
face_detector = fast_mtcnn(image_size=160,
|
face_detector = fast_mtcnn(image_size=160,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user