11 lines
222 B
Python
11 lines
222 B
Python
import random
|
|
|
|
|
|
class MirrorKeypoints:
|
|
def __call__(self, sample):
|
|
if random.random() > 0.5:
|
|
return sample
|
|
# flip the keypoints tensor
|
|
sample = 1 - sample
|
|
|
|
return sample |