Skip to content

Commit fc7a402

Browse files
committed
fix(scripts/make_boiling_processors): fix processors again and simplify pipeline
1 parent b5d6598 commit fc7a402

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

boiling_learning/scripts/make_boiling_processors.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ def main(
2626
direct_visualization: bool = True,
2727
downscale_factor: int = 4,
2828
height: Optional[int] = None,
29+
bottom_border: Optional[int] = None,
2930
width: int = RECOMMENDED_WIDTH,
3031
visualization_window_width: Fraction = Fraction(60, 100),
3132
crop_mode: Literal['center', 'random'] = 'center',
@@ -38,6 +39,9 @@ def main(
3839
if height is None:
3940
height = RECOMMENDED_DIRECT_HEIGHT if direct_visualization else RECOMMENDED_INDIRECT_HEIGHT
4041

42+
if bottom_border is None:
43+
bottom_border = RECOMMENDED_DIRECT_HEIGHT - height
44+
4145
return [
4246
ConvertImageDType('float32'),
4347
Grayscaler(),
@@ -176,11 +180,8 @@ def main(
176180
'GOPR2959': Cropper(left=980, right=1810, top=400, bottom=1200),
177181
'GOPR2960': Cropper(left=980, right=1810, top=400, bottom=1200),
178182
},
179-
Cropper(height=height * downscale_factor, top=0),
180-
{'center': CenterCropper, 'random': RandomCropper}[crop_mode](
181-
width=width * downscale_factor
182-
),
183183
Downscaler(downscale_factor),
184+
Cropper(height=height, bottom_border=bottom_border),
184185
{'center': CenterCropper, 'random': RandomCropper}[crop_mode](
185186
width=round(width * visualization_window_width)
186187
),

0 commit comments

Comments
 (0)