This page provides basic usage based on MMdetection (V2.25.0). For installation instructions, please see install.md.
MMDetection implements distributed training and non-distributed training,
which uses MMDistributedDataParallel
and MMDataParallel
respectively.
All outputs (log files and checkpoints) will be saved to the working directory,
which is specified by work_dir
in the config file.
- Train with a single GPU
CUDA_VISIBLE_DEVICES=0 python tools/train.py ${CONFIG_FILE} #
Example:
CUDA_VISIBLE_DEVICES=0 python toos/train.py configs/boxinst/boxinst_r50_fpn_1x_coco.py
- Train with multiple GPUs
./tools/dist_train.sh ${CONFIG_FILE} ${GPU_NUM} [optional arguments]
Example:
CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 ./tools/dist_train.sh configs/coco/boxinst_r50_fpn_1x_coco.py 8
We provide the testing scripts to evaluate the trained models.
Examples for boxinst:
Assume that you have already downloaded the checkpoints to work_dirs/boxinst_r50_1x_coco/
.
- Test with single GPU and get mask AP values.
CUDA_VISIBLE_DEVICES=0 python tools/test.py configs/coco/boxinst_r50_fpn_1x_coco.py \
work_dirs/boxinst_r50_1x_coco/xxx.pth --eval segm
- Test with 8 GPUs and get mask AP values on
val
dataset.
CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 ./tools/dist_test.sh configs/coco/boxinst_r50_fpn_1x_coco.py \
work_dirs/boxinst_r50_1x_coco/xxx.pth 8 --eval segm
- Test with 8 GPUs and get mask AP values on
test-dev
dataset.
CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 ./tools/dist_test.sh configs/coco/boxinst_r50_fpn_1x_coco.py \
work_dirs/coco_r50_3x/xxx.pth 8 --format-only --eval-options "jsonfile_prefix=work_dirs/r50_coco_dev"
Generate the json results, and submit to the COCO challenge server for test-dev
performance evaluation.
-
Test for COCO
CUDA_VISIBLE_DEVICES=0 python tools/test.py configs/coco/boxinst_r50_fpn_1x_coco.py \ work_dirs/boxinst_r50_1x_coco/xxx.pth --show-dir work_dirs/vis_coco_r50/
Note: The visual results is in show-dir
.
- Pascal VOC(Augmented) is the extension of the training set of VOC 2012 with SBD following BBTP The link of whole dataset with coco json format is here(GoogleDrive)
More dataset will be updated.