nightrome / cocostuff10k

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

.mat to .png conversion on dataset annotation files #13

Closed redzhepdx closed 6 years ago

redzhepdx commented 6 years ago

Hello after running the run_cocostuff_vgg16.sh script, I am getting this error :

Could not open or find file cocostuff/data/annotations/COCO_train2014_000000034795.png

It happens because all files' formats are .mat under annotations folder. I think this step doing it but I don't have any MATLAB experience and knowledge.

Convert the annotations by running the Matlab script: startup(); convertAnnotationsDeeplab();

thank you for all helps.

redzhepdx commented 6 years ago

Also I tried cocoSegmentationToPngDemo.py script with cocostuff-10k-v1.1.json file to create png image but this error occured at 16. image.

ValueError: invalid literal for long() with base 10: 'f\:110fc09mMMT@6k=MPB9KLQ>?aAL2ZOoN>\?e0ZAK1Id>a0UAK5Dd>e0RAK6fN_Oi0Y?h0j@aNMN0[1a0Ag>\2YAbMh>^2XAbMg>_2XAbMg>_2XAdMf>\2[AcMe>]2[AdMe>[2[AeMf>Z2k@hL;o0i>2TAMn>c2m@]MT?g3001OK4N3M3L4M31O01O03M2hLSAVN'

nightrome commented 6 years ago

This used to work! Are you using anything weird like Windows, Python 3 etc.?

redzhepdx commented 6 years ago

I am using python2.7 and ubuntu 16.04 for it. Also, I converted 45k(40k train, 5k validation) COCO segmentation annotation to png without problem. When I tried to train model with them, this error occurred:

unexpected label 201. num: 0. row: 0. col: 31 deep_lab_v2

After a research about this problem, I found that .png annotations must be one layer image. But this cocoSegmentationToPngDemo.py script creating RGB images. I can create one layer png file but I need to learn each object's individual color code in RGB format.

nightrome commented 6 years ago

You are mixing two things here. The COCO-Stuff API is for the challenge and has nothing to do with the 10k release in this repo! What you need for the 10k version is this script: https://github.com/nightrome/cocostuff/blob/master/dataset/code/conversion/convertAnnotationsDeeplab.m

redzhepdx commented 6 years ago

Ohh sorry. second one is completely different situation should wait for your answer:D. I don't have licenced matlab but it seems it is easy to convert python.

In second part what if I want to use whole Coco-stuff dataset , what should I do? Their annotation images are in rgb format.

nightrome commented 6 years ago

The whole COCO-Stuff dataset has annotations in .json and .png format. The .png files have a single channel (not RGB!) which indicates the label indices.