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

Function augment_img_tensor4

ldm/modules/image_degradation/utils_image.py:401–419  ·  view source on GitHub ↗

Kai Zhang (github: https://github.com/cszn)

(img, mode=0)

Source from the content-addressed store, hash-verified

399
400
401def augment_img_tensor4(img, mode=0):
402 '''Kai Zhang (github: https://github.com/cszn)
403 '''
404 if mode == 0:
405 return img
406 elif mode == 1:
407 return img.rot90(1, [2, 3]).flip([2])
408 elif mode == 2:
409 return img.flip([2])
410 elif mode == 3:
411 return img.rot90(3, [2, 3])
412 elif mode == 4:
413 return img.rot90(2, [2, 3]).flip([2])
414 elif mode == 5:
415 return img.rot90(1, [2, 3])
416 elif mode == 6:
417 return img.rot90(2, [2, 3])
418 elif mode == 7:
419 return img.rot90(3, [2, 3]).flip([2])
420
421
422def augment_img_tensor(img, mode=0):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected