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

Method __call__

PATH/core/data/transforms/parsing_transforms.py:220–237  ·  view source on GitHub ↗
(self, image, label=None)

Source from the content-addressed store, hash-verified

218 self.auto_bound=auto_bound
219
220 def __call__(self, image, label=None):
221 if not self.is_rotate or random.random() < self.p:
222 return image, label
223 degree = random.uniform(min(*self.degree), max(*self.degree))
224 image = self._rotate(
225 image,
226 angle=degree,
227 border_value=self.pad_val,
228 center=self.center,
229 auto_bound=self.auto_bound)
230 label = self._rotate(
231 label,
232 angle=degree,
233 border_value=self.seg_pad_val,
234 center=self.center,
235 auto_bound=self.auto_bound,
236 interpolation='nearest')
237 return image, label
238
239 def _rotate(self, img, angle, center=None, scale=1.0, border_value=0, interpolation='bilinear', auto_bound=False):
240 if center is not None and auto_bound:

Callers

nothing calls this directly

Calls 1

_rotateMethod · 0.95

Tested by

no test coverage detected