mmselfsup/docs/en/user_guides/detection.md
Yixiao Fang d3a487e0b9
[Refactor] Refactor docs directory (#419)
* refactor directory

* modify titles

* fix lint

* update index.rst

* update

* fix typo

* update

* fix typo

* update model zoo

* update index.rst

* fix typo

* fix typo
2022-08-17 12:06:41 +08:00

1.6 KiB

Detection

Here, we prefer to use MMDetection to do the detection task. First, make sure you have installed MIM, which is also a project of OpenMMLab.

pip install openmim

It is very easy to install the package.

Besides, please refer to MMDet for installation and data preparation

Train

After installation, you can run MMDet with simple command.

# distributed version
bash tools/benchmarks/mmdetection/mim_dist_train.sh ${CONFIG} ${PRETRAIN} ${GPUS}

# slurm version
bash tools/benchmarks/mmdetection/mim_slurm_train.sh ${PARTITION} ${CONFIG} ${PRETRAIN}

Remarks:

  • CONFIG: Use config files under configs/benchmarks/mmdetection/ or write your own config files
  • PRETRAIN: the pre-trained model file.

Or if you want to do detection task with detectron2, we also provides some config files. Please refer to INSTALL.md for installation and follow the directory structure to prepare your datasets required by detectron2.

conda activate detectron2 # use detectron2 environment here, otherwise use open-mmlab environment
cd benchmarks/detection
python convert-pretrain-to-detectron2.py ${WEIGHT_FILE} ${OUTPUT_FILE} # must use .pkl as the output extension.
bash run.sh ${DET_CFG} ${OUTPUT_FILE}