MCPcopy Create free account
hub / github.com/NVIDIA/semantic-segmentation / Resize

Class Resize

transforms/joint_transforms.py:372–386  ·  view source on GitHub ↗

Resize image to exact size of crop

Source from the content-addressed store, hash-verified

370
371
372class Resize(object):
373 """
374 Resize image to exact size of crop
375 """
376
377 def __init__(self, crop_size):
378 self.size = set_crop_size(crop_size)
379
380 def __call__(self, img, mask):
381 assert img.size == mask.size
382 w, h = img.size
383 if (w == h and w == self.size):
384 return img, mask
385 return (img.resize(self.size, Image.BICUBIC),
386 mask.resize(self.size, Image.NEAREST))
387
388
389class RandomSizedCrop(object):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected