克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
BSD-3-Clause

Driving SDK

简介

Driving SDK是基于昇腾NPU平台开发的适用于自动驾驶场景的算子和模型加速库,提供了一系列高性能的算子和模型加速接口,支持PyTorch框架。

安装

前提条件

  1. 本项目依赖昇腾提供的pytorch_npu包和CANN包,需要先安装对应版本的pytorch_npu和CANN软件包,具体配套关系见pytorch仓README。 请参考昇腾官方文档Pytorch框架训练环境准备
  2. 使用pip3 install -r requirements.txt 安装python依赖,requirements.txt文件位于项目根目录下。
  3. 如果您需要编译ONNX插件,请安装protobuf-devel-3.14.0, 在centos 系统上可以执行yum install protobuf-devel-3-14.0,否则请将CMakePresets.json中的ENABLE_ONNX选项改为FALSECMakePresets.json文件位于项目根目录下。
  4. 建议您在准备好环境后,使用umask 0027将umask调整为0027,以保证文件权限正确。
  5. 建议您以非root用户身份执行以下操作。

从发布包安装

当前并未正式发布whl包 ,请参考源码安装方式。

从源码安装

  1. 克隆原始仓。
git clone https://gitee.com/ascend/DrivingSDK.git -b master
  1. 编译Driving SDK。

注意:请在仓库根目录下执行编译命令

bash ci/build.sh --python=3.8

生成的whl包在DrivingSDK/dist目录下, 命名规则为mx_driving-1.0.0+git{commit_id}-cp{python_version}-linux_{arch}.whl。 请参考编译指导获取更多编译细节。 参数--python指定编译过程中使用的python版本,支持3.8及以上:

参数 取值范围 说明 缺省值 备注
python pytorch2.1.0、2.3.1及以上版本,支持3.8及以上 指定编译过程中使用的python版本 3.8

支持的CPU架构,Python,PyTorch和torch_npu版本对应关系如下:

Gitee分支 CPU架构 支持的Python版本 支持的PyTorch版本 支持的torch_npu版本
master x86&aarch64 Python3.8.x,Python3.9.x,Python3.10.x,Python3.11.x 2.1.0 v2.1.0
Python3.8.x,Python3.9.x,Python3.10.x,Python3.11.x 2.3.1 v2.3.1
Python3.8.x,Python3.9.x,Python3.10.x,Python3.11.x 2.4.0 v2.4.0
branch_v6.0.0-RC1 x86&aarch64 Python3.7.x(>=3.7.5),Python3.8.x,Python3.9.x,Python3.10.x 1.11.0 v1.11.0-6.0.rc1
Python3.8.x,Python3.9.x,Python3.10.x 2.1.0 v2.1.0-6.0.rc1
Python3.8.x,Python3.9.x,Python3.10.x 2.2.0 v2.2.0-6.0.rc1
branch_v6.0.0-RC2 x86&aarch64 Python3.7.x(>=3.7.5),Python3.8.x,Python3.9.x,Python3.10.x 1.11.0 v1.11.0-6.0.rc2
Python3.8.x,Python3.9.x,Python3.10.x 2.1.0 v2.1.0-6.0.rc2
Python3.8.x,Python3.9.x,Python3.10.x 2.2.0 v2.2.0-6.0.rc2
Python3.8.x,Python3.9.x,Python3.10.x 2.3.1 v2.3.1-6.0.rc2
branch_v6.0.0-RC3 x86&aarch64 Python3.8.x,Python3.9.x,Python3.10.x,Python3.11.x 2.1.0 v2.1.0-6.0.rc3
Python3.8.x,Python3.9.x,Python3.10.x,Python3.11.x 2.3.1 v2.3.1-6.0.rc3
Python3.8.x,Python3.9.x,Python3.10.x,Python3.11.x 2.4.0 v2.4.0-6.0.rc3
  1. 安装Driving SDK。
cd DrivingSDK/dist
pip3 install mx_driving-1.0.0+git{commit_id}-cp{python_version}-linux_{arch}.whl

如需要保存安装日志,可在pip3 install命令后添加--log <PATH>参数,并对您指定的目录做好权限控制。

卸载

Pytorch 框架训练环境的卸载请参考昇腾官方文档Pytorch框架训练环境卸载。 Driving SDK的卸载只需执行以下命令:

pip3 uninstall mx_driving

快速上手

