Code Monkey home page Code Monkey logo

cocostuff10k's Introduction

COCO-Stuff 10K dataset v1.1 (outdated)

Holger Caesar, Jasper Uijlings, Vittorio Ferrari

Overview

COCO-Stuff example annotations

Welcome to official homepage of the COCO-Stuff [1] dataset. COCO-Stuff augments the popular COCO [2] dataset with pixel-level stuff annotations. These annotations can be used for scene understanding tasks like semantic segmentation, object detection and image captioning.

Overview

Highlights

  • 10,000 complex images from COCO [2]
  • Dense pixel-level annotations
  • 91 thing and 91 stuff classes
  • Instance-level annotations for things from COCO [2]
  • Complex spatial context between stuff and things
  • 5 captions per image from COCO [2]

Updates

  • 11 Jul 2017: Added working Deeplab models for Resnet and VGG
  • 06 Apr 2017: Dataset version 1.1: Modified label indices
  • 31 Mar 2017: Published annotations in JSON format
  • 09 Mar 2017: Added label hierarchy scripts
  • 08 Mar 2017: Corrections to table 2 in arXiv paper [1]
  • 10 Feb 2017: Added script to extract SLICO superpixels in annotation tool
  • 12 Dec 2016: Dataset version 1.0 and arXiv paper [1] released

Results

The current release of COCO-Stuff-10K publishes both the training and test annotations and users report their performance individually. We invite users to report their results to us to complement this table. In the near future we will extend COCO-Stuff to all images in COCO and organize an official challenge where the test annotations will only be known to the organizers.

For the updated table please click here.

Method Source Class-average accuracy Global accuracy Mean IOU FW IOU
FCN-16s [3] [1] 34.0% 52.0% 22.7% -
Deeplab VGG-16 (no CRF) [4] [1] 38.1% 57.8% 26.9% -
FCN-8s [3] [6] 38.5% 60.4% 27.2% -
DAG-RNN + CRF [6] [6] 42.8% 63.0% 31.2% -
OHE + DC + FCN+ [5] [5] 45.8% 66.6% 34.3% 51.2%
Deeplab ResNet (no CRF) [4] - 45.5% 65.1% 34.4% 50.4%
W2V + DC + FCN+ [5] [5] 45.1% 66.1% 34.7% 51.0%

Dataset

Filename Description Size
cocostuff-10k-v1.1.zip COCO-Stuff dataset v. 1.1, images and annotations 2.0 GB
cocostuff-10k-v1.1.json COCO-Stuff dataset v. 1.1, annotations in JSON format (optional) 62.3 MB
cocostuff-labels.txt A list of the 1+91+91 classes in COCO-Stuff 2.3 KB
cocostuff-readme.txt This document 6.5 KB
Older files
cocostuff-10k-v1.0.zip COCO-Stuff dataset version 1.0, including images and annotations 2.6 GB

Usage

To use the COCO-Stuff dataset, please follow these steps:

  1. Download or clone this repository using git: git clone https://github.com/nightrome/cocostuff10k.git
  2. Open the dataset folder in your shell: cd cocostuff10k
  3. If you have Matlab, run the following commands:
  • Add the code folder to your Matlab path: startup();
  • Run the demo script in Matlab demo_cocoStuff();
  • The script displays an image, its thing, stuff and thing+stuff annotations, as well as the image captions.
  1. Alternatively run the following Linux commands or manually download and unpack the dataset:
  • wget --directory-prefix=downloads http://calvin.inf.ed.ac.uk/wp-content/uploads/data/cocostuffdataset/cocostuff-10k-v1.1.zip
  • unzip downloads/cocostuff-10k-v1.1.zip -d dataset/

MAT Format

The COCO-Stuff annotations are stored in separate .mat files per image. These files follow the same format as used by Tighe et al.. Each file contains the following fields:

  • S: The pixel-wise label map of size [height x width].
  • names: The names of the thing and stuff classes in COCO-Stuff. For more details see Label Names & Indices.
  • captions: Image captions from [2] that are annotated by 5 distinct humans on average.
  • regionMapStuff: A map of the same size as S that contains the indices for the approx. 1000 regions (superpixels) used to annotate the image.
  • regionLabelsStuff: A list of the stuff labels for each superpixel. The indices in regionMapStuff correspond to the entries in regionLabelsStuff.

