Pascal VOC & COCO資料集介紹
目錄
-
- Pascal VOC資料集介紹
- 1. JPEGImages
- 2. Annotations
- 3. ImageSets
- 4. SegmentationObject & SegmentationClass
- COCO資料集介紹
- 資料集分類
- Coco
- VOC資料集轉化為COCO資料集格式
- 訓練detectron
- 訓練
- 測試
- 評估
- Reference
- Pascal VOC資料集介紹
- Annotations
- ImageSets
- JPEGImages
- SegmentationClass
- SegmentationObject
主要提供的是PASCAL VOC所提供的所有的圖檔資訊,包括訓練圖檔,測試圖檔
這些圖像就是用來進行訓練和測試驗證的圖像資料。
主要存放xml格式的标簽檔案,每個xml對應JPEGImage中的一張圖檔
<annotation>
<folder>VOC2012</folder>
<filename>2007_000392.jpg</filename> //檔案名
<source> //圖像來源(不重要)
<database>The VOC2007 Database</database>
<annotation>PASCAL VOC2007</annotation>
<image>flickr</image>
</source>
<size> //圖像尺寸(長寬以及通道數)
<width>500</width>
<height>332</height>
<depth>3</depth>
</size>
<segmented>1</segmented> //是否用于分割(在圖像物體識别中01無所謂)
<object> //檢測到的物體
<name>horse</name> //物體類别
<pose>Right</pose> //拍攝角度
<truncated>0</truncated> //是否被截斷(0表示完整)
<difficult>0</difficult> //目标是否難以識别(0表示容易識别)
<bndbox> //bounding-box(包含左下角和右上角xy坐标)
<xmin>100</xmin>
<ymin>96</ymin>
<xmax>355</xmax>
<ymax>324</ymax>
</bndbox>
</object>
<object> //檢測到多個物體
<name>person</name>
<pose>Unspecified</pose>
<truncated>0</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>198</xmin>
<ymin>58</ymin>
<xmax>286</xmax>
<ymax>197</ymax>
</bndbox>
</object>
</annotation>
- Action // 人的動作
- Layout // 人體的具體部位
- Main // 圖像物體識别的資料,總共20類, 需要保證train val沒有交集
- train.txt
- val.txt
- trainval.txt
- Segmentation // 用于分割的資料
儲存的是物體分割後的資料,在物體識别中沒有用到
COCO資料集是微軟團隊擷取的一個可以用來圖像recognition+segmentation+captioning 資料集
這個資料集以scene understanding為目标,主要從複雜的日常場景中截取,圖像中的目标通過精确的segmentation進行位置的标定。圖像包括91類目标,328,000影像和2,500,000個label。
該資料集主要解決3個問題:目标檢測,目标之間的上下文關系,目标的2維上的精确定位。資料集的對比示意圖:
-
Image Classification
分類需要二進制的标簽來确定目标是否在圖像中。早期資料集主要是位于空白背景下的單一目标,如MNIST手寫資料庫,COIL household objects。在機器學習領域的著名資料集有CIFAR-10 and CIFAR-100,在32*32影像上分别提供10和100類。最近最著名的分類資料集即ImageNet,22,000類,每類500-1000影像。
-
Object Detection
經典的情況下通過bounding box确定目标位置,期初主要用于人臉檢測與行人檢測,資料集如Caltech Pedestrian Dataset包含350,000個bounding box标簽。PASCAL VOC資料包括20個目标超過11,000圖像,超過27,000目标bounding box。最近還有ImageNet資料下擷取的detection資料集,200類,400,000張圖像,350,000個bounding box。由于一些目标之間有着強烈的關系而非獨立存在,在特定場景下檢測某種目标是是否有意義的,是以精确的位置資訊比bounding box更加重要。
-
Semantic scene labeling
這類問題需要pixel級别的标簽,其中個别目标很難定義,如街道和草地。資料集主要包括室内場景和室外場景的,一些資料集包括深度資訊。其中,SUN dataset包括908個場景類,3,819個正常目标類(person, chair, car)和語義場景類(wall, sky, floor),每類的數目具有較大的差别(這點COCO資料進行改進,保證每一類資料足夠)。
-
other vision datasets
一些資料集如Middlebury datasets,包含立體相對,多視角立體像對和光流;同時還有Berkeley Segmentation Data Set (BSDS500),可以評價segmentation和edge detection算法。
COCO資料集有91類,雖然比ImageNet和SUN類别少,但是每一類的圖像多,這有利于獲得更多的每類中位于某種特定場景的能力,對比PASCAL VOC,其有更多類和圖像。
COCO難度更大,因為coco資料集每張圖檔中的物體數目很多,是以導緻相對别的資料集,該資料集檢測的準确率很低
Facebook的Detectron平台隻支援coco格式的資料集,是以需要将VOC格式的資料集轉化為coco格式的資料集
具體過程參照:https://blog.csdn.net/meccaendless/article/details/79457330
python2 tools/train_net.py --cfg experiments/e2e_faster_rcnn_resnet-50-FPN_pascal2007.yaml OUTPUT_DIR experiments/output
python2 tools/infer_simple.py \
--cfg experiments/e2e_faster_rcnn_resnet-50-FPN_pascal2007.yaml \
--output-dir experiments/test_out/ \
--wts ./pretrained_model/model_final.pkl \
test_demo_cow
other:(注意在訓練結束後inferece時,需要将cls_score_voc以及bbox_pred_voc改回。不然會報錯)
python2 tools/infer_simple.py --cfg experiments/e2e_faster_rcnn_resnet-50-FPN_pascal2007.yaml --output-dir experiments/test_out/ --wts ./experiments/output_bak/train/voc_2007_train/generalized_rcnn/model_final.pkl test_demo_cow
python2 tools/test_net.py \
--cfg experiments/e2e_faster_rcnn_resnet-50-FPN_pascal2007.yaml \
TEST.WEIGHTS ./experiments/output_bak/train/voc_2007_train/generalized_rcnn/model_final.pkl \
NUM_GPUS 1
https://blog.csdn.net/weixin_35653315/article/details/71028523
https://blog.csdn.net/u012905422/article/details/52372755
代碼改變世界