import torch, torch_npu
from mx_driving.common import scatter_max
updates = torch.tensor([[2, 0, 1, 3, 1, 0, 0, 4], [0, 2, 1, 3, 0, 3, 4, 2], [1, 2, 3, 4, 4, 3, 2, 1]], dtype=torch.float32).npu()
indices = torch.tensor([0, 2, 0], dtype=torch.int32).npu()
out = updates.new_zeros((3, 8))
out, argmax = scatter_max(updates, indices, out)

特性介绍

目录结构及说明

.
├── kernels                     # 算子实现
│  ├── op_host               
│  ├── op_kernel                  
│  └── CMakeLists.txt
├── onnx_plugin                 # onnx框架适配层
├── mx_driving
│  ├── __init__.py
│  ├── csrc                     # 加速库API适配层
│  └── ...               
├── model_examples              # 自动驾驶模型示例
│  └── BEVFormer                # BEVFormer模型示例
├── ci                          # ci脚本
├── cmake                       # cmake脚本
├── CMakeLists.txt              # cmake配置文件
├── CMakePresets.json           # cmake配置文件
├── docs                        # 文档
|  ├── api                      # 算子api调用文档
|  └── ...
├── include                     # 头文件
├── LICENSE                     # 开源协议
├── OWNERS                      # 代码审查
├── README.md                   # 项目说明
├── requirements.txt            # 依赖
├── scripts                     # 工程脚本
├── setup.py                    # whl打包配置
└── tests                       # 测试文件

算子清单

请参见算子清单

支持特性

  • 支持PyTorch 2.1.0,2.3.1,2.4.0
  • 支持ONNX模型转换,训推一体
  • 支持图模式

模型清单

