cvat-ai / cvat

Annotate better with CVAT, the industry-leading data engine for machine learning. Used and trusted by teams at any scale, for data of any scale.
https://cvat.ai
MIT License
12.39k stars 2.97k forks source link

Could not upload Segmentation Mask 1.1 Annotation #6830

Closed jayhuashi closed 1 year ago

jayhuashi commented 1 year ago

My actions before raising this issue

I could not upload my Segmentation Mask 1.1 Annotation to the existing task. It says Error: Request failed with status code 400. "Failed to import item ('000015', 'default'): 'Undeclared color (23, 190, 207)

The error is shown below: Screenshot 2023-09-07 at 15 43 09

I wonder is there a list of pre-defined colors I can use for SegmentationObject mask for the Segmentation Mask 1.1 Format? I have a image with about 3000 instances and each of the mask I use a unique color mapping by the color map "ListedColormap(plt.cm.get_cmap('tab20', num_instances)(range(num_instances)))"

I'm using the web version of the CVAT tool.

bsekachev commented 1 year ago

@jayhuashi

Probably there is not a label with such color rgb(23,190,207) in your task and uploader can not match this color with any label.

jayhuashi commented 1 year ago

@bsekachev

Thank you for the timely response! However, when I inspect the 'Segmentation Mask 1.1' format dataset export from the CVAT, the 'labelmap.txt' records the color corresponding to the class, the 'SegmentationClass' folder is the semantic segmentation map, and the 'SegmentationObject' folder is the instance map which each instance has a unique RGB color. The color for each instance is not declared or defined in any '.txt' file from what I see.

In my case, I followed my inspection to create my annotation and I think this 'Undeclared color (23, 190, 207)' is from what I used for an instance in the 'SegmentationObject' folder, so I'm not sure how I should I resolve this problem.

bsekachev commented 1 year ago

@jayhuashi

How many objects do you have on this frame?

jayhuashi commented 1 year ago

@bsekachev 2847

bsekachev commented 1 year ago

I can suggest that this format can not handle more than 256 objects per image. But let's ask @zhiltsov-max

bsekachev commented 1 year ago

@jayhuashi

It was submitted, that format can not handle more than 256 objects per image. We should improve error message or at least drop a corresponding line to documentation. Please, use another format to import such a big amount of masks.

zhiltsov-max commented 1 year ago

Hi, this format cannot represent more than 256 instances per image. Please consider using some other format if you need more than this number of instances. From mask-specific formats, CamVid also supports 256, and Cityscapes allows up to 1000. KITTI can work in one of its representations with indexed int32 PNG instance masks. I assume, you will need to try something different, such as our CVAT and Datumaro formats or COCO instances, which don't use masks for this data. Another option is OpenImages.

jayhuashi commented 1 year ago

@zhiltsov-max

Thank you for your detailed explanation! I will adjust it based on your suggestion.