JSON Format

Alternatively, we also provide stuff and thing annotations in the COCO-style JSON format. The thing annotations are copied from COCO. We encode every stuff class present in an image as a single annotation using the RLE encoding format of COCO. To get the annotations:

  • Either download them: wget --directory-prefix=dataset/annotations-json http://calvin.inf.ed.ac.uk/wp-content/uploads/data/cocostuffdataset/cocostuff-10k-v1.1.json
  • Or extract them from the .mat file annotations using this Python script.

Label Names & Indices

To be compatible with COCO, version 1.1 of COCO-Stuff has 91 thing classes (1-91), 91 stuff classes (92-182) and 1 class "unlabeled" (0). Note that 11 of the thing classes from COCO 2015 do not have any segmentation annotations. The classes desk, door and mirror could be either stuff or things and therefore occur in both COCO and COCO-Stuff. To avoid confusion we add the suffix "-stuff" to those classes in COCO-Stuff. The full list of classes can be found here.

The older version 1.0 of COCO-Stuff had 80 thing classes (2-81), 91 stuff classes (82-172) and 1 class "unlabeled" (1).

Label Hierarchy

The hierarchy of labels is stored in CocoStuffClasses. To visualize it, run CocoStuffClasses.showClassHierarchyStuffThings() (also available for just stuff and just thing classes) in Matlab. The output should look similar to the following figure: COCO-Stuff label hierarchy

Semantic Segmentation Models

To encourage further research of stuff and things we provide the trained semantic segmentation model (see Sect. 4.4 in [1]).

DeepLab VGG-16

Use the following steps to download and setup the DeepLab [4] semantic segmentation model trained on COCO-Stuff. It requires deeplab-public-ver2, which is built on Caffe:

  1. Install Cuda. I recommend version 7.0. For version 8.0 you will need to apply the fix described here in step 3.
  2. Download deeplab-public-ver2: git submodule update --init models/deeplab/deeplab-public-ver2
  3. Compile and configure deeplab-public-ver2 following the author's instructions. Depending on your system setup you might have to install additional packages, but a minimum setup could look like this:
  • cd models/deeplab/deeplab-public-ver2
  • cp Makefile.config.example Makefile.config
  • Optionally add CuDNN support or modify library paths in the Makefile.
  • make all -j8
  • cd ../..
  1. Configure the COCO-Stuff dataset:
  • Create folders: mkdir models/deeplab/deeplab-public-ver2/cocostuff && mkdir models/deeplab/deeplab-public-ver2/cocostuff/data
  • Create a symbolic link to the images: cd models/deeplab/cocostuff/data && ln -s ../../../../dataset/images images && cd ../../../..
  • Convert the annotations by running the Matlab script: startup(); convertAnnotationsDeeplab();
  1. Download the base VGG-16 model:
  • wget --directory-prefix=models/deeplab/cocostuff/model/deeplabv2_vgg16 http://calvin.inf.ed.ac.uk/wp-content/uploads/data/cocostuffdataset/deeplabv2_vgg16_init.caffemodel
  1. Run cd models/deeplab && ./run_cocostuff_vgg16.sh to train and test the network on COCO-Stuff.

DeepLab ResNet 101

The default Deeplab model performs center crops of size 513*513 pixels of an image, if any side is larger than that. Since we want to segment the whole image at test time, we choose to resize the images to 513x513, perform the semantic segmentation and then rescale it elsewhere. Note that without the final step, the performance might differ slightly.

  1. Follow steps 1-4 of the DeepLab VGG-16 section above.
  2. Download the base ResNet model:
  • wget --directory-prefix=models/deeplab/cocostuff/model/deeplabv2_resnet101 http://calvin.inf.ed.ac.uk/wp-content/uploads/data/cocostuffdataset/deeplabv2_resnet101_init.caffemodel
  1. Rescale the images and annotations:
  • cd models/deeplab
  • python rescaleImages.py
  • python rescaleAnnotations.py
  1. Run ./run_cocostuff_resnet101.sh to train and test the network on COCO-Stuff.

Annotation Tool

In [1] we present a simple and efficient stuff annotation tool which was used to annotate the COCO-Stuff dataset. It uses a paintbrush tool to annotate SLICO superpixels (precomputed using the code of Achanta et al.) with stuff labels. These annotations are overlaid with the existing pixel-level thing annotations from COCO. We provide a basic version of our annotation tool:

  • Prepare the required data:
    • Specify a username in annotator/data/input/user.txt.
    • Create a list of images in annotator/data/input/imageLists/<user>.list.
    • Extract the thing annotations for all images in Matlab: extractThings().
    • Extract the superpixels for all images in Matlab: extractSLICOSuperpixels().
    • To enable or disable superpixels, thing annotations and polygon drawing, take a look at the flags at the top of CocoStuffAnnotator.m.
  • Run the annotation tool in Matlab: CocoStuffAnnotator();
    • The tool writes the .mat label files to annotator/data/output/annotations.
    • To create a .png preview of the annotations, run annotator/code/exportImages.m in Matlab. The previews will be saved to annotator/data/output/preview.

Misc

References

Licensing

COCO-Stuff is a derivative work of the COCO dataset. The authors of COCO do not in any form endorse this work. Different licenses apply:

Contact

If you have any questions regarding this dataset, please contact us at holger-at-it-caesar.com.

cocostuff10k's People

Contributors

nightrome avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cocostuff10k's Issues

Can I use this on an image ?

Hi,

Can I use this directly on images to get results ?

If I download the Semantic Segmentation Models will it work ?

Thanks

Have a wrong after run 'bash run_cocostuff.sh'

Thanks for your code.The following is the result after I implemented the command :bash run_cocostuff.sh.I don't kown where is wrong and how to solve it.Can you help me?

