feat: 升级至v2.0.0,新增人员/人脸管理服务与摄像头支持
- 新增 create_person、delete_person、create_face、delete_face 服务 - 支持通过摄像头实体获取图片 (camera_entity_id 参数) - 添加配置选项支持,可通过 Options Flow 修改配置 - 传感器采用 CoordinatorEntity 模式,优化数据更新机制 - 改进重试逻辑与错误处理 - 重构代码结构,清理冗余代码
This commit is contained in:
+238
-88
@@ -1,4 +1,3 @@
|
||||
# 腾讯云人脸识别服务定义
|
||||
face_search:
|
||||
name: 人脸搜索
|
||||
description: 在指定的人员库中搜索人脸。
|
||||
@@ -24,7 +23,19 @@ face_search:
|
||||
text:
|
||||
image_file:
|
||||
name: 图片文件
|
||||
description: 通过文件上传的人脸图片。
|
||||
description: 通过文件上传的人脸图片(Base64编码)。
|
||||
selector:
|
||||
text:
|
||||
camera_entity_id:
|
||||
name: 摄像头实体
|
||||
description: 用于获取图片的摄像头实体ID。
|
||||
example: "camera.front_door"
|
||||
selector:
|
||||
entity:
|
||||
domain: camera
|
||||
config_entry_id:
|
||||
name: 配置项ID
|
||||
description: 使用的配置项ID(多配置时指定)。
|
||||
selector:
|
||||
text:
|
||||
max_face_num:
|
||||
@@ -62,90 +73,16 @@ face_search:
|
||||
mode: box
|
||||
quality_control:
|
||||
name: 质量控制
|
||||
description: 是否进行质量控制。
|
||||
default: true
|
||||
example: 1
|
||||
selector:
|
||||
number:
|
||||
min: 0
|
||||
max: 1
|
||||
mode: box
|
||||
need_rotate_check:
|
||||
name: 旋转检查
|
||||
description: 是否进行旋转检查。
|
||||
default: true
|
||||
example: true
|
||||
selector:
|
||||
boolean:
|
||||
face_match_threshold:
|
||||
name: 人脸匹配阈值
|
||||
description: 人脸匹配阈值(0-100)。
|
||||
default: 60
|
||||
example: 60
|
||||
selector:
|
||||
number:
|
||||
min: 0
|
||||
max: 100
|
||||
step: 1
|
||||
mode: slider
|
||||
response:
|
||||
description: "人脸搜索结果"
|
||||
fields:
|
||||
results:
|
||||
name: "结果"
|
||||
description: "包含人脸ID和候选人列表的数组"
|
||||
example: '[{"face_id": "3440118425101275818", "candidates": [{"person_id": "person_1", "person_name": "张三", "score": 99.9, "person_tag": "员工"}]}]'
|
||||
|
||||
detect_face:
|
||||
name: 人脸检测
|
||||
description: 检测图片中的人脸。
|
||||
fields:
|
||||
image_url:
|
||||
name: 图片URL
|
||||
description: 要检测的图片URL。
|
||||
example: "https://example.com/image.jpg"
|
||||
selector:
|
||||
text:
|
||||
image_path:
|
||||
name: 图片路径
|
||||
description: 要检测的本地图片路径。
|
||||
example: "/config/www/image.jpg"
|
||||
selector:
|
||||
text:
|
||||
image_file:
|
||||
name: 图片文件
|
||||
description: 要检测的图片文件。
|
||||
selector:
|
||||
text:
|
||||
max_face_num:
|
||||
name: 最大人脸数量
|
||||
description: 最多检测的人脸数量。
|
||||
description: 是否进行质量控制(0=否,1=是)。
|
||||
default: 1
|
||||
example: 1
|
||||
selector:
|
||||
number:
|
||||
min: 1
|
||||
max: 10
|
||||
step: 1
|
||||
mode: box
|
||||
min_face_size:
|
||||
name: 最小人脸尺寸
|
||||
description: 最小人脸尺寸(像素)。
|
||||
default: 34
|
||||
example: 34
|
||||
selector:
|
||||
number:
|
||||
min: 1
|
||||
max: 200
|
||||
step: 1
|
||||
mode: box
|
||||
need_rotate_check:
|
||||
name: 旋转检查
|
||||
description: 是否进行旋转检查。
|
||||
default: true
|
||||
example: true
|
||||
selector:
|
||||
boolean:
|
||||
select:
|
||||
options:
|
||||
- label: "否"
|
||||
value: "0"
|
||||
- label: "是"
|
||||
value: "1"
|
||||
|
||||
get_face_attributes:
|
||||
name: 获取人脸属性
|
||||
@@ -165,7 +102,19 @@ get_face_attributes:
|
||||
text:
|
||||
image_file:
|
||||
name: 图片文件
|
||||
description: 要分析的图片文件。
|
||||
description: 要分析的图片文件(Base64编码)。
|
||||
selector:
|
||||
text:
|
||||
camera_entity_id:
|
||||
name: 摄像头实体
|
||||
description: 用于获取图片的摄像头实体ID。
|
||||
example: "camera.front_door"
|
||||
selector:
|
||||
entity:
|
||||
domain: camera
|
||||
config_entry_id:
|
||||
name: 配置项ID
|
||||
description: 使用的配置项ID(多配置时指定)。
|
||||
selector:
|
||||
text:
|
||||
max_face_num:
|
||||
@@ -181,8 +130,209 @@ get_face_attributes:
|
||||
mode: box
|
||||
need_rotate_check:
|
||||
name: 旋转检查
|
||||
description: 是否进行旋转检查。
|
||||
default: true
|
||||
example: true
|
||||
description: 是否进行旋转检查(0=否,1=是)。
|
||||
default: 1
|
||||
example: 1
|
||||
selector:
|
||||
boolean:
|
||||
select:
|
||||
options:
|
||||
- label: "否"
|
||||
value: "0"
|
||||
- label: "是"
|
||||
value: "1"
|
||||
|
||||
create_person:
|
||||
name: 创建人员
|
||||
description: 在人员库中创建新人员。
|
||||
fields:
|
||||
person_id:
|
||||
name: 人员ID
|
||||
description: 人员的唯一标识符。
|
||||
required: true
|
||||
example: "person_001"
|
||||
selector:
|
||||
text:
|
||||
person_name:
|
||||
name: 人员名称
|
||||
description: 人员名称。
|
||||
required: true
|
||||
example: "张三"
|
||||
selector:
|
||||
text:
|
||||
group_id:
|
||||
name: 人员库ID
|
||||
description: 要添加到的人员库ID。
|
||||
required: true
|
||||
example: "Hass"
|
||||
selector:
|
||||
text:
|
||||
image_url:
|
||||
name: 图片URL
|
||||
description: 人员人脸图片URL。
|
||||
example: "https://example.com/face.jpg"
|
||||
selector:
|
||||
text:
|
||||
image_path:
|
||||
name: 图片路径
|
||||
description: 人员人脸本地图片路径。
|
||||
example: "/config/www/face.jpg"
|
||||
selector:
|
||||
text:
|
||||
image_file:
|
||||
name: 图片文件
|
||||
description: 人员人脸图片文件(Base64编码)。
|
||||
selector:
|
||||
text:
|
||||
camera_entity_id:
|
||||
name: 摄像头实体
|
||||
description: 用于获取人脸图片的摄像头实体ID。
|
||||
example: "camera.front_door"
|
||||
selector:
|
||||
entity:
|
||||
domain: camera
|
||||
config_entry_id:
|
||||
name: 配置项ID
|
||||
description: 使用的配置项ID(多配置时指定)。
|
||||
selector:
|
||||
text:
|
||||
gender:
|
||||
name: 性别
|
||||
description: 性别(0=女,1=男)。
|
||||
selector:
|
||||
select:
|
||||
options:
|
||||
- label: "女"
|
||||
value: "0"
|
||||
- label: "男"
|
||||
value: "1"
|
||||
person_tag:
|
||||
name: 人员标签
|
||||
description: 人员备注标签。
|
||||
selector:
|
||||
text:
|
||||
quality_control:
|
||||
name: 质量控制
|
||||
description: 是否进行质量控制(0=否,1=是)。
|
||||
default: 1
|
||||
selector:
|
||||
select:
|
||||
options:
|
||||
- label: "否"
|
||||
value: "0"
|
||||
- label: "是"
|
||||
value: "1"
|
||||
need_rotate_check:
|
||||
name: 旋转检查
|
||||
description: 是否进行旋转检查(0=否,1=是)。
|
||||
default: 1
|
||||
selector:
|
||||
select:
|
||||
options:
|
||||
- label: "否"
|
||||
value: "0"
|
||||
- label: "是"
|
||||
value: "1"
|
||||
|
||||
delete_person:
|
||||
name: 删除人员
|
||||
description: 从人员库中删除人员。
|
||||
fields:
|
||||
person_id:
|
||||
name: 人员ID
|
||||
description: 要删除的人员ID。
|
||||
required: true
|
||||
example: "person_001"
|
||||
selector:
|
||||
text:
|
||||
config_entry_id:
|
||||
name: 配置项ID
|
||||
description: 使用的配置项ID(多配置时指定)。
|
||||
selector:
|
||||
text:
|
||||
|
||||
create_face:
|
||||
name: 注册人脸
|
||||
description: 为已有人员添加新的人脸照片。
|
||||
fields:
|
||||
person_id:
|
||||
name: 人员ID
|
||||
description: 要添加人脸的人员ID。
|
||||
required: true
|
||||
example: "person_001"
|
||||
selector:
|
||||
text:
|
||||
image_url:
|
||||
name: 图片URL
|
||||
description: 人脸图片URL。
|
||||
example: "https://example.com/face.jpg"
|
||||
selector:
|
||||
text:
|
||||
image_path:
|
||||
name: 图片路径
|
||||
description: 人脸本地图片路径。
|
||||
example: "/config/www/face.jpg"
|
||||
selector:
|
||||
text:
|
||||
image_file:
|
||||
name: 图片文件
|
||||
description: 人脸图片文件(Base64编码)。
|
||||
selector:
|
||||
text:
|
||||
camera_entity_id:
|
||||
name: 摄像头实体
|
||||
description: 用于获取人脸图片的摄像头实体ID。
|
||||
example: "camera.front_door"
|
||||
selector:
|
||||
entity:
|
||||
domain: camera
|
||||
config_entry_id:
|
||||
name: 配置项ID
|
||||
description: 使用的配置项ID(多配置时指定)。
|
||||
selector:
|
||||
text:
|
||||
quality_control:
|
||||
name: 质量控制
|
||||
description: 是否进行质量控制(0=否,1=是)。
|
||||
default: 1
|
||||
selector:
|
||||
select:
|
||||
options:
|
||||
- label: "否"
|
||||
value: "0"
|
||||
- label: "是"
|
||||
value: "1"
|
||||
need_rotate_check:
|
||||
name: 旋转检查
|
||||
description: 是否进行旋转检查(0=否,1=是)。
|
||||
default: 1
|
||||
selector:
|
||||
select:
|
||||
options:
|
||||
- label: "否"
|
||||
value: "0"
|
||||
- label: "是"
|
||||
value: "1"
|
||||
|
||||
delete_face:
|
||||
name: 删除人脸
|
||||
description: 删除指定人员的人脸。
|
||||
fields:
|
||||
person_id:
|
||||
name: 人员ID
|
||||
description: 人员ID。
|
||||
required: true
|
||||
example: "person_001"
|
||||
selector:
|
||||
text:
|
||||
face_id:
|
||||
name: 人脸ID
|
||||
description: 要删除的人脸ID。
|
||||
required: true
|
||||
example: "3440118425101275818"
|
||||
selector:
|
||||
text:
|
||||
config_entry_id:
|
||||
name: 配置项ID
|
||||
description: 使用的配置项ID(多配置时指定)。
|
||||
selector:
|
||||
text:
|
||||
|
||||
Reference in New Issue
Block a user