Model 链接 认证
MatrixVT https://gitee.com/ascend/ModelZoo-PyTorch/tree/master/PyTorch/built-in/autonoumous_driving/MatrixVT 【Pass】
MobileNetV1 https://gitee.com/ascend/ModelZoo-PyTorch/tree/master/PyTorch/built-in/cv/classification/MobileNetV1_ID0094_for_PyTorch 【Pass】
MobileNetV2 https://gitee.com/ascend/ModelZoo-PyTorch/tree/master/PyTorch/built-in/cv/classification/MobileNetV2_for_PyTorch 【Pass】
YoloV5 https://gitee.com/ascend/modelzoo-GPL/tree/master/built-in/PyTorch/Official/cv/object_detection/Yolov5_for_PyTorch_v7.0 【Pass】
YoloV7 https://gitee.com/ascend/modelzoo-GPL/tree/master/built-in/PyTorch/Official/cv/object_detection/Yolov7_for_PyTorch 【Pass】
YoloV8 https://gitee.com/ascend/DrivingSDK/tree/master/model_examples/Yolov8 【Test】
YoloV9 https://gitee.com/ascend/ModelZoo-PyTorch/tree/master/PyTorch/built-in/cv/detection/YOLOV9_for_PyTorch 【Test】
YoloX https://gitee.com/ascend/ModelZoo-PyTorch/tree/master/PyTorch/dev/cv/detection/YOLOX_ID2833_for_PyTorch 【Pass】
Stable-Diffusion https://gitee.com/ascend/ModelZoo-PyTorch/tree/master/PyTorch/built-in/diffusion/diffusers0.18.1 【Pass】
RegNet https://gitee.com/ascend/ModelZoo-PyTorch/tree/master/PyTorch/contrib/cv/classification/RegNetX_ID4127_for_PyTorch 【Pass】
RepVGG https://gitee.com/ascend/ModelZoo-PyTorch/tree/master/PyTorch/contrib/cv/classification/RepVGG 【Pass】
ViT https://gitee.com/ascend/ModelZoo-PyTorch/tree/master/PyTorch/contrib/cv/classification/vit_base_patch32_224 【Pass】
Resnet18 https://gitee.com/ascend/ModelZoo-PyTorch/tree/master/ACL_PyTorch/built-in/cv/Resnet18_for_PyTorch 【Pass】
Resnet50 https://gitee.com/ascend/ModelZoo-PyTorch/tree/master/PyTorch/built-in/cv/classification/ResNet50_ID4149_for_PyTorch 【Pass】
Mobilenetv3 https://gitee.com/ascend/ModelZoo-PyTorch/tree/master/PyTorch/built-in/cv/classification/MobileNetV3-Large_ID1784_for_PyTorch 【Pass】
Faster-Mask-RCNN https://gitee.com/ascend/ModelZoo-PyTorch/tree/master/PyTorch/built-in/cv/detection/Faster_Mask_RCNN_for_PyTorch 【Pass】
Swin-Transformer https://gitee.com/ascend/ModelZoo-PyTorch/tree/master/PyTorch/contrib/cv/classification/Swin-Transformer_for_PyTorch 【Pass】
CenterNet https://gitee.com/ascend/DrivingSDK/tree/master/model_examples/CenterNet 【Pass】
EfficientNet https://gitee.com/ascend/ModelZoo-PyTorch/tree/master/PyTorch/contrib/cv/classification/EfficientNet-B0_for_PyTorch 【Pass】
EfficientNetV2 https://gitee.com/ascend/ModelZoo-PyTorch/tree/master/PyTorch/contrib/cv/classification/EfficientNetV2-B0_for_PyTorch 【Pass】
SSD MobileNetV1 https://gitee.com/ascend/ModelZoo-PyTorch/tree/master/PyTorch/contrib/autonoumous_driving/SSD-MobileNetV1 【Pass】
U-net https://gitee.com/ascend/ModelZoo-PyTorch/tree/master/PyTorch/contrib/cv/semantic_segmentation/UNet_for_PyTorch 【Pass】
FCN https://gitee.com/ascend/ModelZoo-PyTorch/tree/master/PyTorch/contrib/cv/semantic_segmentation/FCN-res18_for_Pytorch 【Pass】
BisenetV2 https://gitee.com/ascend/ModelZoo-PyTorch/tree/master/PyTorch/contrib/autonoumous_driving/BiSeNet_v2 【Pass】
FCN https://gitee.com/ascend/ModelZoo-PyTorch/tree/master/PyTorch/contrib/cv/semantic_segmentation/FCN-res18_for_Pytorch 【Pass】
PETR https://gitee.com/ascend/ModelZoo-PyTorch/tree/master/PyTorch/contrib/autonoumous_driving/PETR 【Pass】
PointPillar(2D) https://gitee.com/ascend/DrivingSDK/tree/master/model_examples/PointPillar 【Pass】
CenterPoint(2D) https://gitee.com/ascend/DrivingSDK/tree/master/model_examples/CenterPoint 【Pass】
BevFormer https://gitee.com/ascend/DrivingSDK/tree/master/model_examples/BEVFormer 【Pass】
SurroundOcc https://gitee.com/ascend/DrivingSDK/tree/master/model_examples/SurroundOcc 【Pass】
GameFormer-Planner https://gitee.com/ascend/DrivingSDK/tree/master/model_examples/GameFormer-Planner 【Pass】
StreamPETR https://gitee.com/ascend/DrivingSDK/tree/master/model_examples/StreamPETR 【Test】
BEVDet https://gitee.com/ascend/DrivingSDK/tree/master/model_examples/BEVDet 【Test】
PanoOcc https://gitee.com/ascend/DrivingSDK/tree/master/model_examples/PanoOcc 【Test】
TPVFormer https://gitee.com/ascend/DrivingSDK/tree/master/model_examples/TPVFormer 【Test】
DETR https://gitee.com/ascend/DrivingSDK/tree/master/model_examples/DETR 【Test】
Deformable-DETR https://gitee.com/ascend/DrivingSDK/tree/master/model_examples/Deformable-DETR 【Test】
LaneSegNet https://gitee.com/ascend/DrivingSDK/tree/master/model_examples/LaneSegNet 【Test】
BEVFusion https://gitee.com/ascend/DrivingSDK/tree/master/model_examples/BEVFusion 【Test】
FCOS-resnet https://gitee.com/ascend/DrivingSDK/tree/master/model_examples/FCOS 【Test】
MapTR https://gitee.com/ascend/DrivingSDK/tree/master/model_examples/MapTR 【Test】
UniAD https://gitee.com/ascend/DrivingSDK/tree/master/model_examples/UniAD 【Test】
PivotNet https://gitee.com/ascend/DrivingSDK/tree/master/model_examples/PivotNet 【Test】
CenterPoint(3D) https://gitee.com/ascend/DrivingSDK/tree/master/model_examples/CenterPoint 【Test】
LMDrive https://gitee.com/ascend/DrivingSDK/tree/master/model_examples/LMDrive 【Test】
DETR3D https://gitee.com/ascend/DrivingSDK/tree/master/model_examples/DETR3D 【Test】
DenseTNT https://gitee.com/ascend/DrivingSDK/tree/master/model_examples/DenseTNT 【Test】
Mask2Former https://gitee.com/ascend/DrivingSDK/tree/master/model_examples/Mask2Former 【Test】

