MMdetection在VisDrone2019上训练FCOS和CenterNet

 配置环境

  1. Python 3.5+
  2. >=PyTorch 1.1
  3. >=CUDA 9.0
  4. NCCL 2
  5. >=GCC 4.9
  6. mmcv‘’

把mmdetection的代码下载下来

git clone https://github.com/open-mmlab/mmdetection.git

进入这个mmdetection文件,准备编译mmdetection的文件

cd mmdetection

装一下下面这些包,

# mmdetection的 requirements.txt里面的文件
pip install -r requrements.py

pip install cython 

pip install albumentations>=0.3.2 imagecorruptions pycocotools six terminaltables 

直接装mmcv在我这个环境里会报错

pip install mmcv

报错长这样,就是告诉你mmcv安装失败了

      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.

解决方案是去mmcv的官方文档上

GitHub - open-mmlab/mmcv: OpenMMLab Computer Vision Foundation

Installation — mmcv 2.0.1 documentation

把你的cuda版本、torch版本选上,下面就会生成一条用pip安装的命令语句,你在自己的终端执行一下mmcv就安装好了        

将VisDrone转换成COCO格式

需要做这一步,然后把下面coco文件中的类别数和一些参数改了,包括均值和方差(这个可以先不改,跑通后再改),——然后运行

训练模型

所有的目标检测的模型都被放在了“/configs”

coco_detection.py的位置“configs/_base_/datasets”或“/mmdet/configs/_base_/datasets”

各个数据集的处理和转换“mmdet/datasets”

训练模型用的train.py放在了“./tools”

运行指令,开始训练

python tools/train.py configs/fcos/fcos_r50_caffe_fpn_gn-head_1x_coco.py

MMdetection实现的所有的10个FCOS模型:https://github.com/open-mmlab/mmdetection/tree/master/configs/fcos

FCOS模型中mAP最低的模型:https://github.com/open-mmlab/mmdetection/blob/master/configs/fcos/fcos_r50_caffe_fpn_gn-head_1x_coco.py (不知道要不要安装caffe?

MMdetection实现的2个CenterNet模型:https://github.com/open-mmlab/mmdetection/tree/master/configs/centernet

训练时候调用的train.py位于./tools下面

https://github.com/open-mmlab/mmdetection/blob/main/tools/train.py

 Reference:

将VisDrone数据集转换成COCO格式:将visdrone数据集转化为coco格式并在mmdetection上训练,附上转好的json文件_S5242的博客-CSDN博客

用MMdetection 训练自己的模型:(详细教程)mmdetection训练自己的模型,测试,评估_若风么么哒的博客-CSDN博客

 

猜你喜欢

转载自blog.csdn.net/Albert233333/article/details/132334949