roboflow / notebooks

Examples and tutorials on using SOTA computer vision models and techniques. Learn everything from old-school ResNet, through YOLO and object-detection transformers like DETR, to the latest models like Grounding DINO and SAM.
https://roboflow.com/models
5.43k stars 855 forks source link

Cannot export required format from Roboflow for segformer notebook #23

Closed robmarkcole closed 1 year ago

robmarkcole commented 1 year ago

Search before asking

Notebook name

train-segformer-segmentation-on-custom-data.ipynb

Bug

The notebook exports the baloon dataset as:

dataset = project.version(1).download("png-mask-semantic")

However on my custom dataset on Roboflow the only available semantic segmentation is coco-segmentation. I am not sure if this is specific to my dataset or a general issue?

Environment

Colab

Minimal Reproducible Example

No response

Additional

No response

Are you willing to submit a PR?

SkalskiP commented 1 year ago

Hello again, @robmarkcole 👋🏻! Is your project Semantic Segmentation or Instance Segmentation? png-mask-semantic export format is only available for Semantic Segmentation projects. You can find it in export menu under Semantic Segmentation Mask.

It would be great if you could write what confused you. The fact that the format is only available to selected segmentation projects or a different name in the UI than the key to be passed in the download function? We are constantly looking for things we can improve in Roboflow.

Screenshot 2022-12-14 at 21 03 18

robmarkcole commented 1 year ago

Hi @SkalskiP the source dataset is at https://github.com/chaozhong2010/HRSID and it is supplied with both instance and semantic segmentation annotations (as far as I can tell). I created my dataset as 'instance segmentation' on Roboflow but can see that it has not uniquely identified each instance. In this case I will need to recreate the dataset as 'semantic segmentation'? I would have thought I would be able to export both formats from an instance segmentation dataset, and this ability to convert between formats is one of the strengths of Roboflow in general

image
robmarkcole commented 1 year ago

I have created a new version of the dataset as semantic segmentation and can now download the png-mask-semantic annotations, so this is resolved. I do think it would be good to be able to allow both types of annotation if possible

SkalskiP commented 1 year ago

Haha, I was just responding to your yesterday's comment.

Sorry, it took me so long, but I was confirming my opinion with the team. Unfortunately, it's impossible to convert the instance segmentation project into semantic segmentation one or export semantic segmentation labels from the instance segmentation project. You can only export COCO annotations from the instance segmentation project and load them as a new semantic segmentation project. But I can assure you this issue will spark an internal conversation about instance/semantic segmentation projects.

One sentence in your previous comment got me curious.

but can see that it has not uniquely identified each instance

What do you mean? Is that something that doesn't work on our side?

robmarkcole commented 1 year ago

From the screenshot I shared it looks like all boats are the same colour so I think it has not picked them up as individual ships. I would need to recreate the dataset again to check

SkalskiP commented 1 year ago

Oh. Color only indicates the class of the object, not the individual id. So if you have different classes of ships - tankers, cargo, then they would be marked with different colors. But every ship from the same class would have the same color.

@robmarkcole, can I help you with anything more here, or can we close the issue?

robmarkcole commented 1 year ago

OK thanks!

SkalskiP commented 1 year ago

Thanks for pointing out all those issues :)