本文介绍了基于Paddle 2.0和轻量化PP-YOLO的RoboMaster战车装甲板检测模型更新项目。文中展示了效果,还说明了同步PaddleDetection源代码、安装库、解压数据集、模型训练、导出推理模型及用其对图片和视频进行预测的操作步骤。
☞☞☞AI 智能聊天, 问答助手, AI 智能搜索, 免费无限量使用 DeepSeek R1 模型☜☜☜

引入
- 去年发过一个 RoboMaster 战车装甲板检测的项目
- 那个版本用的还是 Paddle 1.8,最近 PP-YOLO 也更新更加轻量化的版本
- 这次就来更新一下项目,使用 Paddle 2.0 和轻量化的 PP-YOLO 重新实现一个战车装甲板检测模型
效果展示
- 使用的测试视频及图片均截取自RoboMaster官网的比赛视频
- 图片效果展示
- 视频效果展示
同步 PaddleDetection 源代码
- 从 Github 或 Gitee 上同步代码,国内网络环境建议使用 Gitee 进行同步
- -b 指定项目分支
- --depth 1 同步最新代码,不同步历史更改
!git clone https://gitee.com/PaddlePaddle/PaddleDetection -b release/2.0-rc --depth 1
安装必须的库
!pip install pycocotools
解压数据集
# 解压只需执行一次!mkdir ~/dataset !unzip -q ~/data/data46309/rmcvdata.zip -d ~/dataset/rmcvdata/
模型训练
%cd ~/PaddleDetection
!python tools/train.py \
-c ~/RM.yml \
--vdl_log_dir ~/log/ppyolo_tiny \
--use_vdl True \
--eval
导出推理模型
%cd ~/PaddleDetection
!python tools/export_model.py \
-c ~/RM.yml \
--output_dir ~/inference_model
使用推理模型进行预测
# 使用测试图片进行测试%cd ~/PaddleDetection
!python deploy/python/infer.py \
--model_dir ~/inference_model/RM \
--image_file ~/test/test.jpg \
--output_dir ~/test_output \
--use_gpu True \
--threshold 0.7
# 使用测试视频进行测试%cd ~/PaddleDetection
!python deploy/python/infer.py \
--model_dir ~/inference_model/RM \
--video_file ~/test/720.mp4 \
--output_dir ~/test_output \
--use_gpu True \
--threshold 0.7










