MCPcopy Create free account
hub / github.com/amdegroot/ssd.pytorch / RandomMirror

Class RandomMirror

utils/augmentations.py:340–347  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

338
339
340class RandomMirror(object):
341 def __call__(self, image, boxes, classes):
342 _, width, _ = image.shape
343 if random.randint(2):
344 image = image[:, ::-1]
345 boxes = boxes.copy()
346 boxes[:, 0::2] = width - boxes[:, 2::-2]
347 return image, boxes, classes
348
349
350class SwapChannels(object):

Callers 1

__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected