resize square image smaller
Browse files- square_crop.py +3 -0
square_crop.py
CHANGED
@@ -56,6 +56,9 @@ def crop_annotation(img_path, ann, out_dir, pad_color=0):
|
|
56 |
padding = (0, 0, delta_w, delta_h) # (left, top, right, bottom)
|
57 |
crop = ImageOps.expand(crop, padding, fill=pad_color)
|
58 |
|
|
|
|
|
|
|
59 |
# Build output filename: <stem>_ann<id>.ext
|
60 |
stem = Path(img_path).stem
|
61 |
suffix = Path(img_path).suffix
|
|
|
56 |
padding = (0, 0, delta_w, delta_h) # (left, top, right, bottom)
|
57 |
crop = ImageOps.expand(crop, padding, fill=pad_color)
|
58 |
|
59 |
+
# resize smaller so it takes less time to load
|
60 |
+
crop = crop.resize((640,640))
|
61 |
+
|
62 |
# Build output filename: <stem>_ann<id>.ext
|
63 |
stem = Path(img_path).stem
|
64 |
suffix = Path(img_path).suffix
|