dlib, mtcnn and lgbm optional

This commit is contained in:
Şefik Serangil 2020-09-17 20:27:42 +03:00
parent f3de735d72
commit 33fe352930
3 changed files with 4 additions and 7 deletions

View File

@ -1,4 +1,4 @@
import dlib import dlib #19.20.0
import os import os
import zipfile import zipfile
import bz2 import bz2

View File

@ -18,7 +18,6 @@ import tensorflow as tf
import keras import keras
import bz2 import bz2
from deepface.commons import distance from deepface.commons import distance
from mtcnn import MTCNN
def loadBase64Img(uri): def loadBase64Img(uri):
encoded_data = uri.split(',')[1] encoded_data = uri.split(',')[1]
@ -276,7 +275,7 @@ def detect_face(img, detector_backend = 'opencv', grayscale = False, enforce_det
raise ValueError("Face could not be detected. Please confirm that the picture is a face photo or consider to set enforce_detection param to False.") raise ValueError("Face could not be detected. Please confirm that the picture is a face photo or consider to set enforce_detection param to False.")
elif detector_backend == 'mtcnn': elif detector_backend == 'mtcnn':
from mtcnn import MTCNN #0.1.0
mtcnn_detector = MTCNN() mtcnn_detector = MTCNN()
detections = mtcnn_detector.detect_faces(img) detections = mtcnn_detector.detect_faces(img)
@ -432,6 +431,7 @@ def align_face(img, detector_backend = 'opencv'):
elif detector_backend == 'mtcnn': elif detector_backend == 'mtcnn':
from mtcnn import MTCNN #0.1.0
mtcnn_detector = MTCNN() mtcnn_detector = MTCNN()
detections = mtcnn_detector.detect_faces(img) detections = mtcnn_detector.detect_faces(img)

View File

@ -6,7 +6,4 @@ Pillow>=5.2.0
opencv-python>=3.4.4 opencv-python>=3.4.4
tensorflow>=1.9.0 tensorflow>=1.9.0
keras>=2.2.0 keras>=2.2.0
Flask>=1.1.2 Flask>=1.1.2
lightgbm>=2.3.1
dlib>=19.20.0
mtcnn>=0.1.0