Skip to content

Commit 3bc33c5

Browse files
committed
fix albumentations and data type for recent version of numpy
1 parent e799e1a commit 3bc33c5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

models/coral_dataset.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def augmentation_color(p=0.8):
2828
ISONoise(always_apply=False, p=0.2, intensity=(0.1, 0.3), color_shift=(0.01, 0.1)),
2929
FancyPCA(always_apply=False, p=0.05, alpha=0.01),
3030
Spatter(always_apply=False, p=0.2, mean=(0.65, 0.65), std=(0.3, 0.3), gauss_sigma=(0.72, 0.72),
31-
intensity=(0.6, 0.6), cutout_threshold=(0.68, 0.68), mode=['rain']),
31+
intensity=(0.6, 0.6), cutout_threshold=(0.68, 0.68), mode='rain'),
3232
PixelDropout(always_apply=False, p=0.2, dropout_prob=0.02, per_channel=False, drop_value=0.0,
3333
mask_drop_value=None)
3434
], p=p)
@@ -289,6 +289,7 @@ def importClassesFromDataset(labels_folder, labels_dictionary):
289289
data_crop = data[oy:oy + CROP_SIZE, ox:ox + CROP_SIZE]
290290

291291
# a color is transformed into a code
292+
data_crop = data_crop.astype(np.int32)
292293
color_codes = data_crop[:, :, 0] + data_crop[:, :, 1] * 256 + data_crop[:, :, 2] * 65536
293294
unique_colors = list(np.unique(color_codes))
294295
for color_code in unique_colors:

0 commit comments

Comments
 (0)