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

Function augment_imgs

ldm/modules/image_degradation/utils_image.py:469–484  ·  view source on GitHub ↗
(img_list, hflip=True, rot=True)

Source from the content-addressed store, hash-verified

467
468
469def augment_imgs(img_list, hflip=True, rot=True):
470 # horizontal flip OR rotate
471 hflip = hflip and random.random() < 0.5
472 vflip = rot and random.random() < 0.5
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
486
487''&#x27;

Callers

nothing calls this directly

Calls 1

_augmentFunction · 0.85

Tested by

no test coverage detected