AhmadMustafa commited on
Commit
0633d98
·
1 Parent(s): fab5aaa

update: 16:9 top margin

Browse files
Files changed (1) hide show
  1. crop_utils.py +2 -2
crop_utils.py CHANGED
@@ -455,7 +455,7 @@ def create_layouts(image, left_division, right_division):
455
  target_height_16_9 = int(cutout_width / aspect_16_9)
456
  if target_height_16_9 <= cutout_height:
457
  # Calculate 20% of person height for top margin
458
- top_margin = int(person_height * 0.2)
459
 
460
  # Start 20% above the person's top
461
  y_start = int(max(0, person_top - top_margin))
@@ -1111,7 +1111,7 @@ def draw_layout_regions(
1111
  target_height_16_9 = int(cutout_width / aspect_16_9)
1112
 
1113
  # Calculate 20% of person height for top margin
1114
- top_margin = int(original_person_height * 0.2)
1115
  y_start = int(max(0, original_person_top - top_margin))
1116
  if y_start + target_height_16_9 > height:
1117
  y_start = int(max(0, height - target_height_16_9))
 
455
  target_height_16_9 = int(cutout_width / aspect_16_9)
456
  if target_height_16_9 <= cutout_height:
457
  # Calculate 20% of person height for top margin
458
+ top_margin = int(person_height * 0.05)
459
 
460
  # Start 20% above the person's top
461
  y_start = int(max(0, person_top - top_margin))
 
1111
  target_height_16_9 = int(cutout_width / aspect_16_9)
1112
 
1113
  # Calculate 20% of person height for top margin
1114
+ top_margin = int(original_person_height * 0.05)
1115
  y_start = int(max(0, original_person_top - top_margin))
1116
  if y_start + target_height_16_9 > height:
1117
  y_start = int(max(0, height - target_height_16_9))