Skip to content

Commit

Permalink
Increase protrait size to 2.5x face-tag size
Browse files Browse the repository at this point in the history
  • Loading branch information
cbenning committed Jun 10, 2020
1 parent 6170270 commit 9fe3fa4
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions generator/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ def _increase_size(self, left, top, right, bottom, w, h, target_ratio):
def calculate_face_crop_dimensions(self, input_size, face_size, face_position):

target_ratio = float(4/3)
target_upsize_ratio = float(1.6)
target_upsize_ratio = float(2.5)

x = int(input_size[0] * float(face_position[0]))
y = int(input_size[1] * float(face_position[1]))
Expand All @@ -165,7 +165,6 @@ def calculate_face_crop_dimensions(self, input_size, face_size, face_position):
top = y - int(h/2) + 1
bottom = y + int(h/2) - 1

print((left, top, right, bottom))
# try to increase
if float(right - left + 1 / bottom - top - 1) < target_ratio: # horizontal expansion needed
left, top, right, bottom = self._increase_w(left, top, right, bottom, input_size[0], input_size[1], target_ratio)
Expand Down

0 comments on commit 9fe3fa4

Please sign in to comment.