MCPcopy Create free account
hub / github.com/OpenGVLab/HumanBench / resize

Method resize

PATH/core/data/datasets/images/image_helper.py:164–176  ·  view source on GitHub ↗
(img, target_size, interpolation=None)

Source from the content-addressed store, hash-verified

162
163 @staticmethod
164 def resize(img, target_size, interpolation=None):
165 assert isinstance(target_size, (list, tuple))
166 assert isinstance(interpolation, str)
167
168 target_size = tuple(target_size)
169 if isinstance(img, Image.Image):
170 return ImageHelper.pil_resize(img, target_size, interpolation=PIL_INTER_DICT[interpolation])
171
172 elif isinstance(img, np.ndarray):
173 return ImageHelper.cv2_resize(img, target_size, interpolation=CV2_INTER_DICT[interpolation])
174
175 else:
176 exit(1)
177
178 @staticmethod
179 def pil_resize(img, target_size, interpolation):

Callers 15

__call__Method · 0.80
__call__Method · 0.80
__call__Method · 0.80
__call__Method · 0.80
__call__Method · 0.80
__call__Method · 0.80
__call__Method · 0.80
__call__Method · 0.80
apply_imageMethod · 0.80
__call__Method · 0.80
__call__Method · 0.80
image_resizeMethod · 0.80

Calls 2

pil_resizeMethod · 0.80
cv2_resizeMethod · 0.80

Tested by

no test coverage detected