You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

serve.yaml 5.0 kB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. # [固定]
  2. type: single
  3. #[可选]场景显示名称,可以为空
  4. name: 目标检测
  5. # [必选]开发商 apulis,huawei,custom等
  6. vendor: apulis.infer
  7. # [可选]:场景封面图片
  8. image: det.png
  9. # [可选]场景描述
  10. description: "中文描述"
  11. model_templates:
  12. #[*] 展示给用户的UI名称
  13. - title: "目标检测"
  14. # 模型领域(大分类)
  15. field: "cv"
  16. # 模型任务类型(二级分类)
  17. task: "detection"
  18. #平台定义的参数名,需要和平台有所交互和串联, 针对所有app保持一致
  19. #目前平台固定提供系统参数: ${modelName} ${modelId} ${modelVersionId} ${model}
  20. #默认1个.支持多个需要推理应用的支持
  21. maximum_num: 1
  22. #该模板槽位支持的相同模型的个数 [0~N],0表示可选, >1 表示可以多个
  23. #启动应用的时候config中的ordinal值[1,N]会与该数组的索引号进行匹配
  24. minimum_num: 1
  25. #备选的公共模型库中的模型名称,创建场景的时候需要与模型库关联
  26. avail_models:
  27. inspect_params:
  28. - title: "评判参数1"
  29. name: "threshold_bbox_mAP_50"
  30. type: "float"
  31. default: "0.1"
  32. editable: true
  33. #[必选]
  34. inference:
  35. #[必选]对接推理核心 支持 apuisv,mindx
  36. kernel: apuisv
  37. #[必选]对接用户协议 空表示默认使用 apulis_infer.proto协议
  38. agent: ""
  39. #允许透传
  40. passthrough: true
  41. #[可选] 如果需要额外协议 默认加载transformer目录下 *.proto协议文件
  42. proto: "ext.proto"
  43. #[必选] 需要的推理镜像地址,创建场景的时候需要与模型库关联
  44. engine: ""
  45. #正常最大请求延时,单位毫秒 ms
  46. healthy_delay: 500
  47. #[必选] 硬件资源描述
  48. devices:
  49. #必填,可选值参考selector.yaml中 device_type 字段
  50. - type: nvidia_gpu
  51. #选填,设备型号,gpu与cpu不需要填写该字段 ,填写该字段则进行型号筛选。多个型号使用逗号分割 目前参考值 | a310 | a910 | 910b | 910pro | 910prob
  52. series:
  53. #选填,最少使用的设备卡数
  54. device_num: 1
  55. #选填,最少使用的CPU核心数,单位 个
  56. cpu: 2
  57. #选填,最少使用的内存大小,单位 GB
  58. memory: 8
  59. #整个app的参数,也分为系统参数和用户自定义参数
  60. application:
  61. #从单模型插件位置查找前后处理插件代码
  62. single: true
  63. #评判镜像相关设置mlops使用
  64. inspect:
  65. #评判镜像地址
  66. engine: "python:3"
  67. #评判镜像启动入口: 平台会自动加上 --output 参数
  68. entrypoint: "python3 {{package/inspect/main.py}}"
  69. single:
  70. #preprocess对应的backend固定为 apulis.preprocessor
  71. preprocess:
  72. type: python
  73. custom_file: preprocess.py
  74. parameters:
  75. - name: normal.means
  76. type: array
  77. value: [123.675,116.28,103.53]
  78. mutable: false
  79. editable: true
  80. - name: normal.stds
  81. type: array
  82. value: [58.395,57.12,57.375]
  83. mutable: false
  84. editable: true
  85. - name: resize.width
  86. type: integer
  87. value: 400
  88. mutable: false
  89. editable: true
  90. - name: resize.height
  91. type: integer
  92. value: 400
  93. mutable: false
  94. editable: true
  95. - name: resize.type
  96. type: bool
  97. value: 0
  98. mutable: false
  99. editable: true
  100. - name: color_space
  101. type: string
  102. value: rgb
  103. mutable: false
  104. editable: true
  105. - name: transpose
  106. type: 1
  107. value: true
  108. mutable: false
  109. editable: true
  110. infer:
  111. #支持的推理 backend : mindx, tensorflow,tensorrt,onnx等
  112. backend: onnxruntime
  113. #运行环境
  114. device: npu,gpu,cpu
  115. #推理芯片调度
  116. device_ids: 0,1
  117. #模型文件路径,相对于 version目录,默认 model.xxx
  118. model_file: model.onnx
  119. #相对于 ${backend} 的特定参数集
  120. params:
  121. #输入描述
  122. inputs:
  123. - name: input
  124. # tensor datatype: bool, uint8, uint16, uint32, uint64, int8, int16, int32, int64, fp16, fp32, fp64, string (大小写均可)
  125. type: fp32
  126. shape: [ -1, 3, -1, -1]
  127. #输出描述
  128. outputs:
  129. - name: dets
  130. type: fp32
  131. shape: [ -1, -1, -1]
  132. - name: labels
  133. type: int64
  134. shape: [ -1, -1]
  135. - name: feature
  136. type: fp32
  137. shape: [ -1, 1280]
  138. - name: entropy
  139. type: fp32
  140. shape: [ -1, 1]
  141. - name: learning_loss
  142. type: fp32
  143. shape: [ -1, 1]
  144. #postprocess对应的backend固定为 apulis.postprocessor
  145. postprocess:
  146. type: python
  147. custom_file: postprocess.py
  148. extra_files: ['ext_pb2.py']
  149. parameters:
  150. - name: threshold
  151. type: float
  152. value: 0.1
  153. mutable: false
  154. editable: true
  155. - name: class_name_file
  156. type: path
  157. #相对于 transformer目录
  158. value: ../class_names.txt
  159. editable: true

No Description

Contributors (1)