layer {
name: "drop7_2"
type: "Dropout"
bottom: "fc7_2"
top: "fc7_2"
dropout_param {
dropout_ratio: 0.5
}
}
layer {
name: "fc8_cocostuff_2"
type: "Convolution"
bottom: "fc7_2"
top: "fc8_cocostuff_2"
convolution_param {
num_output: 172
kernel_size: 1
}
}
layer {
name: "fc6_3"
type: "Convolution"
bottom: "pool5"
top: "fc6_3"
convolution_param {
num_output: 1024
pad: 18
kernel_size: 3
dilation: 18
}
}
layer {
name: "relu6_3"
type: "ReLU"
bottom: "fc6_3"
top: "fc6_3"
}
layer {
name: "drop6_3"
type: "Dropout"
bottom: "fc6_3"
top: "fc6_3"
dropout_param {
dropout_ratio: 0.5
}
}
layer {
name: "fc7_3"
type: "Convolution"
bottom: "fc6_3"
top: "fc7_3"
convolution_param {
num_output: 1024
kernel_size: 1
}
}
layer {
name: "relu7_3"
type: "ReLU"
bottom: "fc7_3"
top: "fc7_3"
}
layer {
name: "drop7_3"
type: "Dropout"
bottom: "fc7_3"
top: "fc7_3"
dropout_param {
dropout_ratio: 0.5
}
}
layer {
name: "fc8_cocostuff_3"
type: "Convolution"
bottom: "fc7_3"
top: "fc8_cocostuff_3"
convolution_param {
num_output: 172
kernel_size: 1
}
}
layer {
name: "fc6_4"
type: "Convolution"
bottom: "pool5"
top: "fc6_4"
convolution_param {
num_output: 1024
pad: 24
kernel_size: 3
dilation: 24
}
}
layer {
name: "relu6_4"
type: "ReLU"
bottom: "fc6_4"
top: "fc6_4"
}
layer {
name: "drop6_4"
type: "Dropout"
bottom: "fc6_4"
top: "fc6_4"
dropout_param {
dropout_ratio: 0.5
}
}
layer {
name: "fc7_4"
type: "Convolution"
bottom: "fc6_4"
top: "fc7_4"
convolution_param {
num_output: 1024
kernel_size: 1
}
}
layer {
name: "relu7_4"
type: "ReLU"
bottom: "fc7_4"
top: "fc7_4"
}
layer {
name: "drop7_4"
type: "Dropout"
bottom: "fc7_4"
top: "fc7_4"
dropout_param {
dropout_ratio: 0.5
}
}
layer {
name: "fc8_cocostuff_4"
type: "Convolution"
bottom: "fc7_4"
top: "fc8_cocostuff_4"
convolution_param {
num_output: 172
kernel_size: 1
}
}
layer {
name: "fc8_cocostuff"
type: "Eltwise"
bottom: "fc8_cocostuff_1"
bottom: "fc8_cocostuff_2"
bottom: "fc8_cocostuff_3"
bottom: "fc8_cocostuff_4"
top: "fc8_cocostuff"
eltwise_param {
operation: SUM
}
}
layer {
name: "fc8_interp"
type: "Interp"
bottom: "fc8_cocostuff"
top: "fc8_interp"
interp_param {
zoom_factor: 8
}
}
layer {
name: "fc8_mat"
type: "MatWrite"
bottom: "fc8_interp"
include {
phase: TEST
}
mat_write_param {
prefix: "cocostuff/features/deeplabv2_vgg16/val/fc8/"
source: "cocostuff/list/val_id.txt"
strip: 0
period: 1
}
}
layer {
name: "silence"
type: "Silence"
bottom: "label"
bottom: "data_dim"
}
I0616 15:55:01.469554 6570 layer_factory.hpp:77] Creating layer data
I0616 15:55:01.469599 6570 net.cpp:106] Creating Layer data
I0616 15:55:01.469609 6570 net.cpp:411] data -> data
I0616 15:55:01.469641 6570 net.cpp:411] data -> label
I0616 15:55:01.469656 6570 net.cpp:411] data -> data_dim
I0616 15:55:01.469676 6570 image_seg_data_layer.cpp:46] Opening file cocostuff/list/val.txt
I0616 15:55:01.470676 6570 image_seg_data_layer.cpp:68] A total of 1000 images.
F0616 15:55:01.510185 6570 syncedmem.hpp:18] Check failed: error == cudaSuccess (30 vs. 0) unknown error
*** Check failure stack trace: ***
@ 0x7fbaaa9dadaa (unknown)
@ 0x7fbaaa9dace4 (unknown)
@ 0x7fbaaa9da6e6 (unknown)
@ 0x7fbaaa9dd687 (unknown)
@ 0x7fbaab106ca8 caffe::SyncedMemory::mutable_cpu_data()
@ 0x7fbaab115f0c caffe::Blob<>::Reshape()
@ 0x7fbaab1163a9 caffe::Blob<>::Reshape()
@ 0x7fbaab00c95a caffe::ImageSegDataLayer<>::DataLayerSetUp()
@ 0x7fbaab08c3d3 caffe::ImageDimPrefetchingDataLayer<>::LayerSetUp()
@ 0x7fbaab159005 caffe::Net<>::Init()
@ 0x7fbaab15a758 caffe::Net<>::Net()
@ 0x406bf7 test()
@ 0x4059dc main
@ 0x7fbaa9ce5f45 (unknown)
@ 0x406111 (unknown)
@ (nil) (unknown)
run_cocostuff.sh: line 82: 6570 Aborted (core dumped) ${CMD}
hdl1@hdl1:~/cocostuff/models/deeplab-public-ver2$

prepare my own data as cocostuff

Hi
I have annotated json files of each image made through (labelme) tool how should I convert this into cocostuff dataset formt?

How about the full class list of older cocostuff1.0?

Hi, @nightrome , I appreciate for your works, it really helpful. But for fair comparison, I have to evaluate the models on the older COCO_stuff dataset, i.e., vision 1.0. I have no idea about the full class list of it which only contains 172 classes. Can you help me to get these information? Thanks a lot.

