CocoStuff—基於Deeplab訓練資料的標定工具【一、翻譯】(未完)

夜會美發表於2018-06-14

一、CocoStuff簡介

CocoStuff是一款為deeplab設計的,執行在Matlab中的語義標定工具,其標定結果和結合Deeplab訓練出的結果均為mat檔案格式,該專案原始碼已在github上進行開源。

二、說明

本文為系列部落格第一篇,主要對專案readme進行簡單的翻譯,主要是為了自己在學習踩坑過程中方便查閱說明,如果能幫到大家便是極好的。
*注:未完,部分只是先扔上來,將來會繼續完善。

筆者在探索之前並未在網上搜尋到關於CocoStuff的相關中文部落格,所以這可能是第一篇,有那裡不到位的請多多指教,互相學習。

三、翻譯

COCO-Stuff 10K資料集 v1.1(目前已過時)

作者:Holger Caesar, Jasper Uijlings, Vittorio Ferrari
CocoStuff—基於Deeplab訓練資料的標定工具【一、翻譯】(未完)

概述

歡迎來到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資料集,請按照下面的步驟:

  1. 從git上下載專案:git clone https://github.com/nightrome/cocostuff10k.git

  2. 在shell中開啟資料集:cd cocostuff10k

  3. 如果你有Matlab,執行下面的命令:
    把程式碼檔案新增到Matlab路徑中:startup();
    在Matlab中執行指令碼demo:demo_cocoStuff();
    這個指令碼顯示影像、影像內容、內容加標註以及影像標題。

  4. 或者,執行下面的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()`(也可用於簡單的東西和東西類)。輸出應該類似於下面的圖
CocoStuff—基於Deeplab訓練資料的標定工具【一、翻譯】(未完)

語義分割模型

為了鼓勵對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:

  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 513×513, perform the semantic segmentation and then rescale it elsewhere. Note that without the final step, the performance might differ slightly.

  2. Follow steps 1-4 of the DeepLab VGG-16 section above.
  3. 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.

    標註工具

    在[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.
  • 在Matlab中執行標註工具: CocoStuffAnnotator();
    • 工具把.mat的標籤檔案放在這裡annotator/data/output/annotations.
    • 通過在Matlab中執行這個指令碼將標註預覽為.png格式 annotator/code/exportImages.m.這些預覽圖會存在這裡 annotator/data/output/preview.

相關文章