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

Method pil_resize

PATH/core/data/datasets/images/image_helper.py:179–192  ·  view source on GitHub ↗
(img, target_size, interpolation)

Source from the content-addressed store, hash-verified

177
178 @staticmethod
179 def pil_resize(img, target_size, interpolation):
180 assert isinstance(target_size, (list, tuple))
181
182 target_size = tuple(target_size)
183
184 if isinstance(img, Image.Image):
185 return img.resize(target_size, interpolation)
186
187 elif isinstance(img, np.ndarray):
188 pil_img = ImageHelper.np2img(img)
189 return ImageHelper.img2np(pil_img.resize(target_size, interpolation))
190
191 else:
192 exit(1)
193
194 @staticmethod
195 def cv2_resize(img, target_size, interpolation):

Callers 1

resizeMethod · 0.80

Calls 3

resizeMethod · 0.80
np2imgMethod · 0.80
img2npMethod · 0.80

Tested by

no test coverage detected