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

Method get_transform

PATH/core/data/transforms/seg_aug_dev.py:414–423  ·  view source on GitHub ↗
(self, image)

Source from the content-addressed store, hash-verified

412 self._init(locals())
413
414 def get_transform(self, image):
415 h, w = image.shape[:2]
416 do = self._rand_range() < self.prob
417 if do:
418 if self.horizontal:
419 return HFlipTransform(w)
420 elif self.vertical:
421 return VFlipTransform(h)
422 else:
423 return NoOpTransform()
424
425
426class ResizeShortestEdge(Augmentation):

Callers 1

get_transformMethod · 0.45

Calls 4

HFlipTransformClass · 0.85
VFlipTransformClass · 0.85
NoOpTransformClass · 0.85
_rand_rangeMethod · 0.45

Tested by

no test coverage detected