Skip to content

Commit 0113306

Browse files
committed
a
1 parent 7457acb commit 0113306

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

mmseg/datasets/pipelines/hubmap_transforms.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import numpy as np
33
import albumentations as A
44
from albumentations.pytorch import ToTensorV2
5+
import cv2
56

67
def aug_mega_hardcore(p=.95):
78
return A.Compose([
@@ -56,6 +57,11 @@ def __call__(self, results):
5657
transformed_image = transformed['image']
5758
transformed_masks = transformed['masks']
5859

60+
transformed_image = np.float32(transformed_image) if transformed_image.dtype != np.float32 else transformed_image.copy()
61+
assert transformed_image.dtype != np.uint8
62+
#if to_rgb:
63+
cv2.cvtColor(transformed_image, cv2.COLOR_BGR2RGB, transformed_image) # inplace
64+
5965
results['img'] = transformed_image
6066
for key, mask in zip(keys, transformed_masks):
6167
results[key] = mask

0 commit comments

Comments
 (0)