aboutsummaryrefslogtreecommitdiff
path: root/libs/datautils.py
diff options
context:
space:
mode:
Diffstat (limited to 'libs/datautils.py')
-rw-r--r--libs/datautils.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/libs/datautils.py b/libs/datautils.py
index feae481..6a7c506 100644
--- a/libs/datautils.py
+++ b/libs/datautils.py
@@ -115,3 +115,13 @@ class MultiCropDatasetWrapper(Dataset):
multi_crops = list(map(lambda trans: trans(img), self.transform))
return multi_crops, target
+
+
+class TwinTransform:
+ def __init__(self, transform):
+ self.transform = transform
+
+ def __call__(self, x):
+ v1 = self.transform(x)
+ v2 = self.transform(x)
+ return v1, v2