mirror of
https://github.com/serengil/deepface.git
synced 2025-06-09 04:55:24 +00:00
Amend wrong calculation of increased w and h
This commit is contained in:
parent
fe077308f4
commit
b62d6cc9a0
@ -118,8 +118,8 @@ def detect_faces(
|
|||||||
# Or uncomment this if you want to :
|
# Or uncomment this if you want to :
|
||||||
# Expand the facial region height and width by the provided percentage
|
# Expand the facial region height and width by the provided percentage
|
||||||
# ensuring that the expanded region stays within img.shape limits
|
# ensuring that the expanded region stays within img.shape limits
|
||||||
expanded_w = int(w * expand_percentage / 100)
|
expanded_w = w + int(w * expand_percentage / 100)
|
||||||
expanded_h = int(h * expand_percentage / 100)
|
expanded_h = h + int(h * expand_percentage / 100)
|
||||||
|
|
||||||
x = max(0, x - int((expanded_w - w) / 2))
|
x = max(0, x - int((expanded_w - w) / 2))
|
||||||
y = max(0, y - int((expanded_h - h) / 2))
|
y = max(0, y - int((expanded_h - h) / 2))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user