When I use the API to download my semantic segmentation annotations using the ‘png-mask-semantic’ format, the class ids do not match the _classes.csv format.
I think the problem is that I have some unused classes. The png values seem to be “compacted” values, skipping unused entries, but the csv file contains all the values, so there is no way to go from compacted to original values.
Am I missing something? Or should I create a dummy image with all the annotations, or use another format?
I unlocked the classes, recounted and created a new dataset version. This has solved the problem, but it means I have lost the class names for the annotators to choose from.
Hi Hugh! I’d love to take a further look at this for you to see if we can troubleshoot the root issue. To help me triage further, would you be able to send a link to the project? Also, do you permit Roboflow support to access the project to help with troubleshooting?
Hi Patrick.
Actually, the project is no longer “broken” because once I hit the count-update button, the unused classes were removed (this itself was a little upsetting).
But these are the steps I think you need to reproduce this:
Create a sematic segmentation project
Add some annotation classes, “A”, “B”, “C”
Lock the classes
Digitize a polygon of class “C”
Download the project using the API in the “png-mask-semantic” format
You will get a “_classes.csv” with the 3 classes 1=A 2=B 3=C
But, the png image will have 1 in the C polygon.
I would expect either the _classes.csv to only have “1=C” OR the png to have class “3”
If you unlock the annotations update the count, you are left with only the “C” class and the _classes.csv now has 1=C, which is correct.
I would have also preferred an explicit “remove unused classes” button or popup, rather than automatically removing classes with 0 count from the “count-update” button on the “count” column, even when they are not locked.