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

Function augment_img_np3

ldm/modules/image_degradation/utils_image.py:441–466  ·  view source on GitHub ↗
(img, mode=0)

Source from the content-addressed store, hash-verified

439
440
441def augment_img_np3(img, mode=0):
442 if mode == 0:
443 return img
444 elif mode == 1:
445 return img.transpose(1, 0, 2)
446 elif mode == 2:
447 return img[::-1, :, :]
448 elif mode == 3:
449 img = img[::-1, :, :]
450 img = img.transpose(1, 0, 2)
451 return img
452 elif mode == 4:
453 return img[:, ::-1, :]
454 elif mode == 5:
455 img = img[:, ::-1, :]
456 img = img.transpose(1, 0, 2)
457 return img
458 elif mode == 6:
459 img = img[:, ::-1, :]
460 img = img[::-1, :, :]
461 return img
462 elif mode == 7:
463 img = img[:, ::-1, :]
464 img = img[::-1, :, :]
465 img = img.transpose(1, 0, 2)
466 return img
467
468
469def augment_imgs(img_list, hflip=True, rot=True):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected