nightrome / cocostuff10k

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

Mismatch of annotation format in cocostuff-10k-v1.1.json and convertAnnotationsJSON.py #4

Closed absurdvision closed 7 years ago

absurdvision commented 7 years ago

Hii

The annotation for segmentation in cocostuff-10k-v1.1.json is a list. ie "segmentation":[ { "counts":xxxxxx, "size":[x,y] } ] How ever the output produced by convertAnnotationsJSON.py does not contain this . The corresponding code just has anndata['segmentation'] = Rs which will produce this "segmentation": { "counts":xxxxxx, "size":[x,y] }

Is this a bug or my understanding is wrong ?

nightrome commented 7 years ago

Hi, could it be that you haven't updated the Git repository in the last few days? The last changes were made yesterday and I did create the file with that script. Unfortunately I'll have to wait until Monday to investigate this in further detail. Note that the thing and stuff annotations look differently:

nightrome commented 7 years ago

Can I ask why your are interested in the format and the script that creates it? If you use the COCO API you should not have to write your own parsing tools..

absurdvision commented 7 years ago

I am using your script to convert annotations from my own datasets to coco format and I use RLE for my annotations.

The line anndata['segmentation'] = Rs does not introduce [] into the file. But my images contain only a single annotation, may the encode function provides a list if there are multiple regions ?

nightrome commented 7 years ago

I agree that the string Rs is always a list, even if it just has one element. Regarding multiple regions I don't agree. The RLE encoding seems to be able to encode several disconnected regions in one string. e.g. the one below covers 7 disconnected regions.

[{'counts': 'jg81V?2l@3R?7N2o@Bo>`0ONRACm>=31O3MMUAAk>`022N1O00005UAYOc>j02L[AYOd>g04O0N202M2O2OO10O2OMO2O4I7KbW81]hG5L3N2\\OGnA;P>HcAe0[>80002N1O002NO11ON2003M1OO100001O001O00000000MmAiNS>W133MN20000001OO100O10000N20000N2O100M300O100000000000000N2000000O10000M3N2003MO1O11OO100O11O00001O1O001O0000001O0000001O001O1OO12N1O1O1O001O2N00000gAkNW>W10000jAiNS>[1O1OL42NO1MkAkNU>U130000O1O1O10000001O00000000001O000000009G1O1OO1001O1O00001O001OO11O1O1O1OO1001ON22NO100O12N002NN2001O00O1001O1OO11O1O2N00L4000YBYNe=f1\\BZNd=i101OJ`B\\N`=f1\\BZNf=h10O12N1OO10000001O0000O11O00001O001O001OO11OO1001OgNPC1Q=NQC1o<NRC3m<MTC2l<^OdCa0g=O0O2O0O11O0O14MK43NM200102N4KM3M300YO@kAOd0=`=EkA1d09a=MZBMAK[>8i04N4J0122I29DO7O02J4OM400M3NN08J2Hl@MX?1Ta>4j^AKm@3R?0k@0V?7j@FQ?;o@Jn>9O4O10ON20O14VAYOb>o0\\Oc0MO11O1TB]Ni=e100000001OO1N200O11O00N2001O1O001O1O1O1O1O1O1O00O1O12N00001O00O100000000M30000N23M00M31O0000N21ON2LWBbNh=]16HPBmN0MQ>V1oAlNT>T1lAlNT>T14O11O000000001O1O1O0000O1O10kAiNQ>[10O1M30mAiNm=]10M3N200O100M31O002N00O1O1N2\\OeA3[>DfAL4>W>DRB9o=ERB<d>NMGPAO02Q?NWAOj>Ohi50cVJ;j@NZ>g0jAPOf=T1SBROj=\\1N2N0000O11O1O1O1O1O1OL\\B[Ne=b16O12NO12NKVBcNk=\\15MPBeNQ>U1oAkN01T>T150000N200O1N21OO1O100006aAkNW>X1O3MO12lAgNm=]110RBbNj=c1OO10000O1001OO11O00O1O1N23M5KO12N001O2NO1O11OjN]B?c=A]B?c=A]B?c=]O_B_OOS1OmNa=c0aBc0e=WO\\Bh0o=lNTBQ1Z>IXY6BXgI=PAEQ>R1K2@bNlB^1T=gNgBY1Y=hNfBX1Z=hNfBW1[=jNdBX1Z=hNfBY1Y=hNfBV1\\=a0N001O00O10000N21O1O1OXNgBW1[=iNeBX1Z=hNfBf03ZOW=0gBc02@V=MgBK0H7;NO[=2aBDb06a=4lAFT?6hk57QSJU1]O`NRCb1n<_NoBc1Q=]NoBc1Q=fNfBZ1Z=fNgBX1Z=hNeBZ1Z=>01O00O11O0000O11OYNgBX1X=hNhBX1X=hNhBX1X=hNiBX1V=hNjBW1W=eNhBH2c1U=bNSC\\1`=101O01O0N200O1N2O1N5M2L102NYO', 'size': [496L, 640L]}]

absurdvision commented 7 years ago

may the encode function provides a list if there are multiple regions ?

This was just a thought.

I agree that the string Rs is always a list, even if it just has one element.

For me the encode function gives out a dict, not a list of dicts. This is the source of confusion. According to code anndata['segmentation'] = Rs whill not put a [] in the JSON. Hence it comes out wrong. I have attached a screen shot of this untitled

nightrome commented 7 years ago

Yes, I meant dict when I wrote string :-). Why don't you just always convert it to a list? (you can check with "isinstance(Rs, list)") You might also want to update your COCO API, as it seems that some changes were made on Dec 17 2016 to the Mask API. I'd also suggest using Python 2.x as the code seems to be slightly different for 3.x.

absurdvision commented 7 years ago

Why don't you just always convert it to a list? (you can check with "isinstance(Rs, list)")

Yes this is what I am doing now.

You might also want to update your COCO API, as it seems that some changes were made on Dec 17 2016 to the Mask API.

Already up to date.

Thanks for taking time to respond.