Matlab command convertAnnotationsDeeplab() doesn't work

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!

Additional Paths

Matlab is generating following error upon executing "demo_cocoStuff();" after "startup();"

Undefined function or variable 'imageInsertBlobLabels'.
Error in demo_cocoStuff (line 52)
labelMapThingsIm = imageInsertBlobLabels(labelMapThingsIm, labelMapThings, labelNames);

Additional paths are required in startup.m for specifying location of extra source files in Matlab 2015b.

addpath('dataset/code/utils');
addpath('dataset/code/conversion');

Unable to convert JSON to t7 format using COCO api

Hi I am trying to convert the provided json file cocostuff-10k-v1.1.json to t7 format using coco api available here. I am using the lua function coco.CocoApi("cocostuff-10k-v1.1.json") to do this. Iam getting an error
convert: cocostuff-10k-v1.1.json --> .t7 [please be patient] ...ri/mnt_hari/torch/install/share/lua/5.1/coco/CocoApi.lua:142: Expected comma or array end but found T_OBJ_BEGIN at character 104320833 stack traceback: [C]: in function 'decode' ...ri/mnt_hari/torch/install/share/lua/5.1/coco/CocoApi.lua:142: in function '__convert' ...ri/mnt_hari/torch/install/share/lua/5.1/coco/CocoApi.lua:128: in function '__init' ...hari/mnt_hari/torch/install/share/lua/5.1/torch/init.lua:91: in function <...hari/mnt_hari/torch/install/share/lua/5.1/torch/init.lua:87> [C]: in function 'CocoApi' [string "_RESULT={coco.CocoApi("cocostuff-10k-v1.1.jso..."]:1: in main chunk [C]: in function 'xpcall' ...hari/mnt_hari/torch/install/share/lua/5.1/trepl/init.lua:661: in function 'repl' ...hari/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:204: in main chunk [C]: at 0x00405d50 [1.4312s]
while running this. Is there a way to do this?

stuff annotation tool

Thanks for your great works. But I have questions : 1. Could this tool make bboxes of objects? 2. Could this tool make captions of single image? 3. Should all parts be labeled as some names?
Thanks a lot.

Annotation tool

cocostuff_error
In Annotation tool,
While doing this step: Extract the thing annotations for all images in Matlab: extractThings()
I get error on Matlab
Loading and preparing annotations... Undefined function or variable 'gasonMex'
Did anyone had similar issue or know how to fix it?
Thank you!

Convert to Yolo forman

Hello! I download COCO dataset for training dataset on YOLO. But annotations turns out on .json format. How i convert them to YOLO? YOLO have a .txt labels .

Thanks, and sorry if my question is stupid :-)

How can I visualize my DeepLab test results?

Hi,

First of all, thanks for your great work.

My question is, after I finished training my model, the training process gave me some results for my test set. Those results are in .mat format. Is there any script that I can use to visualize .mat files (e.g., a script that help me convert .mat file into .png file with different color for different class)? I have been searching a lot but I am not a Matlab guru.

Thanks in advance!

.mat to .png conversion on dataset annotation files

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.

How to extract only the png from mat ?

Hello,

i downloaded the dataset but to only realize that the annotations folder has .mat files instead of png files.

how can i covert these .mat files to png ?

i plan to train them on pytorch deeplab v3

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

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 ?

extractThings Problem

Thanks for your great work, but I met this following problems:

extractThings
Loading COCO API...
Loading and preparing annotations... DONE (t=11.14s).
Error using containers.Map/subsref
The specified key is not present in this container.

Error in CocoApi/getAnnIds (line 121)
t = coco.loadAnns(coco.inds.imgAnnIdsMap(imgIds));

Error in extractThings>getImLabelMap (line 88)
annIds = cocoApi.getAnnIds('imgIds', imgId, 'iscrowd', []);

Error in extractThings (line 71)
labelMap = getImLabelMap(cocoApi, image, imageName);

Could u tell me what's wrong here? I use new dataset. And I want to create new annotation of new classes. Thanks a lot.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.