文件最后提交记录最后更新时间
fix link validity Co-authored-by: frozenleaves<914814442@qq.com> # message auto-generated for no-merge-commit merge: !7517 merge master into master fix link validity Created-by: frozenn Commit-by: frozenleaves Merged-by: ascend-robot Description: ## Motivation Please describe the motivation of this PR and the goal you want to achieve through this PR. ## Modification Please briefly describe what modification is made in this PR. ## Self-test (Optional) If modifications to this PR may cause/fix function/accuracy/performance DTSs/issues, a self-inspection record needs to be attached. ## BC-breaking (Optional) If there are compatibility issues, such as dependencies on cann/torch_npu versions, they need to be explained in the PR. ## Checklist **Before PR**: - [ ] The new code needs to comply with the Clean Code specification. - [ ] The PR content is self-checked, and the expression can be clear and the writing standardized **After PR**: - [ ] CLA has been signed and all committers have signed the CLA in this PR. - [ ] The ci-pipeline is passed, Code Check is passed. See merge request: Ascend/ModelZoo-PyTorch!75171 个月前
!6327 [Pytorch][customer’s model][BEVformer] BEVformer performance boosting Merge pull request !6327 from l00636998/master 1 年前
!6327 [Pytorch][customer’s model][BEVformer] BEVformer performance boosting Merge pull request !6327 from l00636998/master 1 年前
!6732 Mx_Driving中函数调用方式修改 Merge pull request !6732 from 李林斯曼/master 1 年前
!6652 Enhance Bevformer Perf. Merge pull request !6652 from 刘哲续/master 1 年前
!6652 Enhance Bevformer Perf. Merge pull request !6652 from 刘哲续/master 1 年前
!6139 【Pytorch】【build-in】BEVFormer模型适配 Merge pull request !6139 from 卓博航/bevformer 2 年前
!6129 【built-in】【PyTorch】BEVFormer original code first submition Merge pull request !6129 from 卓博航/bevformer 2 年前
!6129 【built-in】【PyTorch】BEVFormer original code first submition Merge pull request !6129 from 卓博航/bevformer 2 年前
文档整改,gitee->gitcode Co-authored-by: Lighters_c<zyh13227@163.com> # message auto-generated for no-merge-commit merge: !7469 merge ffffix into master 文档整改,gitee->gitcode Created-by: addsubmuldiv Commit-by: Lighters_c Merged-by: ascend-robot Description: ## Motivation Please describe the motivation of this PR and the goal you want to achieve through this PR. ## Modification Please briefly describe what modification is made in this PR. ## Self-test (Optional) If modifications to this PR may cause/fix function/accuracy/performance DTSs/issues, a self-inspection record needs to be attached. ## BC-breaking (Optional) If there are compatibility issues, such as dependencies on cann/torch_npu versions, they need to be explained in the PR. ## Checklist **Before PR**: - [ ] The new code needs to comply with the Clean Code specification. - [ ] The PR content is self-checked, and the expression can be clear and the writing standardized **After PR**: - [ ] CLA has been signed and all committers have signed the CLA in this PR. - [ ] The ci-pipeline is passed, Code Check is passed. See merge request: Ascend/ModelZoo-PyTorch!74695 个月前
!7376 optimize public_address_statement.md Merge pull request !7376 from 王凯宇/master 8 个月前
!6327 [Pytorch][customer’s model][BEVformer] BEVformer performance boosting Merge pull request !6327 from l00636998/master 1 年前
!6139 【Pytorch】【build-in】BEVFormer模型适配 Merge pull request !6139 from 卓博航/bevformer 2 年前
README.md

当前仓已不维护,请跳转至 https://gitcode.com/ascend/DrivingSDK/tree/master/model_examples/BEVFormer

BEVFormer

概述

BEVFormer 通过提取环视相机采集到的图像特征,并将提取的环视特征通过模型学习的方式转换到 BEV 空间(模型去学习如何将特征从 图像坐标系转换到 BEV 坐标系),从而实现 3D 目标检测和地图分割任务。

  • 参考实现:

    url=https://github.com/fundamentalvision/BEVFormer
    commit_id=20923e66aa26a906ba8d21477c238567fa6285e9
    

支持模型

Backbone Method 训练方式
R101-DCN BEVFormer-base FP32

准备训练环境

