We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 114bae4 commit ae58e40Copy full SHA for ae58e40
mmseg/datasets/pipelines/hubmap_transforms.py
@@ -68,6 +68,29 @@ def __call__(self, results):
68
69
return results
70
71
+
72
+@PIPELINES.register_module()
73
+class HubmapTestTransform:
74
75
+ def __call__(self, results):
76
+ img = results['img']
77
+ keys = []
78
+ masks = []
79
+ for key in results.get('seg_fields', []):
80
+ keys.append(key)
81
+ masks.append(results[key])
82
83
+ img = np.float32(img) if img.dtype != np.float32 else img.copy()
84
+ assert img.dtype != np.uint8
85
+ #if to_rgb:
86
+ cv2.cvtColor(img, cv2.COLOR_BGR2RGB, img) # inplace
87
88
+ results['img'] = img
89
+ for key, mask in zip(keys, masks):
90
+ results[key] = mask
91
92
+ return results
93
94
#from albumentations.pytorch import ToTensor
95
#from get_config import get_config
96
0 commit comments