Closed Testbild closed 2 years ago
I was also facing the same problem. It was solved by adding this line "if color != '(0, 0, 0)': " into the second for loop.
.
.
.
for color, sub_mask in sub_masks.items():
if color != '(0, 0, 0)':
category_id = category_colors[color]
.
.
.
I was just going to post this as I figured this out as well. Can confirm this works. Thanks for the quick reply!
Edit: One more thing, the color is a string and not a tuple, as I first thought. Maybe that saves someone some time.
Hello,
I have a question about background annotations:
I have a Black and White mask: Black == Background ; White == The object I segmented
Unfortunately now, when I only add the white part to the category the script complains, that it has a key error at (0,0,0). But if I add the (0,0,0) I have the issue, that the background also is an annotation.
Do you have any idea how to resolve this?