Spaces:
Running
on
Zero
Running
on
Zero
patch tiny white gaps
Browse files
app.py
CHANGED
|
@@ -125,10 +125,11 @@ def prepare_image_and_mask(image, width, height, overlap_percentage, resize_opti
|
|
| 125 |
mask_draw = ImageDraw.Draw(mask)
|
| 126 |
|
| 127 |
# Calculate overlap areas
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
|
|
|
|
| 132 |
|
| 133 |
# Draw the mask
|
| 134 |
mask_draw.rectangle([
|
|
|
|
| 125 |
mask_draw = ImageDraw.Draw(mask)
|
| 126 |
|
| 127 |
# Calculate overlap areas
|
| 128 |
+
white_gaps_patch = 2
|
| 129 |
+
left_overlap = margin_x + overlap_x if overlap_left else margin_x + white_gaps_patch
|
| 130 |
+
right_overlap = margin_x + new_width - overlap_x if overlap_right else margin_x + new_width + white_gaps_patch
|
| 131 |
+
top_overlap = margin_y + overlap_y if overlap_top else margin_y + white_gaps_patch
|
| 132 |
+
bottom_overlap = margin_y + new_height - overlap_y if overlap_bottom else margin_y + new_height + white_gaps_patch
|
| 133 |
|
| 134 |
# Draw the mask
|
| 135 |
mask_draw.rectangle([
|