PASCAL VOC 2012 数据集解析
目錄
一、Introduction
Classification/Detection Competitions
Segmentation Competition
Action Classification Competition
ImageNet Large Scale Visual Recognition Competition
Person Layout Taster Competition
二、Data
三、VOC2012 VS. VOC2011
四、Development Kit
五、Test Data
六、分割數據集
1、VOC2012
2、SBD
3、如何得到訓練集10582?
4、語義分割訓練數據制作
七、參考資源
一、Introduction
該數據集的主要目的是建立針對實際場景中的視覺目標進行識別的挑戰任務。基于標注的圖像數據,它是基本的有監督學習問題。數據集中總共有20類目標需要識別:
- Person:?person
- Animal:?bird, cat, cow, dog, horse, sheep
- Vehicle:?aeroplane, bicycle, boat, bus, car, motorbike, train
- Indoor:?bottle, chair, dining table, potted plant, sofa, tv/monitor
基于上述數據集,有三項視覺目標識別任務:分類(classification),檢測(detection),分割(segmentation)。?ImageNet提供了另外一個大規模目標識別數據集,主要用于分類任務。此外,還有一個 Person Layout Taster 數據集,主要識別人體的頭、手、腳的位置。
Classification/Detection Competitions
Classification: 給定一張測試圖片,判別其中每一個目標所屬類別,類別必須屬于20類之一;
參賽者可以選擇上述的任意一種挑戰任務,處理任意類或者全部類目標,該挑戰可以允許兩類方法:
Segmentation Competition
Segmentation: 給出圖片中每一個像素所屬的類別,否則就是背景類。
Action Classification Competition
Action Classification: 判定靜態圖片中人的活動類別,總共10類。
ImageNet Large Scale Visual Recognition Competition
參考ImageNet官網:http://www.image-net.org/challenges/LSVRC/2012/index
Person Layout Taster Competition
Person Layout: 預測人體部位的矩形框位置,主要是頭,手,腳。
二、Data
To download the training/validation data, see the?Development Kit?section.
- 目標檢測中的每一張圖片標注信息包括:bounding box and object class label. 需要注意的是,一張圖片中可能包含屬于多個類別的多個目標。標注的相關規則和注意的細節,參考?guidelines.
- 原始數據中的一部分圖像被標注為像素級分割標簽,每一個像素都標注了所屬類別,提供了語義分割的競賽挑戰數據集。
- 用于動作分類任務的數據集與 classification/detection/segmentation tasks 的數據集是分開的。其中一部分被標注為people、bounding box、reference points and their actions. 標注規則和細節,參考guidelines。
- 用于person layout taster的圖像,測試集從主任務中分開,額外的標注了人的每一部分,主要是 head/hands/feet.
- 數據分為兩個階段提供,1、Development Kit 會更新訓練集和驗證集,以及評估軟件(MATLAB)。驗證集的目的是為了在提交到官方評測集之前,評估算法的性能。2、測試集用于實際的評估,在VOC2008-2011競賽中,測試集沒有真實標簽。
- 數據被分為 training/validation and testing,每一部分數據量差不多,數據的詳細分布,參考:Statistics.
三、VOC2012 VS. VOC2011
VOC2012數據集主要是為了增加分割(segmentation)和動作分類(action classification)數據集的數量,classification/detection tasks沒有增加標注數據集。下面列舉了VOC2012 和 VOC2011的差別:
- Classification/Detection:?沒有增加額外標注的數據。
- Segmentation:?在 VOC2008-2011 的基礎上,VOC2012 增加了標注數據,數量從7062增加到9993(有這么多?).
- Action Classification:?在VOC2011基礎上,增加了額外的標注數據。為了彌補"boxless"的動作分類任務,除了標注 box annotation, 人的身體上被標注了參考點。具體可以參考(development kit)。
- Person Layout Taster:?沒有增加額外標注數據。
四、Development Kit
The development kit consists of the training/validation data, MATLAB code for reading the annotation data, support files, and example implementations for each competition.
The development kit is now available:
- Download the?training/validation data?(2GB tar file)
- Download the?development kit code and documentation?(500KB tar file)
- Download the?PDF documentation?(500KB PDF)
- Browse the?HTML documentation
- View the?guidelines?used for annotating the database (VOC2011)
- View the?action guidelines?used for annotating the action task images
五、Test Data
The test data will be made available according to the challenge?timetable. Note that the only annotation in the data is for the action task and layout taster. As in 2008-2011, there are no current plans to release full annotation - evaluation of results will be provided by the organizers.
The test data can be downloaded from the?evaluation server. You can also use the evaluation server to evaluate your method on the test data.
六、分割數據集
在學習語義分割系列算法時,經常會看到下面的一段話:
The original dataset contains 1, 464 (train), 1, 449 (val), and 1, 456 (test) pixel-level labeled images for training, validation, and testing, respectively. The dataset is augmented by the extra annotations provided by [29], resulting in 10, 582 (trainaug) training images.如上所示,通常語義分割涉及兩個數據集官方PASCAL VOC 2012 和 SBD,相應的下載鏈接如下:
VOC2012:VOCtrainval_11-May-2012.tar(~2GB)
SBD:benchmark.tgz(~1.3G)
1、VOC2012
下載的官方?VOCtrainval_11-May-2012.tar?解壓后,目錄結構如上圖所示,該部分只介紹用于分割的數據集。
ImageSets:該目錄下Segmentation文件夾總共有三個文件,train.txt:訓練集名字列表,1464個文件,val.txt:驗證集名字列表,1449個文件,trainval.txt:訓練集和驗證集的集合,2913個文件。
JPEGImages:所有的原始圖片,17125個文件,部分示例圖片如下右圖所示。
SegmentationClass:所有的標簽圖,2913個文件,部分示例圖片如下左圖所示。
?
2、SBD
通常語義分割論文使用的?trainaug dataset 是SBD和官方VOC2012合并而來,其中SBD數據集分布:8498 (train), 2857 (val)。
img:該目錄包含了所有的原始圖片,11355個JPG文件。
cls:該目錄包含111355個mat標簽文件,與img的JPG一一對應。每一個mat文件指定了類別和目標的邊界,mat文件結構如下:
?? ???- GTcls.Segmentation is a single 2D image containing the segmentation. Pixels that belong to?
?? ??? ?category k have value k, pixels that do not belong to any category have value 0.
?? ???- GTcls.Boundaries is a cell array. GTcls.Boundaries{k} contains the boundaries of the k-th category.
?? ??? ?These have been stored as sparse arrays to conserve space, so make sure you convert them to full arrays
?? ??? ?when you want to use them/visualize them, eg : full(GTcls.Boundaries{15})
?? ???- GTcls.CategoriesPresent is a list of the categories that are present.
? ? ? ????
inst:該目錄的每一個mat文件包含了像素級分割和邊界標簽,mat文件結構如下:
?? ??? - GTinst.Segmentation is a single 2D image containing the segmentation. Pixels belonging to the
?? ??? ?i-th instance have value i.
?? ??? - GTinst.Boundaries is a cell array. GTinst.Boundaries{i} contains the boundaries of the i-th instance.
?? ??? ?Again, these are sparse arrays.
?? ??? - GTinst.Categories is a vector with as many components as there are instances. GTinst.Categories(i) is
?? ??? ?the category label of the i-th instance.
? ? ? ???
3、如何得到增強訓練集10582?
如上面陳述,通常 trainaug 的數量為10582,該數字獲取方式如下:
VOC數據集分布:
- voc_trainval:2913
- voc_train:1464
- voc_val:1449
SBD數據集分布:
- sbd_train:8498
- sbd_val:2857
通過對比其中圖片文件名重合情況(具體如何比對,可以寫代碼或者直接文件復制粘貼),可以得到:
sbd_train(8498) = 和voc_train重復的圖片(1133) + 和voc_val重復的圖片(545) + sbd_train真正補充的圖片(6820)
sbd_val(2857) = 和voc_train重復的圖片(1) + 和voc_val重復的圖片(558) + sbd_val真正補充的圖片(2298)
所以可以得到的最大的擴充數據集應為:
12031張標注圖 = voc_train(1464) + voc_val(1449) + sbd_train真正補充的圖片(6820) + sbd_val真正補充的圖片(2298)
用原來的voc_val(1449)作為驗證集,剩下的12031-voc_val(1449)=10582都可以用作訓練,就是trainaug(10582)。
4、語義分割訓練數據制作
該部分主要介紹如何制作用于語義分割的訓練數據制作,制作的基本流程如下:
- VOC2012標簽制作
- SBD mat數據轉圖片
- 合并VOC和SBD,保存文件名 trainval.txt
- 根據原始圖片,生成 tfrecord文件
(a)VOC2012 標簽制作
下面左圖為原始圖片,中間的圖是官方提供的標注圖,參考?download_and_convert_voc2012.sh,可以將中間的圖片處理為右邊的圖片。右圖中,背景像素值為 0,人的區域像素值為?15(人屬于第15類),飛機區域的像素值為?1(飛機為第1類)。
?? ? ???????
(b)SBD mat 數據轉換
數據轉換工具?Mat2PNG,可以將mat標簽轉為灰度圖,具體命令為:
python mat2png.py $DATASETS/VOC_aug/dataset/cls $DATASETS/VOC_aug/dataset/cls_png(c)合并數據集
參考(3、如何得到訓練集10582?)中介紹,合并后的名字列表為trainval.txt,也可以從(b)中的鏈接中直接下載名字列表。
(d)生成TFRecord
參考TensorFlow官網代碼?build_voc2012_data.py,可以生成相應的TFRecord文件。
七、參考資源
?
?
?
總結
以上是生活随笔為你收集整理的PASCAL VOC 2012 数据集解析的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 用R语言做单方程的误差修正模型(ECM)
- 下一篇: xbox360自制系统服务器,没有想象那