File tree Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ def preprocess(
19
19
assert "longest_edge" in config .vision_size , \
20
20
"preprocessing size must specify longest_edge"
21
21
22
- patch_size = tuple (config .vision_patch_size [d ] for d in ["height" , "width" ])
22
+ patch_size = tuple (config .vision_patch_size [d ] * 2 for d in ["height" , "width" ])
23
23
longest_edge = config .vision_size ["longest_edge" ]
24
24
resample = Image .Resampling (config .vision_resample )
25
25
image_mean = tuple (config .vision_image_mean )
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ def size_to_longest_edge_and_patch_size(
36
36
37
37
ratio = max (input_size [0 ] / max_size [0 ], input_size [1 ] / max_size [1 ])
38
38
if ratio > 1 :
39
- output_size = tuple (int (np .ceil (d / ratio )) for d in input_size )
39
+ output_size = tuple (max ( 1 , int (np .floor (d / ratio ) )) for d in input_size )
40
40
else :
41
41
output_size = input_size
42
42
You can’t perform that action at this time.
0 commit comments