一、CocoStuff簡介
CocoStuff是一款為deeplab設計的,運行在Matlab中的語義標定工具,其標定結果和結合Deeplab訓練出的結果均為mat文件格式,該項目源碼已在github上進行開源。
二、說明
本文為系列博客第一篇,主要對項目readme進行簡單的翻譯,主要是為了自己在學習踩坑過程中方便查閱說明,如果能幫到大家便是極好的。
*注:未完,部分只是先扔上來,將來會繼續完善。
筆者在探索之前並未在網上搜索到關於CocoStuff的相關中文博客,所以這可能是第一篇,有那里不到位的請多多指教,互相學習。
三、翻譯
COCO-Stuff 10K數據集 v1.1(目前已過時)
作者:Holger Caesar, Jasper Uijlings, Vittorio Ferrari
概述
歡迎來到COCO-Stuff數據集的官方主頁。COCO-Stuff添加了像素級標定(標注)的流行的COCO數據集,這些標注可以用於一些像語義分割、對象檢測和圖像字幕的場景理解任務。
目錄
亮點
更新
成果和未來計划
數據集
語義分割模型
標定工具
Misc(未翻)
亮點
10,000張來自COCO的復雜圖像
稠密的像素級標注
91個things類和91個stuff類
實例級標注來自COCO的的數據
物與物的復雜空間環境
每幅coco的圖片有5句說明
更新
2017年7月11日:添加了Resnet和VGG的Deeplab模型
2017年4月6日:數據集版本1.1:修改標簽指數
2017年3月31日:發布JSON格式的標注
2017年3月9日:添加標簽層次腳本
2017年3月8日:更正arXiv 文件中的table 2
2017年1月10日:在標注工具中添加了提取SLICO超級像素的腳本
2016年12月12日:發布數據集版本1.1和arXiv文件
成果
目前發布的COCO-Stuff-10K版本包括訓練和測試的標注,以及我們邀請用戶向我們報告他們的結果用來補充這張表。在不久的將來,我們會將COCO-Stuff擴展到COCO的所有圖像中,並且我們會組織一個官方比賽,在比賽中的測試標注只會被組織者所知道。
點擊此處查看最新表格
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% |
數據集
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 |
用法
為了使用COCO-Stuff數據集,請按照下面的步驟:
-
從git上下載項目:
git clone https://github.com/nightrome/cocostuff10k.git
-
在shell中打開數據集:
cd cocostuff10k
-
如果你有Matlab,執行下面的命令:
把代碼文件添加到Matlab路徑中:startup()
;
在Matlab中運行腳本demo:demo_cocoStuff()
;
這個腳本顯示圖像、圖像內容、內容加標注以及圖像標題。 -
或者,運行下面的Linux命令或手動下載解壓數據集:
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格式
COCO-Stuff的標注是儲存在每張圖對應的.mat文件中,這些文件的格式和Tighe等人使用的格式相同。每個文件包括以下字段:
S: 像素化的標簽地圖的尺寸
names:COCO-Stuff中的東西的名字和類別,更多詳情請看Label Names & Indices
captions:圖片標題,由5個不同的人平均標注
regionMapStuff:與S大小相同的映射,恰中包含大約值的索引,1000個區域用來注釋圖像。
regionLabelStuff:每個超級像素級的物品標簽的列表,這些regionMapStuff的索引都對應regionLabelStuff的條目。
JSON格式
另外,我們還提供了JSON格式的標注,這些標注是從COCO中復制出來的。我們使用RLE編碼格式,將圖像中呈現的每種東西的類別都標注了單個注釋。要獲取標注:
wget--directory-prefix=dataset/annotations-json http://calvin.inf.ed.ac.uk/wpcontent/uploads/data/cocostuffdataset/cocostuff-10k-v1.1.json
或者用這個腳本從.mat文件中提取它們
標簽名稱&指數
為了與COCO兼容,版本1.1有91個東西類(1-91),91個東西類(92-182)和一個類“未標記”(0)。請注意,Coco2015中的11個Thing類沒有任何分段注釋。課桌、門和鏡子既可以是東西,也可以是東西,因此既可以是可可,也可以是可可。為了避免混淆,我們在coco-thing中的那些類中添加了后綴“-東西”。類的完整列表可以找到這里.。舊版的COCO-東西1.0有80個東西類(2-81個),91個東西類(82-172個)和一個類“未標記”(1)
Label等級體系
標簽的層次結構存儲在CocoStuffClass‘中。為了使其可視化,在matlab中運行
CocoStuffClasses.showClassHierarchyStuffThings()`(也可用於簡單的東西和東西類)。輸出應該類似於下面的圖
語義分割模型
為了鼓勵對stuff and things的進一步研究,我們提供了經過訓練的語義分割模型
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:
- Install Cuda. I recommend version 7.0. For version 8.0 you will need to apply the fix described here in step 3.
- Download deeplab-public-ver2:
git submodule update --init models/deeplab/deeplab-public-ver2
- 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 ../..
- 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();
- 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
- 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.
- Follow steps 1-4 of the DeepLab VGG-16 section above.
- 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
- Rescale the images and annotations:
cd models/deeplab
python rescaleImages.py
python rescaleAnnotations.py
- Run
./run_cocostuff_resnet101.sh
to train and test the network on COCO-Stuff.
標注工具
在[1]中,我們提出了一個簡單而有效的文本注釋工具,用於注釋可可數據集。它使用畫筆工具對SLICO超級像素進行注釋(使用帶有內容標簽的codeofAchantet al.)]進行預計算)。這些注釋被現有的來自COCO的像素級事物注釋所覆蓋。
我們提供了注釋工具的基本版本:
- 准備需要的數據:
- 指定一個username
annotator/data/input/user.txt
. - 創建一個圖片list文件
annotator/data/input/imageLists/<user>.list
. - 在Matlab中提取所有圖片的things標簽:
extractThings()
. - 在Matlab中提取所有圖片的超像素:
extractSLICOSuperpixels()
. - 在這個文件的最上面的參數設置是否啟用超像素、things標簽、多邊形繪圖
CocoStuffAnnotator.m
.
- 指定一個username
- 在Matlab中運行標注工具:
CocoStuffAnnotator();
- 工具把.mat的標簽文件放在這里
annotator/data/output/annotations
. - 通過在Matlab中運行這個腳本將標注預覽為.png格式
annotator/code/exportImages.m
.這些預覽圖會存在這里annotator/data/output/preview
.
- 工具把.mat的標簽文件放在這里