mirror of
https://github.com/serengil/deepface.git
synced 2025-06-06 19:45:21 +00:00
Revert OpenCvWrapper.py
This commit is contained in:
parent
0c50eb7178
commit
205eb0e23d
@ -44,9 +44,7 @@ def detect_face(detector, img, align=True):
|
||||
detected_face = None
|
||||
img_region = [0, 0, img.shape[1], img.shape[0]]
|
||||
|
||||
# Initialize faces and scores to empty lists
|
||||
faces = []
|
||||
scores = []
|
||||
try:
|
||||
# faces = detector["face_detector"].detectMultiScale(img, 1.3, 5)
|
||||
|
||||
@ -54,16 +52,10 @@ def detect_face(detector, img, align=True):
|
||||
faces, _, scores = detector["face_detector"].detectMultiScale3(
|
||||
img, 1.1, 10, outputRejectLevels=True
|
||||
)
|
||||
except:
|
||||
pass
|
||||
|
||||
# except alone is too broad and will catch keyboard interrupts
|
||||
# Exception should be changed to something more specific in the future
|
||||
except Exception: # pylint: disable=broad-except
|
||||
import traceback
|
||||
|
||||
print(traceback.format_exc())
|
||||
|
||||
# For each face and associated score, append face,
|
||||
# bounding box, and score to resp
|
||||
if len(faces) > 0:
|
||||
for (x, y, w, h), confidence in zip(faces, scores):
|
||||
detected_face = img[int(y) : int(y + h), int(x) : int(x + w)]
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user