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 e21b8e2 commit 6e013f4Copy full SHA for 6e013f4
utils.py
@@ -85,9 +85,11 @@ def colorEncode(labelmap, colors):
85
labelmap_rgb = np.zeros((labelmap.shape[0], labelmap.shape[1], 3),
86
dtype=np.uint8)
87
for label in unique(labelmap):
88
- labelmap_rgb += (labelmap == label)[:, :, np.newaxis] * \
89
- np.tile(colors[label],
90
- (labelmap.shape[0], labelmap.shape[1], 1))
+ if label < 0:
+ continue
+ labelmap_rgb += (labelmap == label)[:, :, np.newaxis] * \
91
+ np.tile(colors[label],
92
+ (labelmap.shape[0], labelmap.shape[1], 1))
93
return labelmap_rgb
94
95
0 commit comments