@@ -26,6 +26,7 @@ def main(
26
26
direct_visualization : bool = True ,
27
27
downscale_factor : int = 4 ,
28
28
height : Optional [int ] = None ,
29
+ bottom_border : Optional [int ] = None ,
29
30
width : int = RECOMMENDED_WIDTH ,
30
31
visualization_window_width : Fraction = Fraction (60 , 100 ),
31
32
crop_mode : Literal ['center' , 'random' ] = 'center' ,
@@ -38,6 +39,9 @@ def main(
38
39
if height is None :
39
40
height = RECOMMENDED_DIRECT_HEIGHT if direct_visualization else RECOMMENDED_INDIRECT_HEIGHT
40
41
42
+ if bottom_border is None :
43
+ bottom_border = RECOMMENDED_DIRECT_HEIGHT - height
44
+
41
45
return [
42
46
ConvertImageDType ('float32' ),
43
47
Grayscaler (),
@@ -176,11 +180,8 @@ def main(
176
180
'GOPR2959' : Cropper (left = 980 , right = 1810 , top = 400 , bottom = 1200 ),
177
181
'GOPR2960' : Cropper (left = 980 , right = 1810 , top = 400 , bottom = 1200 ),
178
182
},
179
- Cropper (height = height * downscale_factor , top = 0 ),
180
- {'center' : CenterCropper , 'random' : RandomCropper }[crop_mode ](
181
- width = width * downscale_factor
182
- ),
183
183
Downscaler (downscale_factor ),
184
+ Cropper (height = height , bottom_border = bottom_border ),
184
185
{'center' : CenterCropper , 'random' : RandomCropper }[crop_mode ](
185
186
width = round (width * visualization_window_width )
186
187
),
0 commit comments