Skip to content

Commit

Permalink
previous code
Browse files Browse the repository at this point in the history
  • Loading branch information
serengil authored Jan 19, 2022
1 parent 71ffe92 commit 3485c34
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions deepface/detectors/DlibWrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,10 @@ def detect_face(detector, img, align = True):
for idx, d in enumerate(detections):
left = d.left(); right = d.right()
top = d.top(); bottom = d.bottom()

#detected_face = img[top:bottom, left:right]
detected_face = img[max(0, top): min(bottom, img.shape[0]), max(0, left): min(right, img.shape[1])]

img_region = [left, top, right - left, bottom - top]

if align:
Expand Down

0 comments on commit 3485c34

Please sign in to comment.