|
- # [固定]
- type: single
- #[可选]场景显示名称,可以为空
- name: 目标检测
- # [必选]开发商 apulis,huawei,custom等
- vendor: apulis.infer
- # [可选]:场景封面图片
- image: det.png
- # [可选]场景描述
- description: "中文描述"
-
- model_templates:
- #[*] 展示给用户的UI名称
- - title: "目标检测"
- # 模型领域(大分类)
- field: "cv"
- # 模型任务类型(二级分类)
- task: "detection"
- #平台定义的参数名,需要和平台有所交互和串联, 针对所有app保持一致
- #目前平台固定提供系统参数: ${modelName} ${modelId} ${modelVersionId} ${model}
- #默认1个.支持多个需要推理应用的支持
- maximum_num: 1
- #该模板槽位支持的相同模型的个数 [0~N],0表示可选, >1 表示可以多个
- #启动应用的时候config中的ordinal值[1,N]会与该数组的索引号进行匹配
- minimum_num: 1
- #备选的公共模型库中的模型名称,创建场景的时候需要与模型库关联
- avail_models:
- inspect_params:
- - title: "评判参数1"
- name: "threshold_bbox_mAP_50"
- type: "float"
- default: "0.1"
- editable: true
- #[必选]
- inference:
- #[必选]对接推理核心 支持 apuisv,mindx
- kernel: apuisv
- #[必选]对接用户协议 空表示默认使用 apulis_infer.proto协议
- agent: ""
- #允许透传
- passthrough: true
- #[可选] 如果需要额外协议 默认加载transformer目录下 *.proto协议文件
- proto: "ext.proto"
- #[必选] 需要的推理镜像地址,创建场景的时候需要与模型库关联
- engine: ""
- #正常最大请求延时,单位毫秒 ms
- healthy_delay: 500
- #[必选] 硬件资源描述
- devices:
- #必填,可选值参考selector.yaml中 device_type 字段
- - type: nvidia_gpu
- #选填,设备型号,gpu与cpu不需要填写该字段 ,填写该字段则进行型号筛选。多个型号使用逗号分割 目前参考值 | a310 | a910 | 910b | 910pro | 910prob
- series:
- #选填,最少使用的设备卡数
- device_num: 1
- #选填,最少使用的CPU核心数,单位 个
- cpu: 2
- #选填,最少使用的内存大小,单位 GB
- memory: 8
-
- #整个app的参数,也分为系统参数和用户自定义参数
- application:
- #从单模型插件位置查找前后处理插件代码
- single: true
- #评判镜像相关设置mlops使用
- inspect:
- #评判镜像地址
- engine: "python:3"
- #评判镜像启动入口: 平台会自动加上 --output 参数
- entrypoint: "python3 {{package/inspect/main.py}}"
-
-
- single:
- #preprocess对应的backend固定为 apulis.preprocessor
- preprocess:
- type: python
- custom_file: preprocess.py
- parameters:
- - name: normal.means
- type: array
- value: [123.675,116.28,103.53]
- mutable: false
- editable: true
- - name: normal.stds
- type: array
- value: [58.395,57.12,57.375]
- mutable: false
- editable: true
- - name: resize.width
- type: integer
- value: 400
- mutable: false
- editable: true
- - name: resize.height
- type: integer
- value: 400
- mutable: false
- editable: true
- - name: resize.type
- type: bool
- value: 0
- mutable: false
- editable: true
- - name: color_space
- type: string
- value: rgb
- mutable: false
- editable: true
- - name: transpose
- type: 1
- value: true
- mutable: false
- editable: true
- infer:
- #支持的推理 backend : mindx, tensorflow,tensorrt,onnx等
- backend: onnxruntime
- #运行环境
- device: npu,gpu,cpu
- #推理芯片调度
- device_ids: 0,1
- #模型文件路径,相对于 version目录,默认 model.xxx
- model_file: model.onnx
- #相对于 ${backend} 的特定参数集
- params:
- #输入描述
- inputs:
- - name: input
- # tensor datatype: bool, uint8, uint16, uint32, uint64, int8, int16, int32, int64, fp16, fp32, fp64, string (大小写均可)
- type: fp32
- shape: [ -1, 3, -1, -1]
- #输出描述
- outputs:
- - name: dets
- type: fp32
- shape: [ -1, -1, -1]
- - name: labels
- type: int64
- shape: [ -1, -1]
- - name: feature
- type: fp32
- shape: [ -1, 1280]
- - name: entropy
- type: fp32
- shape: [ -1, 1]
- - name: learning_loss
- type: fp32
- shape: [ -1, 1]
- #postprocess对应的backend固定为 apulis.postprocessor
- postprocess:
- type: python
- custom_file: postprocess.py
- extra_files: ['ext_pb2.py']
- parameters:
- - name: threshold
- type: float
- value: 0.1
- mutable: false
- editable: true
- - name: class_name_file
- type: path
- #相对于 transformer目录
- value: ../class_names.txt
- editable: true
|