Commit 5dcd31d 1 parent 253fdd0 commit 5dcd31d Copy full SHA for 5dcd31d
File tree 1 file changed +5
-4
lines changed
1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 4
4
5
5
if __name__ == '__main__' :
6
6
7
+ # Load config
7
8
opt = Option ()
8
9
img_paths = opt .img_paths
9
10
10
- # pick first one
11
+ # Pick first one
11
12
raw_img = cv2 .imread (opt .get_first_one ().absolute ().as_posix ())
12
13
13
- # choose how to crop
14
+ # Choose how to crop
14
15
cropper = Cropper (raw_img )
15
16
16
17
if cropper .cropped :
22
23
23
24
last_size = None
24
25
25
- # list all images to crop
26
+ # List all images to crop
26
27
for img_path in img_paths :
27
28
28
29
img = cv2 .imread (img_path .absolute ().as_posix ())
53
54
else :
54
55
last_size = size
55
56
56
- # cropping other images
57
+ # Cropping other images
57
58
cropped_img = img [starty :endy , startx :endx , :]
58
59
cv2 .imwrite ((opt .output_path / img_path .name ).absolute ().as_posix (), cropped_img )
You can’t perform that action at this time.
0 commit comments