A dataset can be used by accessing DatasetCatalog
for its data, or MetadataCatalog for its metadata (class names, etc).
This document explains how to setup the builtin datasets so they can be used by the above APIs.
Use Custom Datasets gives a deeper dive on how to use DatasetCatalog and MetadataCatalog,
and how to add new datasets to them.
VidEoMT has builtin support for a few datasets.
The datasets are assumed to exist in a directory specified by the environment variable
DETECTRON2_DATASETS.
Under this directory, detectron2 will look for datasets in the structure described below, if needed.
$DETECTRON2_DATASETS/
ytvis_2019/
ytvis_2021/
ovis/
VIPSeg/
VSPW_480p/
You can set the location for builtin datasets by export DETECTRON2_DATASETS=/path/to/datasets.
If left unset, the default is ./datasets relative to your current working directory.
Expected dataset structure for YouTube-VIS 2019:
ytvis_2019/
{train,valid,test}.json
{train,valid,test}/
Annotations/
JPEGImages/
Expected dataset structure for YouTube-VIS 2021:
ytvis_2021/
{train,valid,test}.json
{train,valid,test}/
JPEGImages/
instances.json
Expected dataset structure for YouTube-VIS 2022:
ytvis_2022/
{train,valid,test}.json
gt_{short,long}.json
{train,valid,test}/
JPEGImages/
instances.json
Expected dataset structure for OVIS:
ovis/
annotations/
annotations_{train,valid,test}.json
{train,valid,test}/
Expected dataset structure for VIPSeg:
After downloading the VIPSeg dataset, it still needs to be processed according to the official script (/datasets/utils/vipseg_change2_720p.py). To save time, you can directly download the processed VIPSeg dataset from baiduyun (password is dvis).
VIPSeg/
VIPSeg_720P/
images/
panomasksRGB/
panoptic_gt_VIPSeg_{train,val,test}.json
Expected dataset structure for VSPW:
VSPW_480p/
data/
video_1/
mask/
origin/
train.txt
val.txt
test.txt
data.txt
abel_num_dic_final.json
- If it is a VIS/VPS/VSS dataset, convert it to YTVIS/VIPSeg/VSPW format. If it is a image instance dataset, convert it to COCO format.
- Register it in
/videomt/data_video/datasets/{builtin,vps,vss}.py
VidEoMT provides a helper script (copied from DVIS++) to convert COCO annotations into subsets compatible with YTVIS 2019, YTVIS 2021, and OVIS, by filtering COCO categories.
The script expects the COCO annotation file to be located at:
$DETECTRON2_DATASETS/coco/annotations/instances_train2017.jsonIt generates the following files under:
$DETECTRON2_DATASETS/coco/annotations/
coco2ytvis2019_train.json
coco2ytvis2021_train.json
coco2ovis_train.jsonTo run the conversion script:
python tools/convert_coco_to_vis.py