We follow the evaluation setting in MoCo when transferring to object detection on COCO using MMDetection.
First, make sure you have installed MIM, which is also a project of OpenMMLab.
pip install openmim
mim install mmdet
Besides, please refer to MMDet for installation and data preparation.
After installing MMDet, you can run MMDetection with simple command. We provide scripts for the stage-4 only (C4
) and FPN
setting of object detection models.
bash det_mmdetection/mim_dist_train_c4.sh ${CONFIG} ${PRETRAIN} ${GPUS}
bash det_mmdetection/mim_dist_train.sh ${CONFIG} ${PRETRAIN} ${GPUS}
Remarks:
CONFIG
: Use config files underdet_mmdetection/configs
or write your own config filesPRETRAIN
: the pre-trained model file (the backbone parameters only).${GPUS}
: The number of GPUs that you want to use to train. We adopt 8 GPUs for detection tasks by default.- Since repositories of OpenMMLab have support referring config files across different repositories, we can easily leverage the configs from MMDetection like:
_base_ = 'mmdet::mask_rcnn/mask-rcnn_r50-caffe-c4_1x_coco.py'
Example:
bash det_mmdetection/mim_dist_train_c4.sh \
det_mmdetection/configs/coco/mask-rcnn_r50-c4_ms-2x_coco.py ${PATH_TO_CHECKPOINT} 8