Configuration Environment
- Python 3.5+
- >=PyTorch 1.1
- >=CUDA 9.0
- NCCL 2
- >=GCC 4.9
- mmcv‘’
Download the mmdetection code
git clone https://github.com/open-mmlab/mmdetection.git
Enter this mmdetection file and prepare to compile the mmdetection file
cd mmdetection
Pack the following bags,
# mmdetection的 requirements.txt里面的文件
pip install -r requrements.py
pip install cython
pip install albumentations>=0.3.2 imagecorruptions pycocotools six terminaltables
Installing mmcv directly will report an error in my environment
pip install mmcv
The error is long like this, it tells you that the mmcv installation failed
RuntimeError: Error compiling objects for extension
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure
× Encountered error while trying to install package.
╰─> mmcv
note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
The solution is to go to the official documentation of mmcv
GitHub - open-mmlab/mmcv: OpenMMLab Computer Vision Foundation
Installation — mmcv 2.0.1 documentation
Select your cuda version and torch version, and a command statement to install with pip will be generated below. You can execute mmcv on your own terminal to install it
Convert VisDrone to COCO format
( You need to do this step, and then change the number of categories and some parameters in the coco file below, including the mean and variance (this can be left untouched first, and then changed after running), -- then run )
training model
All object detection models are placed in "/configs"
The location of coco_detection.py "configs/_base_/datasets" or "/mmdet/configs/_base_/datasets"
Processing and conversion of individual datasets "mmdet/datasets"
The train.py used to train the model is placed in "./tools"
Run the command to start training
python tools/train.py configs/fcos/fcos_r50_caffe_fpn_gn-head_1x_coco.py
All 10 FCOS models implemented by MMdetection: https://github.com/open-mmlab/mmdetection/tree/master/configs/fcos
The model with the lowest mAP in the FCOS model: https://github.com/open-mmlab/mmdetection/blob/master/configs/fcos/fcos_r50_caffe_fpn_gn-head_1x_coco.py ( I don’t know whether to install caffe? )
2 CenterNet models implemented by MMdetection: https://github.com/open-mmlab/mmdetection/tree/master/configs/centernet
The train.py called during training is located under ./tools
https://github.com/open-mmlab/mmdetection/blob/main/tools/train.py
Reference:
Convert the VisDrone dataset to COCO format: convert the visdrone dataset to coco format and train on mmdetection, attach the converted json file_S5242's Blog-CSDN Blog
Use MMdetection to train your own model: (detailed tutorial) mmdetection to train your own model, test, and evaluate