MCPcopy Create free account
hub / github.com/VisionXLab/OF-Diff / _augment

Function _augment

ldm/modules/image_degradation/utils_image.py:475–482  ·  view source on GitHub ↗
(img)

Source from the content-addressed store, hash-verified

473 rot90 = rot and random.random() < 0.5
474
475 def _augment(img):
476 if hflip:
477 img = img[:, ::-1, :]
478 if vflip:
479 img = img[::-1, :, :]
480 if rot90:
481 img = img.transpose(1, 0, 2)
482 return img
483
484 return [_augment(img) for img in img_list]
485

Callers 1

augment_imgsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected