Merge branch 'dev'

This commit is contained in:
kingbri
2025-07-13 18:05:44 -04:00
2 changed files with 2 additions and 2 deletions

View File

@@ -19,7 +19,7 @@ def preprocess(
assert "longest_edge" in config.vision_size, \
"preprocessing size must specify longest_edge"
patch_size = tuple(config.vision_patch_size[d] for d in ["height", "width"])
patch_size = tuple(config.vision_patch_size[d] * 2 for d in ["height", "width"])
longest_edge = config.vision_size["longest_edge"]
resample = Image.Resampling(config.vision_resample)
image_mean = tuple(config.vision_image_mean)

View File

@@ -36,7 +36,7 @@ def size_to_longest_edge_and_patch_size(
ratio = max(input_size[0] / max_size[0], input_size[1] / max_size[1])
if ratio > 1:
output_size = tuple(int(np.ceil(d / ratio)) for d in input_size)
output_size = tuple(max(1, int(np.floor(d / ratio))) for d in input_size)
else:
output_size = input_size