支持的产品型号

  • Atlas A2 训练系列产品

安全声明

系统安全加固

  1. 建议您在运行系统配置时开启ASLR(级别2),又称全随机地址空间布局随机化,以提高系统安全性,可参考以下方式进行配置:
    echo 2 > /proc/sys/kernel/randomize_va_space
    
  2. 由于Driving SDK需要用户自行编译,建议您对编译后生成的so文件开启strip, 又称移除调试符号信息, 开启方式如下:
    strip -s <so_file>
    
    具体so文件如下:
    • mx_driving/packages/vendors/customize/op_api/lib/libcust_opapi.so
    • mx_driving/packages/vendors/customize/op_proto/lib/linux/aarch64/libcust_opsproto_rt2.0.so
    • mx_driving/packages/vendors/customize/op_impl/ai_core/tbe/op_tiling/lib/linux/aarch64/libcust_opmaster_rt2.0.so

运行用户建议

出于安全性及权限最小化角度考虑,不建议使用root等管理员类型账户使用Driving SDK。

文件权限控制

在使用Driving SDK时,您可能会进行profiling、调试等操作,建议您对相关目录及文件做好权限控制,以保证文件安全。

  1. 建议您在使用Driving SDK时,将umask调整为0027及以上,保障新增文件夹默认最高权限为750,文件默认最高权限为640
  2. 建议您对个人数据、商业资产、源文件、训练过程中保存的各类文件等敏感内容做好权限管控,可参考下表设置安全权限。

文件权限参考

类型 Linux权限参考最大值
用户主目录 750(rwxr-x---)
程序文件(含脚本文件、库文件等) 550(r-xr-x---)
程序文件目录 550(r-xr-x---)
配置文件 640(rw-r-----)
配置文件目录 750(rwxr-x---)
日志文件(记录完毕或者已经归档) 440(r--r-----)
日志文件(正在记录) 640(rw-r-----)
日志文件目录 750(rwxr-x---)
Debug文件 640(rw-r-----)
Debug文件目录 750(rwxr-x---)
临时文件目录 750(rwxr-x---)
维护升级文件目录 770(rwxrwx---)
业务数据文件 640(rw-r-----)
业务数据文件目录 750(rwxr-x---)
密钥组件、私钥、证书、密文文件目录 700(rwx------)
密钥组件、私钥、证书、加密密文 600(rw-------)
加解密接口、加解密脚本 500(r-x------)

构建安全声明

在源码编译安装Driving SDK时,需要您自行编译,编译过程中会生成一些中间文件,建议您在编译完成后,对中间文件做好权限控制,以保证文件安全。

运行安全声明

  1. 建议您结合运行环境资源状况编写对应训练脚本。若训练脚本与资源状况不匹配,如数据集加载内存大小超出内存容量限制、训练脚本在本地生成数据超过磁盘空间大小等情况,可能引发错误并导致进程意外退出。
  2. Driving SDK在运行异常时(如输入校验异常(请参考api文档说明),环境变量配置错误,算子执行报错等)会退出进程并打印报错信息,属于正常现象。建议用户根据报错提示定位具体错误原因,包括通过设定算子同步执行、查看CANN日志、解析生成的Core Dump文件等方式。

公网地址声明

在Driving SDK的配置文件和脚本中存在公网地址

公网地址

