Add DLIBExtractor.extract

Fix AttributeError: 'DLIBExtractor' object has no attribute 'extract'
This commit is contained in:
tyousou 2019-04-16 20:34:35 +08:00 committed by GitHub
commit c48e472a00
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -20,6 +20,9 @@ class DLIBExtractor(object):
def __exit__(self, exc_type=None, exc_value=None, traceback=None):
del self.dlib_cnn_face_detector
return False #pass exception between __enter__ and __exit__ to outter level
def extract(self, input_image, is_bgr=True):
return self.extract_from_bgr(input_image)
def extract_from_bgr (self, input_image):
input_image = input_image[:,:,::-1].copy()