mirror of
https://github.com/serengil/deepface.git
synced 2025-06-07 12:05:22 +00:00
region bug for dlib sorted
This commit is contained in:
parent
626aa2e385
commit
c9569cd540
@ -113,12 +113,14 @@ class DlibClient(Detector):
|
|||||||
top = d.top()
|
top = d.top()
|
||||||
bottom = d.bottom()
|
bottom = d.bottom()
|
||||||
|
|
||||||
# detected_face = img[top:bottom, left:right]
|
y = int(max(0, top))
|
||||||
detected_face = img[
|
h = int(min(bottom, img.shape[0]) - y)
|
||||||
max(0, top) : min(bottom, img.shape[0]), max(0, left) : min(right, img.shape[1])
|
x = int(max(0, left))
|
||||||
]
|
w = int(min(right, img.shape[1]) - x)
|
||||||
|
|
||||||
img_region = FacialAreaRegion(x=left, y=right, w=right - left, h=bottom - top)
|
detected_face = img[int(y) : int(y + h), int(x) : int(x + w)]
|
||||||
|
|
||||||
|
img_region = FacialAreaRegion(x=x, y=y, w=w, h=h)
|
||||||
confidence = scores[idx]
|
confidence = scores[idx]
|
||||||
|
|
||||||
if align:
|
if align:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user