To run the evaluation, download and set up PASCAL VOC, PASCAL Context, COCO-Stuff164k, Cityscapes, and ADE20k datasets. This data preparation document partly follows FC-CLIP instructions.
The datasets are assumed to exist in a directory with the structure described below.
$datasets/
ADEChallengeData2016/
coco/
cityscapes/
VOCdevkit/
pascal_ctx_d2/
pascal_voc_d2/
Expected dataset structure for COCO:
coco/
annotations/
{val}2017/ # png annotations
images/
{val}2017/ # jpg images
Download and unzip:
wget http://images.cocodataset.org/zips/val2017.zip
wget http://calvin.inf.ed.ac.uk/wp-content/uploads/data/cocostuffdataset/stuffthingmaps_trainval2017.zip
Expected dataset structure for Cityscapes:
cityscapes/
gtFine/
train/
aachen/
color.png, instanceIds.png, labelIds.png, polygons.json,
labelTrainIds.png
...
val/
test/
leftImg8bit/
train/
val/
test/
Expected dataset structure for ADE20k (A150):
ADEChallengeData2016/
annotations/
images/
Download and unzip:
wget http://data.csail.mit.edu/places/ADEchallenge/ADEChallengeData2016.zip
Expected dataset structure for PASCAL Context (PC-59) and PASCAL VOC (PAS-21):
VOCdevkit/
VOC2012/
Annotations/
JPEGImages/
ImageSets/
Segmentation/
VOC2010/
JPEGImages/
trainval/
trainval_merged.json
# generated by prepare_pascal_voc_sem_seg.py
pascal_voc_d2/
images/
annotations_pascal21/
# pascal 20 excludes the background class
annotations_pascal20/
# generated by prepare_pascal_ctx_sem_seg.py
pascal_ctx_d2/
images/
annotations_ctx59/
Download the dataset from http://host.robots.ox.ac.uk/pascal/VOC/:
cd $DETECTRON2_DATASETS
wget http://host.robots.ox.ac.uk/pascal/VOC/voc2012/VOCtrainval_11-May-2012.tar
# generate folder VOCdevkit/VOC2012
tar -xvf VOCtrainval_11-May-2012.tar
Generate directory pascal_voc_d2
running:
python datasets/prepare_pascal_voc_sem_seg.py
Download the dataset from http://host.robots.ox.ac.uk/pascal/VOC/ and annotation from https://www.cs.stanford.edu/~roozbeh/pascal-context/:
cd $DETECTRON2_DATASETS
wget http://host.robots.ox.ac.uk/pascal/VOC/voc2010/VOCtrainval_03-May-2010.tar
# generate folder VOCdevkit/VOC2010
tar -xvf VOCtrainval_03-May-2010.tar
wget https://www.cs.stanford.edu/~roozbeh/pascal-context/trainval.tar.gz
# generate folder VOCdevkit/VOC2010/trainval
tar -xvzf trainval.tar.gz -C VOCdevkit/VOC2010
wget https://codalabuser.blob.core.windows.net/public/trainval_merged.json -P VOCdevkit/VOC2010/
Install Detail API by:
git clone https://github.com/zhanghang1989/detail-api.git
rm detail-api/PythonAPI/detail/_mask.c
pip install -e detail-api/PythonAPI/
Generate directory pascal_ctx_d2/images
and pascal_ctx_d2/annotations_ctx59
running:
python datasets/prepare_pascal_ctx_sem_seg.py