Processing math: 100%
7 Star 125 Fork 123

GVPAscend/DrivingSDK

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
.gitee
ci
cmake
docs
include
kernels
model_examples
BEVDepth
BEVDet
BEVFormer
BEVFusion
BEVNeXt
CenterNet
CenterPoint
DETR
DETR3D
Deformable-DETR
figs
test
Deformable-DETR_npu.patch
README.md
requirements.txt
run.sh
DenseTNT
FCOS
FCOS3D
FlashOCC
GameFormer-Planner
GameFormer
HPTR
HiVT
LMDrive
LaneSegNet
MagicDriveDiT
MapTR
Mask2Former
MatrixVT
MultiPath++
PanoOcc
Panoptic-PolarNet
PivotNet
PointPillar
PointTransformerV3
QCNet
SalsaNext
Senna
Sparse4D
SparseDrive
StreamPETR
SurroundOcc
TPVFormer
UniAD
VAD
Yolov8
mx_driving
onnx_plugin
scripts
tests
.clang-format
.gitignore
CMakeLists.txt
CMakePresets.json
LICENSE
OWNERS
README.md
Third_Party_Open_Source_Software_Notice
pyproject.toml
requirements.txt
setup.py
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

Deformable DETR for PyTorch

简介

  • 论文原作者:Xizhou Zhu, Weijie Su, Lewei Lu, Bin Li, Xiaogang Wang, Jifeng Dai.

  • 论文名称: Deformable DETR: Deformable Transformers for End-to-End Object Detection.

  • Deformable DETR 是一个高效的收敛快的端到端目标检测器(Object Detector);它通过一种新颖的基于采样的注意力机制解决了DETR模型的高复杂性和收敛慢的问题;

deformable_detr

deformable_detr

支持的任务列表

模型 任务列表 精度 Backbone 是否支持
Deformable DETR 训练目标检测器 FP32精度 ResNet50

环境准备

表1 昇腾软件版本支持列表

软件类型 支持列表
FrameworkPTAdapter 7.0.RC1
CANN 8.1.RC1

1、激活 CANN 包环境:将 CANN 包所在目录记为 cann_root_dir,执行以下命令以激活环境:

source {cann_root_dir}/set_env.sh

2、创建 conda 环境并激活:

conda create -n deformable_detr python=3.9
conda activate deformable_detr

3、克隆代码仓到当前目录并使用 patch 文件

git clone https://gitee.com/ascend/DrivingSDK.git -b master
cd DrivingSDK/model_examples/Deformable-DETR
pip install -r requirements.txt
chmod -R 777 run.sh
./run.sh
cp -rf test Deformable-DETR
cd Deformable-DETR

如果需要将 Deformable-DETR 源码 clone 到用户自定义目录,执行下面的shell命令:

your_path=/home/    # 替换为用户自定义目标目录地址
git clone https://gitee.com/ascend/DrivingSDK.git -b master
cd DrivingSDK/model_examples/Deformable-DETR
pip install -r requirements.txt
chmod -R 777 run.sh
git clone https://github.com/fundamentalvision/Deformable-DETR.git ${your_path}
cp -f Deformable-DETR_npu.patch ${your_path}
cp -rf test ${your_path}
cd ${your_path}
git apply Deformable-DETR_npu.patch

准备数据集

进入 COCO 官网,下载 COCO2017 数据集。将数据集上传到服务器任意路径下并解压,数据集结构排布成如下格式:

coco_path/
  annotations/  # annotation json files
  train2017/    # train images
  val2017/      # val images

快速开始

模型训练:

主要提供单机 8 卡训练脚本:

  • 在模型根目录下运行训练脚本
bash test/train_8p_full.sh --data_path='.data/coco'		# 替换成你的coco数据集路径,进行 8 卡训练
bash test/train_8p_performance.sh --data_path='.data/coco'		# 替换成你的coco数据集路径,进行 8 卡性能测试

训练脚本参数说明:

--data_path    # 数据集路径,必填
--epochs       # 重复训练次数,可选项,默认 50

训练结果:

芯片 卡数 epoch global batch size mAP(IoU=0.50:0.95) 性能-单步迭代耗时(s) FPS
竞品A 8p 50 64 0.437 1.01 65
Atlas 800T A2 8p 50 64 0.436 1.14 56

变更说明

2024.12.23:首次发布

2025.5.7:性能优化、更新性能数据

FQA

暂无

马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/ascend/DrivingSDK.git
git@gitee.com:ascend/DrivingSDK.git
ascend
DrivingSDK
DrivingSDK
master

搜索帮助