MCPcopy Create free account
hub / github.com/InternRobotics/G2VLM / downscale

Function downscale

data/transforms.py:213–218  ·  view source on GitHub ↗
(image, scale_factor)

Source from the content-addressed store, hash-verified

211
212
213def downscale(image, scale_factor):
214 new_width = int(round(image.width * scale_factor))
215 new_height = int(round(image.height * scale_factor))
216 new_width = max(1, new_width)
217 new_height = max(1, new_height)
218 return image.resize((new_width, new_height), resample=Image.BICUBIC)
219
220
221def crop(image, crop_factors):

Callers

nothing calls this directly

Calls 1

resizeMethod · 0.80

Tested by

no test coverage detected