MCPcopy Create free account
hub / github.com/SLDGroup/EMCAD / __call__

Method __call__

utils/joint_transforms.py:82–94  ·  view source on GitHub ↗
(self, img, mask)

Source from the content-addressed store, hash-verified

80 self.size = size
81
82 def __call__(self, img, mask):
83 assert img.size == mask.size
84 w, h = img.size
85 if (w >= h and w == self.size) or (h >= w and h == self.size):
86 return img, mask
87 if w > h:
88 ow = self.size
89 oh = int(self.size * h / w)
90 return img.resize((ow, oh), Image.BILINEAR), mask.resize((ow, oh), Image.NEAREST)
91 else:
92 oh = self.size
93 ow = int(self.size * w / h)
94 return img.resize((ow, oh), Image.BILINEAR), mask.resize((ow, oh), Image.NEAREST)
95
96
97class RandomSizedCrop(object):

Callers

nothing calls this directly

Calls 1

resizeMethod · 0.80

Tested by

no test coverage detected