nightrome / cocostuff10k

The official homepage of the (outdated) COCO-Stuff 10K dataset.
https://arxiv.org/abs/1612.03716
277 stars 55 forks source link

Matlab command convertAnnotationsDeeplab() doesn't work #24

Closed night-zhang closed 6 years ago

night-zhang commented 6 years ago

Hi all,

While I was using annotator to convert my own annotations to DeepLab format, I failed to do so.

Here is what I did,

  1. I followed the procedure and ran the Matlab command "CocoStuffAnnotator()". I was able to annotate my own image and saved changes.
  2. I then ran the Matalb command "convertAnnotationsDeeplab()". But Matlab gave me an error message like this:
    Reference to non-existent field 'S'.
     Error in convertAnnotationsDeeplab (line 26)
     labelMap = labelStruct.S;
  3. Since I did not change any line of code in Matlab scripts, I was thinking maybe something went wrong with my image file. Then I compared the example annotated image file and then applied my own annotation to that file. Interestingly, the results are different. Here is the labelStruct content of file annotated by myself:
COCO_train2014_000000439995_2.mat
      drawSizeMap: [427×640 double]
         imageIdx: 2
        imageName: 'COCO_train2014_000000439995'
        imageSize: [427 640 3]
         labelMap: [427×640 double]
       labelNames: {94×1 cell}
      timeDiffMap: [427×640 double]
        timeImage: 19.6003
    timeImageDraw: 0
          timeMap: [427×640 double]
        timeTotal: 6.4350
         userName: 'example'

Here is the labelStruct content of default annotated file:

COCO_train2014_000000439995.mat
                    S: [427×640 double]
             captions: {5×1 cell}
                names: {182×1 cell}
    regionLabelsStuff: [925×1 double]
       regionMapStuff: [427×640 double]

Clearly, the output of CocoStuff annotator does not contain field "S", which could fail the Matalb command "convertAnnotationsDeeplab(). Why is that?

Thanks in advance!

nightrome commented 6 years ago

Yes, the annotator uses its own format that is not supposed to be compatible to the annotations we provide and that are converted by the convertAnnotationsDeeplab script. You can see what the annotator stores here. Feel free to change it to what you need. E.g. labelMap is similar to S, but contains additional values for 'unprocessed', 'unlabeled' and 'things' (see here).