类型 开源代码地址 文件名 公网IP地址/公网URL地址/域名/邮箱地址 用途说明
自研 不涉及 ci/docker/ARM/Dockerfile https://mirrors.aliyun.com/pypi/simple docker配置文件,用于配置pip源
自研 不涉及 ci/docker/X86/Dockerfile https://mirrors.huaweicloud.com/repository/pypi/simple docker配置文件,用于配置pip源
自研 不涉及 ci/docker/ARM/install_cann.sh https://ascend-cann.obs.cn-north-4.myhuaweicloud.com/CANN cann包下载地址
自研 不涉及 ci/docker/x86/install_cann.sh https://ascend-cann.obs.cn-north-4.myhuaweicloud.com/CANN cann包下载地址
自研 不涉及 ci/docker/ARM/build_protobuf.sh https://gitee.com/it-monkey/protocolbuffers.git 用于打包whl的url入参
自研 不涉及 ci/docker/X86/build_protobuf.sh https://gitee.com/it-monkey/protocolbuffers.git 用于打包whl的url入参
自研 不涉及 ci/docker/X86/install_obs.sh https://obs-community.obs.cn-north-1.myhuaweicloud.com/obsutil/current/obsutil_linux_amd64.tar.gz obs下载链接
自研 不涉及 ci/docker/ARM/install_obs.sh https://obs-community.obs.cn-north-1.myhuaweicloud.com/obsutil/current/obsutil_linux_amd64.tar.gz obs下载链接
自研 不涉及 ci/build.sh https://gitee.com/ascend/pytorch.git 编译脚本根据torch_npu仓库地址拉取代码进行编译
自研 不涉及 cmake/util/makeself/makeself.sh https://makeself.io/ makeself主页
自研 不涉及 cmake/util/makeself/makeself.sh http://www.gnu.org/copyleft/gpl.html license
自研 不涉及 cmake/util/makeself/makeself.sh https://www.etalabs.net/sh_tricks.html 接口文档
自研 不涉及 Third_Party_Open_Source__Software_Notice foss@huawei.com license 请求邮箱
自研 不涉及 cmake/util/makeself/makeself.sh megastep@megastep.org makeself 作者联系邮箱
自研 不涉及 cmake/util/makeself/makeself.lsm megastep@megastep.org makeself 作者联系邮箱
自研 不涉及 cmake/util/makeself/makeself-header.sh foss@huawei.com license
自研 不涉及 cmake/util/makeself/makeself.1 megastep@megastep.org makeself 作者联系邮箱
自研 不涉及 cmake/util/makeself/makeself.1 fenio@o2.pl makeself 主页原开发作者的邮箱
自研 不涉及 LICENSE http://www.apache.org/licenses/ apache license
自研 不涉及 LICENSE http://www.apache.org/licenses/LICENSE-2.0 apache license 2.0
开源引入 https://gitee.com/it-monkey/protocolbuffers.git ci/docker/ARM/build_protobuf.sh https://gitee.com/it-monkey/protocolbuffers.git 用于构建 protobuf
开源引入 https://gitee.com/it-monkey/protocolbuffers.git ci/docker/X86/build_protobuf.sh https://gitee.com/it-monkey/protocolbuffers.git 用于构建 protobuf

示例模型公网地址声明

模型名称 公网地址声明
UniAD model_examples/UniAD/public_address_statement.md
BEVDet model_examples/BEVDet/public_address_statement.md

公开接口声明

参考API清单,Driving SDK提供了对外的自定义接口。如果一个函数在文档中有展示,则该接口是公开接口。否则,使用该功能前可以在社区询问该功能是否确实是公开的或意外暴露的接口,因为这些未暴露接口将来可能会被修改或者删除。

通信安全加固

Driving SDK在运行时依赖于PyTorchtorch_npu,您需关注通信安全加固,具体方式请参考torch_npu通信安全加固

通信矩阵

Driving SDK在运行时依赖于PyTorchtorch_npu,涉及通信矩阵,具体信息请参考torch_npu通信矩阵

软件生命周期说明

分支维护策略

Driving SDK版本分支的维护阶段如下:

状态 时间 说明
计划 1—3 个月 计划特性
开发 3 个月 开发特性
维护 6-12 个月 合入所有已解决的问题并发布版本,针对不同的Driving SDK版本采取不同的维护策略,常规版本和长期支持版本维护周期分别为6个月和12个月
无维护 0—3 个月 合入所有已解决的问题,无专职维护人员,无版本发布
生命周期终止(EOL) N/A 分支不再接受任何修改

Driving SDK版本维护策略

Driving SDK版本 维护策略 当前状态 发布时间 后续状态 EOL日期
BSD 3-Clause License Copyright (c) 2023, Huawei Technologies Co., Ltd. Copyright (C) 1989, 1991 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Copyright 2018-2019 Open-MMLab. All rights reserved. Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright 2018-2019 Open-MMLab. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

简介

华为昇腾-自动驾驶加速库 展开 收起
BSD-3-Clause
取消

发行版 (3)

全部
10天前

贡献者

全部

近期动态

不能加载更多了
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化