准备环境

  • 推荐参考配套资源文档使用最新的配套版本。

    表 1 版本配套表

    软件 版本 安装指南
    Driver AscendHDK 24.1.RC3 驱动固件安装指南
    Firmware AscendHDK 24.1.RC3
    CANN CANN 8.0.RC3 CANN 软件安装指南
    PyTorch 2.1.0 Ascend Extension for PyTorch 配置与安装
    torch_npu release v6.0.rc3
  • 环境准备指导。

    请参考《Pytorch框架训练环境准备》。

  • 安装依赖。

    1. 源码编译安装 mmcv 1.x
       git clone -b 1.x https://github.com/open-mmlab/mmcv.git
       cp -f mmcv_need/base_runner.py mmcv/mmcv/runner/base_runner.py
       cp -f mmcv_need/epoch_based_runner.py mmcv/mmcv/runner/epoch_based_runner.py
       cp -f mmcv_need/points_in_polygons_npu.cpp mmcv/mmcv/ops/csrc/pytorch/npu/points_in_polygons_npu.cpp
       cp -f mmcv_need/distributed.py mmcv/mmcv/parallel/distributed.py
       cp -f mmcv_need/modulated_deform_conv.py mmcv/mmcv/ops/modulated_deform_conv.py
       cp -f mmcv_need/runtime.txt mmcv/requirements/runtime.txt
       cp -f mmcv_need/optimizer.py mmcv/mmcv/runner/hooks/optimizer.py
       cd mmcv
       pip install -r requirements/runtime.txt
       MMCV_WITH_OPS=1 MAX_JOBS=8 FORCE_NPU=1 python setup.py build_ext
       MMCV_WITH_OPS=1 FORCE_NPU=1 python setup.py develop
      
    2. 源码安装 mmdetection3d v1.0.0rc4
      git clone -b v1.0.0rc4 https://github.com/open-mmlab/mmdetection3d.git
      cp -f mmdet3d_need/__init__.py mmdetection3d/mmdet3d/__init__.py
      cp -f mmdet3d_need/nuscenes_dataset.py mmdetection3d/mmdet3d/datasets/nuscenes_dataset.py
      cp -f mmdet3d_need/runtime.txt mmdetection3d/requirements/runtime.txt
      cd mmdetection3d
      pip install -e .
      
    3. 源码安装 mmdet 2.24.0
      git clone -b v2.24.0 https://github.com/open-mmlab/mmdetection.git
      cp -f mmdet_need/__init__.py mmdetection/mmdet/__init__.py
      cp -f mmdet_need/resnet.py mmdetection/mmdet/models/backbones/resnet.py
      cd mmdetection
      pip install -e .
      
    4. 安装 detectron2
      python -m pip install 'git+https://github.com/facebookresearch/detectron2.git'
      
    5. 安装其他依赖
      pip install -r requirements.txt
      
    6. 安装mxDriving加速库,并将环境变量添加至 test/env_npu.sh 文件中 参考mxDriving官方gitcode仓README安装编译构建并安装mxDriving包:参考链接 【注意】当前版本配套mxDriving RC3及以上版本,历史mxDriving版本需要model仓代码回退到git reset --hard 91ac141ecfe5872f4835eef6aa4662f46ede80c3

准备数据集

  1. 用户需自行下载 nuScenes V1.0 full 和 CAN bus 数据集,结构如下:

    data/
    ├── nuscenes
    ├── can_bus
    
  2. 数据预处理

    python tools/create_data.py nuscenes --root-path ./data/nuscenes --out-dir ./data/nuscenes --extra-tag nuscenes --version v1.0 --canbus ./data
    

下载预训练权重

创建 ckpts 文件夹,将预训练权重 r101_dcn_fcos3d_pretrain.pth 放入其中

ckpts/
├── r101_dcn_fcos3d_pretrain.pth

开始训练

  • 单机8卡训练

    bash test/train_full_8p_base_fp32.sh --epochs=4 # 8卡训练,默认训练24个epochs,这里只训练4个epochs
    bash test/train_performance_8p_base_fp32.sh # 8卡性能
    

结果

NAME Backbone Method 训练方式 Epoch NDS mAP FPS
8p-Atlas 800T A2 R101-DCN BEVFormer-base FP32 4 46.54 38.36 2.915
8p-竞品A R101-DCN BEVFormer-base FP32 4 44.29 35.16 3.320

说明:上表为历史数据,仅供参考。2024年12月31日更新的性能数据如下:

NAME 精度类型 FPS
8p-竞品 FP32 3.32
8p-Atlas 900 A2 PoDc FP32 3.79

公网地址说明

代码涉及公网地址参考 public_address_statement.md

版本说明

变更

2024.3.8:首次发布。

FAQ