同步操作将从 Ascend/samples 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
中文|English
介绍
Ascend Samples,欢迎各位开发者!
贡献要求
开发者提交的修改的工程文件中至少包括源码、readme、编译&运行脚本,并遵循以下标准。
请贡献者在提交代码之前签署CLA协议,“个人签署”,链接。
一、源码
在线编译,推理请使用C++/python代码实现,符合第四部分编码规范(当前只有C++的样例)
C++PR 提交样例规范请参考sample。
贡献者工程代码目录规则:
说明: 每一个入口脚本对应一种设备形态,要求当前工程至少适配一种设备形态,每种设备的入口脚本对应的版本号须填写在同级目录下的 host_version.conf 文件中。
- testcase_200dk.sh 适配设备Atlas200dk。
- testcase_300.sh 适配设备Atlas300。
- testcase_800.sh 适配设备Atlas800。
- testcase_1951.sh 适配设备1951。
说明: 每一个设备形态对应一种或多种版本,要求当前工程至少适配一种版本。例如 host_version.conf中内容为:
- Atlas300 = c75,c73 当前工程适配Atlas300的c73和c75两种版本。
- Atlas200dk = c73,c75 当前工程适配Atlas200dk的c73和c75两种版本。
- Atlas800 = c75 当前工程适配Atlas800的c75版本。
- Atlas1951 = c75 当前工程适配Atlas1951的c75版本。
从其他开源迁移的代码,请增加License声明。
二、License规则
# Copyright [yyyy] [name of copyright owner]
#
# 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.
例如:
# Copyright [yyyy] [name of copyright owner]
# Copyright 2018 hisillion Technologies Co., Ltd
#
# 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.
三、readme
readme用于指导用户理解和部署样例,要包含如下内容:
简介:
工程项目的功能和运行方法、模型的来源;
关键要求:
四、PR提交规范
提交PR操作可以参考如何fork仓库并提交PR_wiki。
PR提交的样例需要包含门禁项、工程测试用例和readme。
简介:
提交的PR中应该包含如下文件, 这是校验PR提交是否有效的门禁项:
提交PR后,会自动触发门禁流水,后台会根据用例入口shell(工程目录下的scripts/testcase*.sh)进行编译,关键要求如下:
scripts/testcase*.sh 应该包含如下功能。
testcase*.sh 包含两方面功能:推理和校验推理的结果。
推理阶段包含:
校验推理的结果(根据不同的工程提供不同的推理结果校验方法,校验方法可以写在脚本中):
执行环境已预装软件包和Python3.6.9环境,调用命令"python3.6"、,安装第三方库依赖使用"pip3 install package --user"、"python3.6 -m pip install package --user"均可。
模型需要按照 modelzoo仓的贡献指南,上传到modelzoo中。验证文件(bin、图片、视频)请提供归档OBS、网盘链接或联系管理员存放到固定的obs地址,不要放在samples仓中。
环境和其他问题,请提交Issue跟踪。
提交测试用例可以参考PR提交示例。
五、编程规范
规范标准
C++代码遵循google编程规范:Google C++ Coding Guidelines;单元测测试遵循规范: Googletest Primer
Python代码遵循PEP8规范:Python PEP 8 Coding Style;单元测试遵循规范: pytest
规范备注
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。