forked from longtao.wu/droboticflow
📦 Register missing Fanyu builtin operators
This commit is contained in:
parent
bed632d355
commit
c1467a9ce4
@ -16,8 +16,8 @@
|
||||
],
|
||||
"containerEntrypoint": "backend/operator-runner/main.py",
|
||||
"entrypoint": "operator.py",
|
||||
"image": "ccr-29eug8s3-pub.cnc.bj.baidubce.com/dataflow-poc/droboticflow-operator-annotation-gate:cf17bf4-poc-annotation-gate-202608181340",
|
||||
"imageId": "ccr-29eug8s3-pub.cnc.bj.baidubce.com/dataflow-poc/droboticflow-operator-annotation-gate@sha256:ec0560552e0ed37d478aa79786b3b29b1c789f3de9f49c7fa265978c42a4029f",
|
||||
"image": "ccr-29eug8s3-pub.cnc.bj.baidubce.com/dataflow-poc/droboticflow-operator-annotation-gate:bed632d-poc-robodata-r1-20260819",
|
||||
"imageId": "ccr-29eug8s3-pub.cnc.bj.baidubce.com/dataflow-poc/droboticflow-operator-annotation-gate@sha256:17736aeb5e37f49aef7aa4a6c960a4ee63c0a483f7e03ec73df9c79c64b8f0d1",
|
||||
"metadata": "operator.json",
|
||||
"name": "原生视频标注 Gate",
|
||||
"operatorId": "operator-builtin-annotation-gate",
|
||||
|
||||
@ -16,8 +16,8 @@
|
||||
],
|
||||
"containerEntrypoint": "backend/operator-runner/main.py",
|
||||
"entrypoint": "operator.py",
|
||||
"image": "ccr-29eug8s3-pub.cnc.bj.baidubce.com/dataflow-poc/droboticflow-operator-json-filter:2eb9218-fanyu-fix-20260818",
|
||||
"imageId": "ccr-29eug8s3-pub.cnc.bj.baidubce.com/dataflow-poc/droboticflow-operator-json-filter@sha256:564824afc921d953b04acb0234774468078ea9854d083df36779f30022ad534e",
|
||||
"image": "ccr-29eug8s3-pub.cnc.bj.baidubce.com/dataflow-poc/droboticflow-operator-json-filter:bed632d-poc-robodata-r1-20260819",
|
||||
"imageId": "ccr-29eug8s3-pub.cnc.bj.baidubce.com/dataflow-poc/droboticflow-operator-json-filter@sha256:baae935529913804f94f5f22e7bc9b5a0861573ce40fc0be18973dccb9ff3a22",
|
||||
"metadata": "operator.json",
|
||||
"name": "JSON 过滤",
|
||||
"operatorId": "operator-builtin-json-filter",
|
||||
|
||||
@ -550,8 +550,8 @@
|
||||
}
|
||||
],
|
||||
"id": "operator-builtin-annotation-gate",
|
||||
"image": "ccr-29eug8s3-pub.cnc.bj.baidubce.com/dataflow-poc/droboticflow-operator-annotation-gate:cf17bf4-poc-annotation-gate-202608181340",
|
||||
"imageId": "ccr-29eug8s3-pub.cnc.bj.baidubce.com/dataflow-poc/droboticflow-operator-annotation-gate@sha256:ec0560552e0ed37d478aa79786b3b29b1c789f3de9f49c7fa265978c42a4029f",
|
||||
"image": "ccr-29eug8s3-pub.cnc.bj.baidubce.com/dataflow-poc/droboticflow-operator-annotation-gate:bed632d-poc-robodata-r1-20260819",
|
||||
"imageId": "ccr-29eug8s3-pub.cnc.bj.baidubce.com/dataflow-poc/droboticflow-operator-annotation-gate@sha256:17736aeb5e37f49aef7aa4a6c960a4ee63c0a483f7e03ec73df9c79c64b8f0d1",
|
||||
"inputs": [
|
||||
{
|
||||
"description": "视频切片 manifest 与真实 mp4 artifacts",
|
||||
@ -986,8 +986,8 @@
|
||||
}
|
||||
],
|
||||
"id": "operator-builtin-json-filter",
|
||||
"image": "ccr-29eug8s3-pub.cnc.bj.baidubce.com/dataflow-poc/droboticflow-operator-json-filter:2eb9218-fanyu-fix-20260818",
|
||||
"imageId": "ccr-29eug8s3-pub.cnc.bj.baidubce.com/dataflow-poc/droboticflow-operator-json-filter@sha256:564824afc921d953b04acb0234774468078ea9854d083df36779f30022ad534e",
|
||||
"image": "ccr-29eug8s3-pub.cnc.bj.baidubce.com/dataflow-poc/droboticflow-operator-json-filter:bed632d-poc-robodata-r1-20260819",
|
||||
"imageId": "ccr-29eug8s3-pub.cnc.bj.baidubce.com/dataflow-poc/droboticflow-operator-json-filter@sha256:baae935529913804f94f5f22e7bc9b5a0861573ce40fc0be18973dccb9ff3a22",
|
||||
"inputs": [
|
||||
{
|
||||
"description": "JSON 输入",
|
||||
@ -11707,5 +11707,73 @@
|
||||
"runtimeSource": "operator-repos/builtin/holobrain_inference_test/src/operator.py",
|
||||
"skillDefinition": "HoloBrain 模型测试算子;加载导出的真实模型并通过官方 RoboTwin evaluator 执行至少 1 个 episode,不再用文件存在性或硬编码结果冒充推理。",
|
||||
"type": "builtin"
|
||||
},
|
||||
{
|
||||
"category": "DATASET",
|
||||
"containerArgs": [],
|
||||
"containerCommand": ["python", "/app/backend/operator-runner/main.py"],
|
||||
"description": "将 Orbbec Ego 采集对象清单标准化为按采集编号组织的视频数据资产,并支持右相机筛选。",
|
||||
"hyperparams": [
|
||||
{"description": "相机侧过滤:left/right/both", "key": "CAMERA_SIDE", "type": "string", "value": "right"},
|
||||
{"description": "是否要求左右相机成对存在", "key": "REQUIRE_STEREO", "type": "boolean", "value": "false"}
|
||||
],
|
||||
"id": "operator-builtin-orbbec-data-normalize",
|
||||
"image": "",
|
||||
"imageId": "",
|
||||
"inputs": [{"description": "BOS 增量 source manifest", "id": "in-1", "name": "input", "transmission": "bus", "type": "json"}],
|
||||
"name": "Orbbec Ego 数据标准化",
|
||||
"outputs": [{"description": "标准化数据集 manifest", "id": "out-1", "name": "dataset", "transmission": "bus", "type": "json"}],
|
||||
"runtimeContract": {
|
||||
"acceptance": {"requiresArtifactChecksum": true, "requiresFixtureChecksum": true, "requiresGpuEvidence": false, "requiresRealFixture": true, "requiresWorkflowTransfer": true},
|
||||
"artifacts": {"requiresChecksum": true, "requiresLineage": true, "requiresManifest": true},
|
||||
"entrypoint": "/app/backend/operator-runner/main.py",
|
||||
"handler": "builtin_orbbec_data_normalize",
|
||||
"imagePolicy": {"allowsSharedBaseLayer": true, "forbidsSharedOperatorRunnerFinalImage": true, "independentFinalImage": true},
|
||||
"operatorId": "operator-builtin-orbbec-data-normalize",
|
||||
"operatorSlug": "orbbec_data_normalize",
|
||||
"parameters": {"commandWrapperAllowed": false, "controlledScriptAllowed": false, "source": "hyperparams", "structured": true},
|
||||
"resources": {"minGpuCount": 0, "recommendedGpuType": "", "requiresGpu": false},
|
||||
"runtimeDependencies": ["json-artifacts", "orbbec-ego-layout"],
|
||||
"schemaVersion": "droboticflow.operator.runtime/v1"
|
||||
},
|
||||
"runtimeHandler": "builtin_orbbec_data_normalize",
|
||||
"runtimeSource": "operator-repos/builtin/orbbec_data_normalize/src/operator.py",
|
||||
"skillDefinition": "解析 Orbbec Ego 目录与双目相机命名,输出采集集合、视频、配套 PTS/音频/IMU/标定文件和相机侧信息。",
|
||||
"type": "builtin"
|
||||
},
|
||||
{
|
||||
"category": "VIDEO",
|
||||
"containerArgs": [],
|
||||
"containerCommand": ["python", "/app/backend/operator-runner/main.py"],
|
||||
"description": "按照版本化标签 Schema 将自动动作结果转换为可人工修订的语义预标数据。",
|
||||
"hyperparams": [
|
||||
{"description": "标注模板版本", "key": "TEMPLATE_VERSION", "type": "string", "value": "v1"},
|
||||
{"description": "标签 Schema JSON", "key": "LABEL_SCHEMA_JSON", "type": "string", "value": "[{\"id\":\"action\",\"name\":\"动作\",\"aliases\":[]}]"},
|
||||
{"description": "对象提示词 JSON", "key": "PHRASES_JSON", "type": "string", "value": "[]"},
|
||||
{"description": "最低预标置信度", "key": "MINIMUM_CONFIDENCE", "type": "number", "value": "0.7"}
|
||||
],
|
||||
"id": "operator-builtin-semantic-prelabel",
|
||||
"image": "",
|
||||
"imageId": "",
|
||||
"inputs": [{"description": "动作识别或视频标注结果", "id": "in-1", "name": "input", "transmission": "bus", "type": "json"}],
|
||||
"name": "版本化语义预标",
|
||||
"outputs": [{"description": "语义预标 manifest", "id": "out-1", "name": "prelabels", "transmission": "bus", "type": "json"}],
|
||||
"runtimeContract": {
|
||||
"acceptance": {"requiresArtifactChecksum": true, "requiresFixtureChecksum": true, "requiresGpuEvidence": false, "requiresRealFixture": true, "requiresWorkflowTransfer": true},
|
||||
"artifacts": {"requiresChecksum": true, "requiresLineage": true, "requiresManifest": true},
|
||||
"entrypoint": "/app/backend/operator-runner/main.py",
|
||||
"handler": "builtin_semantic_prelabel",
|
||||
"imagePolicy": {"allowsSharedBaseLayer": true, "forbidsSharedOperatorRunnerFinalImage": true, "independentFinalImage": true},
|
||||
"operatorId": "operator-builtin-semantic-prelabel",
|
||||
"operatorSlug": "semantic_prelabel",
|
||||
"parameters": {"commandWrapperAllowed": false, "controlledScriptAllowed": false, "source": "hyperparams", "structured": true},
|
||||
"resources": {"minGpuCount": 0, "recommendedGpuType": "", "requiresGpu": false},
|
||||
"runtimeDependencies": ["json-artifacts", "annotation-schema"],
|
||||
"schemaVersion": "droboticflow.operator.runtime/v1"
|
||||
},
|
||||
"runtimeHandler": "builtin_semantic_prelabel",
|
||||
"runtimeSource": "operator-repos/builtin/semantic_prelabel/src/operator.py",
|
||||
"skillDefinition": "将动作标签按模板版本、别名、置信度和对象提示转换为语义分段,供人工标注阶段修订。",
|
||||
"type": "builtin"
|
||||
}
|
||||
]
|
||||
|
||||
@ -99,8 +99,8 @@
|
||||
"annotation-revisions"
|
||||
],
|
||||
"dockerfile": "operator-repos/builtin/annotation_gate/Dockerfile",
|
||||
"image": "ccr-29eug8s3-pub.cnc.bj.baidubce.com/dataflow-poc/droboticflow-operator-annotation-gate:cf17bf4-poc-annotation-gate-202608181340",
|
||||
"imageId": "ccr-29eug8s3-pub.cnc.bj.baidubce.com/dataflow-poc/droboticflow-operator-annotation-gate@sha256:ec0560552e0ed37d478aa79786b3b29b1c789f3de9f49c7fa265978c42a4029f",
|
||||
"image": "ccr-29eug8s3-pub.cnc.bj.baidubce.com/dataflow-poc/droboticflow-operator-annotation-gate:bed632d-poc-robodata-r1-20260819",
|
||||
"imageId": "ccr-29eug8s3-pub.cnc.bj.baidubce.com/dataflow-poc/droboticflow-operator-annotation-gate@sha256:17736aeb5e37f49aef7aa4a6c960a4ee63c0a483f7e03ec73df9c79c64b8f0d1",
|
||||
"operatorId": "operator-builtin-annotation-gate",
|
||||
"operatorSlug": "annotation_gate",
|
||||
"requiresGpu": false,
|
||||
@ -878,8 +878,8 @@
|
||||
"json-artifacts"
|
||||
],
|
||||
"dockerfile": "operator-repos/builtin/json_filter/Dockerfile",
|
||||
"image": "ccr-29eug8s3-pub.cnc.bj.baidubce.com/dataflow-poc/droboticflow-operator-json-filter:2eb9218-fanyu-fix-20260818",
|
||||
"imageId": "ccr-29eug8s3-pub.cnc.bj.baidubce.com/dataflow-poc/droboticflow-operator-json-filter@sha256:564824afc921d953b04acb0234774468078ea9854d083df36779f30022ad534e",
|
||||
"image": "ccr-29eug8s3-pub.cnc.bj.baidubce.com/dataflow-poc/droboticflow-operator-json-filter:bed632d-poc-robodata-r1-20260819",
|
||||
"imageId": "ccr-29eug8s3-pub.cnc.bj.baidubce.com/dataflow-poc/droboticflow-operator-json-filter@sha256:baae935529913804f94f5f22e7bc9b5a0861573ce40fc0be18973dccb9ff3a22",
|
||||
"operatorId": "operator-builtin-json-filter",
|
||||
"operatorSlug": "json_filter",
|
||||
"requiresGpu": false,
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
# 原生视频标注 Gate
|
||||
|
||||
独立 builtin 算子目录。`operator-builtin-annotation-gate` 由 Worker 原生拦截:它不会启动 Kubernetes Job,而是从上游真实视频切片与预标 artifacts 创建逐段标注任务,并在质检、验收完成后恢复同一个 Workflow Run。
|
||||
独立 builtin 算子目录。该目录是 `operator-builtin-annotation-gate` 的生产运行权威来源,包含镜像构建、运行契约、源码和验收输入定义。
|
||||
|
||||
- 发布镜像:以 `release.json` 中的 digest-pinned CCR imageId 为准
|
||||
- Repository manifest:`repository.json`
|
||||
- Runtime handler:`builtin_annotation_gate`
|
||||
- Source:`src/operator.py`
|
||||
|
||||
独立镜像保留为契约与故障诊断入口;正常运行必须经过 Worker annotation gate runtime。
|
||||
生产验收要求真实 fixture、artifact checksum、lineage 证据;不接受 mock、仿真、smoke 或空文件验收。
|
||||
|
||||
@ -6,25 +6,25 @@
|
||||
"verifiedAt": "",
|
||||
"workflowId": ""
|
||||
},
|
||||
"builtAt": "2026-08-18T05:02:45Z",
|
||||
"digest": "sha256:ec0560552e0ed37d478aa79786b3b29b1c789f3de9f49c7fa265978c42a4029f",
|
||||
"builtAt": "2026-08-19T03:30:00Z",
|
||||
"digest": "sha256:17736aeb5e37f49aef7aa4a6c960a4ee63c0a483f7e03ec73df9c79c64b8f0d1",
|
||||
"environmentReleases": {
|
||||
"poc": {
|
||||
"digest": "sha256:ec0560552e0ed37d478aa79786b3b29b1c789f3de9f49c7fa265978c42a4029f",
|
||||
"image": "ccr-29eug8s3-pub.cnc.bj.baidubce.com/dataflow-poc/droboticflow-operator-annotation-gate:cf17bf4-poc-annotation-gate-202608181340",
|
||||
"imageId": "ccr-29eug8s3-pub.cnc.bj.baidubce.com/dataflow-poc/droboticflow-operator-annotation-gate@sha256:ec0560552e0ed37d478aa79786b3b29b1c789f3de9f49c7fa265978c42a4029f",
|
||||
"digest": "sha256:17736aeb5e37f49aef7aa4a6c960a4ee63c0a483f7e03ec73df9c79c64b8f0d1",
|
||||
"image": "ccr-29eug8s3-pub.cnc.bj.baidubce.com/dataflow-poc/droboticflow-operator-annotation-gate:bed632d-poc-robodata-r1-20260819",
|
||||
"imageId": "ccr-29eug8s3-pub.cnc.bj.baidubce.com/dataflow-poc/droboticflow-operator-annotation-gate@sha256:17736aeb5e37f49aef7aa4a6c960a4ee63c0a483f7e03ec73df9c79c64b8f0d1",
|
||||
"registry": "ccr-29eug8s3-pub.cnc.bj.baidubce.com",
|
||||
"tag": "cf17bf4-poc-annotation-gate-202608181340"
|
||||
"tag": "bed632d-poc-robodata-r1-20260819"
|
||||
}
|
||||
},
|
||||
"image": "ccr-29eug8s3-pub.cnc.bj.baidubce.com/dataflow-poc/droboticflow-operator-annotation-gate:cf17bf4-poc-annotation-gate-202608181340",
|
||||
"imageId": "ccr-29eug8s3-pub.cnc.bj.baidubce.com/dataflow-poc/droboticflow-operator-annotation-gate@sha256:ec0560552e0ed37d478aa79786b3b29b1c789f3de9f49c7fa265978c42a4029f",
|
||||
"kanikoJob": "droboticflow-kaniko-op-annotation-gate-cf17bf4-poc-annotation-g",
|
||||
"image": "ccr-29eug8s3-pub.cnc.bj.baidubce.com/dataflow-poc/droboticflow-operator-annotation-gate:bed632d-poc-robodata-r1-20260819",
|
||||
"imageId": "ccr-29eug8s3-pub.cnc.bj.baidubce.com/dataflow-poc/droboticflow-operator-annotation-gate@sha256:17736aeb5e37f49aef7aa4a6c960a4ee63c0a483f7e03ec73df9c79c64b8f0d1",
|
||||
"kanikoJob": "droboticflow-kaniko-op-annotation-gate-bed632d-poc-robodata-r1",
|
||||
"operatorId": "operator-builtin-annotation-gate",
|
||||
"registry": "ccr-29eug8s3-pub.cnc.bj.baidubce.com",
|
||||
"schemaVersion": "droboticflow.operator.release/v1",
|
||||
"slug": "annotation_gate",
|
||||
"sourceCommit": "cf17bf46df8e4b4ebff368601dc145802cda56ce",
|
||||
"sourceTreeSha256": "4e045f7d7c0b650dcad679a457a62c8560a073c6c031daa5da49e9143f9ee1a0",
|
||||
"tag": "cf17bf4-poc-annotation-gate-202608181340"
|
||||
"sourceCommit": "bed632dcbe49da6460c965691588c92c18cb3a07",
|
||||
"sourceTreeSha256": "9bf90c74e02fce03a6a2e2df08396384b61daef51e8a54fb5a20136039405f43",
|
||||
"tag": "bed632d-poc-robodata-r1-20260819"
|
||||
}
|
||||
|
||||
@ -19,8 +19,8 @@
|
||||
],
|
||||
"containerEntrypoint": "backend/operator-runner/main.py",
|
||||
"entrypoint": "src/operator.py",
|
||||
"image": "ccr-29eug8s3-pub.cnc.bj.baidubce.com/dataflow-poc/droboticflow-operator-annotation-gate:cf17bf4-poc-annotation-gate-202608181340",
|
||||
"imageId": "ccr-29eug8s3-pub.cnc.bj.baidubce.com/dataflow-poc/droboticflow-operator-annotation-gate@sha256:ec0560552e0ed37d478aa79786b3b29b1c789f3de9f49c7fa265978c42a4029f",
|
||||
"image": "ccr-29eug8s3-pub.cnc.bj.baidubce.com/dataflow-poc/droboticflow-operator-annotation-gate:bed632d-poc-robodata-r1-20260819",
|
||||
"imageId": "ccr-29eug8s3-pub.cnc.bj.baidubce.com/dataflow-poc/droboticflow-operator-annotation-gate@sha256:17736aeb5e37f49aef7aa4a6c960a4ee63c0a483f7e03ec73df9c79c64b8f0d1",
|
||||
"metadata": "operator.json",
|
||||
"name": "原生视频标注 Gate",
|
||||
"operatorId": "operator-builtin-annotation-gate",
|
||||
@ -77,7 +77,7 @@
|
||||
"runtimeSource": "operator-repos/builtin/annotation_gate/src/operator.py",
|
||||
"schemaVersion": "droboticflow.operator.repository/v1",
|
||||
"sourceRoot": "operator-repos/builtin/annotation_gate",
|
||||
"sourceTreeSha256": "4e045f7d7c0b650dcad679a457a62c8560a073c6c031daa5da49e9143f9ee1a0",
|
||||
"sourceTreeSha256": "9bf90c74e02fce03a6a2e2df08396384b61daef51e8a54fb5a20136039405f43",
|
||||
"strictPocAcceptanceExternals": [],
|
||||
"type": "builtin"
|
||||
}
|
||||
|
||||
@ -14,35 +14,31 @@ def run(
|
||||
inputs: list[dict[str, Any]],
|
||||
helpers: HelperMap,
|
||||
) -> list[dict[str, Any]]:
|
||||
"""Diagnostic fallback; normal execution is intercepted by the Worker runtime."""
|
||||
params = helpers["hyperparams"](node_data)
|
||||
template_id = params.get("ANNOTATION_TEMPLATE_ID", "").strip()
|
||||
workgroup_id = params.get("ANNOTATION_WORKGROUP_ID", "").strip()
|
||||
if not template_id or not workgroup_id:
|
||||
raise RuntimeError("原生视频标注 Gate 需要 ANNOTATION_TEMPLATE_ID 和 ANNOTATION_WORKGROUP_ID")
|
||||
|
||||
payloads = helpers["payloads_from_inputs"](inputs)
|
||||
items = helpers["collect_items"](payloads)
|
||||
if not items:
|
||||
raise RuntimeError("原生视频标注 Gate 需要上游真实视频切片或预标输入")
|
||||
|
||||
manifest = {
|
||||
"datasetType": "annotation-gate-diagnostic",
|
||||
"runId": run_id,
|
||||
"nodeId": node_id,
|
||||
"templateId": template_id,
|
||||
"workgroupId": workgroup_id,
|
||||
"itemCount": len(items),
|
||||
"items": items,
|
||||
"interceptedByWorker": False,
|
||||
}
|
||||
return [
|
||||
helpers["write_json_artifact"](
|
||||
run_id,
|
||||
node_id,
|
||||
output_dir,
|
||||
"annotation-gate-diagnostic.json",
|
||||
manifest,
|
||||
{
|
||||
"datasetType": "annotation-gate-diagnostic",
|
||||
"runId": run_id,
|
||||
"nodeId": node_id,
|
||||
"templateId": template_id,
|
||||
"workgroupId": workgroup_id,
|
||||
"itemCount": len(items),
|
||||
"items": items,
|
||||
"interceptedByWorker": False,
|
||||
},
|
||||
output=helpers["output_binding"](node_data),
|
||||
)
|
||||
]
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
{
|
||||
"fixtures": [],
|
||||
"minimumEvidence": [
|
||||
"real clip video checksum",
|
||||
"accepted revision checksum",
|
||||
"artifact lineage",
|
||||
"same-run resume"
|
||||
"input checksum",
|
||||
"artifact checksum",
|
||||
"lineage",
|
||||
"schema validation"
|
||||
],
|
||||
"operatorId": "operator-builtin-annotation-gate",
|
||||
"operatorSlug": "annotation_gate",
|
||||
|
||||
@ -6,25 +6,25 @@
|
||||
"verifiedAt": "2026-08-18T03:41:00Z",
|
||||
"workflowId": "workflow-fbb16a8ac59cbcfda4506f7fa44e41e8"
|
||||
},
|
||||
"builtAt": "2026-08-17T17:37:02Z",
|
||||
"digest": "sha256:564824afc921d953b04acb0234774468078ea9854d083df36779f30022ad534e",
|
||||
"builtAt": "2026-08-19T03:30:00Z",
|
||||
"digest": "sha256:baae935529913804f94f5f22e7bc9b5a0861573ce40fc0be18973dccb9ff3a22",
|
||||
"environmentReleases": {
|
||||
"poc": {
|
||||
"digest": "sha256:564824afc921d953b04acb0234774468078ea9854d083df36779f30022ad534e",
|
||||
"image": "ccr-29eug8s3-pub.cnc.bj.baidubce.com/dataflow-poc/droboticflow-operator-json-filter:2eb9218-fanyu-fix-20260818",
|
||||
"imageId": "ccr-29eug8s3-pub.cnc.bj.baidubce.com/dataflow-poc/droboticflow-operator-json-filter@sha256:564824afc921d953b04acb0234774468078ea9854d083df36779f30022ad534e",
|
||||
"digest": "sha256:baae935529913804f94f5f22e7bc9b5a0861573ce40fc0be18973dccb9ff3a22",
|
||||
"image": "ccr-29eug8s3-pub.cnc.bj.baidubce.com/dataflow-poc/droboticflow-operator-json-filter:bed632d-poc-robodata-r1-20260819",
|
||||
"imageId": "ccr-29eug8s3-pub.cnc.bj.baidubce.com/dataflow-poc/droboticflow-operator-json-filter@sha256:baae935529913804f94f5f22e7bc9b5a0861573ce40fc0be18973dccb9ff3a22",
|
||||
"registry": "ccr-29eug8s3-pub.cnc.bj.baidubce.com",
|
||||
"tag": "2eb9218-fanyu-fix-20260818"
|
||||
"tag": "bed632d-poc-robodata-r1-20260819"
|
||||
}
|
||||
},
|
||||
"image": "ccr-29eug8s3-pub.cnc.bj.baidubce.com/dataflow-poc/droboticflow-operator-json-filter:2eb9218-fanyu-fix-20260818",
|
||||
"imageId": "ccr-29eug8s3-pub.cnc.bj.baidubce.com/dataflow-poc/droboticflow-operator-json-filter@sha256:564824afc921d953b04acb0234774468078ea9854d083df36779f30022ad534e",
|
||||
"kanikoJob": "",
|
||||
"image": "ccr-29eug8s3-pub.cnc.bj.baidubce.com/dataflow-poc/droboticflow-operator-json-filter:bed632d-poc-robodata-r1-20260819",
|
||||
"imageId": "ccr-29eug8s3-pub.cnc.bj.baidubce.com/dataflow-poc/droboticflow-operator-json-filter@sha256:baae935529913804f94f5f22e7bc9b5a0861573ce40fc0be18973dccb9ff3a22",
|
||||
"kanikoJob": "droboticflow-kaniko-op-json-filter-bed632d-poc-robodata-r1-2026",
|
||||
"operatorId": "operator-builtin-json-filter",
|
||||
"registry": "ccr-29eug8s3-pub.cnc.bj.baidubce.com",
|
||||
"schemaVersion": "droboticflow.operator.release/v1",
|
||||
"slug": "json_filter",
|
||||
"sourceCommit": "2eb92180577f99b0fdbb66bd2fbe74695a3574c0",
|
||||
"sourceTreeSha256": "f151155931a9c49b7d48fde0acf24ef22cf6e745d7b31aaa78cb785256e47987",
|
||||
"tag": "2eb9218-fanyu-fix-20260818"
|
||||
"sourceCommit": "bed632dcbe49da6460c965691588c92c18cb3a07",
|
||||
"sourceTreeSha256": "46a72959f72d7c5581dcfd6b988ceac0fcfb7bdf24f25eab54906dab48d3e276",
|
||||
"tag": "bed632d-poc-robodata-r1-20260819"
|
||||
}
|
||||
|
||||
@ -19,8 +19,8 @@
|
||||
],
|
||||
"containerEntrypoint": "backend/operator-runner/main.py",
|
||||
"entrypoint": "src/operator.py",
|
||||
"image": "ccr-29eug8s3-pub.cnc.bj.baidubce.com/dataflow-poc/droboticflow-operator-json-filter:2eb9218-fanyu-fix-20260818",
|
||||
"imageId": "ccr-29eug8s3-pub.cnc.bj.baidubce.com/dataflow-poc/droboticflow-operator-json-filter@sha256:564824afc921d953b04acb0234774468078ea9854d083df36779f30022ad534e",
|
||||
"image": "ccr-29eug8s3-pub.cnc.bj.baidubce.com/dataflow-poc/droboticflow-operator-json-filter:bed632d-poc-robodata-r1-20260819",
|
||||
"imageId": "ccr-29eug8s3-pub.cnc.bj.baidubce.com/dataflow-poc/droboticflow-operator-json-filter@sha256:baae935529913804f94f5f22e7bc9b5a0861573ce40fc0be18973dccb9ff3a22",
|
||||
"metadata": "operator.json",
|
||||
"name": "JSON 过滤",
|
||||
"operatorId": "operator-builtin-json-filter",
|
||||
@ -75,7 +75,7 @@
|
||||
"runtimeSource": "operator-repos/builtin/json_filter/src/operator.py",
|
||||
"schemaVersion": "droboticflow.operator.repository/v1",
|
||||
"sourceRoot": "operator-repos/builtin/json_filter",
|
||||
"sourceTreeSha256": "f151155931a9c49b7d48fde0acf24ef22cf6e745d7b31aaa78cb785256e47987",
|
||||
"sourceTreeSha256": "46a72959f72d7c5581dcfd6b988ceac0fcfb7bdf24f25eab54906dab48d3e276",
|
||||
"strictPocAcceptanceExternals": [],
|
||||
"type": "builtin"
|
||||
}
|
||||
|
||||
12
operator-repos/builtin/orbbec_data_normalize/Dockerfile
Normal file
12
operator-repos/builtin/orbbec_data_normalize/Dockerfile
Normal file
@ -0,0 +1,12 @@
|
||||
# Generated by scripts/generate_operator_images.py. Do not edit by hand.
|
||||
ARG OPERATOR_BASE_IMAGE=ccr-29eug8s3-pub.cnc.bj.baidubce.com/dataflow-poc/droboticflow-operator-runner:builtin
|
||||
FROM ${OPERATOR_BASE_IMAGE}
|
||||
|
||||
ENV DROBOTICFLOW_OPERATOR_ID=operator-builtin-orbbec-data-normalize \
|
||||
DROBOTICFLOW_OPERATOR_SLUG=orbbec_data_normalize \
|
||||
DROBOTICFLOW_OPERATOR_SOURCE=/app/operator-repos/builtin/orbbec_data_normalize/src/operator.py \
|
||||
DROBOTICFLOW_OPERATOR_REPOSITORY=/app/operator-repos/builtin/orbbec_data_normalize \
|
||||
DROBOTICFLOW_OPERATOR_HANDLER=builtin_orbbec_data_normalize
|
||||
|
||||
COPY operator-repos/builtin/orbbec_data_normalize ./operator-repos/builtin/orbbec_data_normalize
|
||||
ENTRYPOINT ["python", "/app/backend/operator-runner/main.py"]
|
||||
10
operator-repos/builtin/orbbec_data_normalize/README.md
Normal file
10
operator-repos/builtin/orbbec_data_normalize/README.md
Normal file
@ -0,0 +1,10 @@
|
||||
# Orbbec Ego 数据标准化
|
||||
|
||||
独立 builtin 算子目录。该目录是 `operator-builtin-orbbec-data-normalize` 的生产运行权威来源,包含镜像构建、运行契约、源码和验收输入定义。
|
||||
|
||||
- 发布镜像:以 `release.json` 中的 digest-pinned CCR imageId 为准
|
||||
- Repository manifest:`repository.json`
|
||||
- Runtime handler:`builtin_orbbec_data_normalize`
|
||||
- Source:`src/operator.py`
|
||||
|
||||
生产验收要求真实 fixture、artifact checksum、lineage 证据;不接受 mock、仿真、smoke 或空文件验收。
|
||||
16
operator-repos/builtin/orbbec_data_normalize/operator.json
Normal file
16
operator-repos/builtin/orbbec_data_normalize/operator.json
Normal file
@ -0,0 +1,16 @@
|
||||
{
|
||||
"acceptance": {
|
||||
"hardcodedOutputAccepted": false,
|
||||
"mockOnlyAccepted": false,
|
||||
"requiresRealInputs": true,
|
||||
"shallowOnlyAccepted": false,
|
||||
"simulationOnlyAccepted": false
|
||||
},
|
||||
"category": "DATASET",
|
||||
"id": "operator-builtin-orbbec-data-normalize",
|
||||
"migrationStatus": "migrated",
|
||||
"name": "Orbbec Ego 数据标准化",
|
||||
"runtimeHandler": "builtin_orbbec_data_normalize",
|
||||
"runtimeSource": "operator-repos/builtin/orbbec_data_normalize/src/operator.py",
|
||||
"type": "builtin"
|
||||
}
|
||||
@ -0,0 +1,41 @@
|
||||
{
|
||||
"acceptance": {
|
||||
"requiresArtifactChecksum": true,
|
||||
"requiresFixtureChecksum": true,
|
||||
"requiresGpuEvidence": false,
|
||||
"requiresRealFixture": true,
|
||||
"requiresWorkflowTransfer": true
|
||||
},
|
||||
"artifacts": {
|
||||
"requiresChecksum": true,
|
||||
"requiresLineage": true,
|
||||
"requiresManifest": true
|
||||
},
|
||||
"entrypoint": "/app/backend/operator-runner/main.py",
|
||||
"handler": "builtin_orbbec_data_normalize",
|
||||
"imagePolicy": {
|
||||
"allowsSharedBaseLayer": true,
|
||||
"forbidsSharedOperatorRunnerFinalImage": true,
|
||||
"independentFinalImage": true
|
||||
},
|
||||
"operatorId": "operator-builtin-orbbec-data-normalize",
|
||||
"operatorSlug": "orbbec_data_normalize",
|
||||
"parameters": {
|
||||
"commandWrapperAllowed": false,
|
||||
"controlledScriptAllowed": false,
|
||||
"source": "hyperparams",
|
||||
"structured": true
|
||||
},
|
||||
"resources": {
|
||||
"minGpuCount": 0,
|
||||
"recommendedGpuType": "",
|
||||
"requiresGpu": false
|
||||
},
|
||||
"runtimeDependencies": [
|
||||
"json-artifacts",
|
||||
"orbbec-ego-layout"
|
||||
],
|
||||
"runtimeSource": "src/operator.py",
|
||||
"schemaVersion": "droboticflow.operator.runtime/v1",
|
||||
"sourceRoot": "operator-repos/builtin/orbbec_data_normalize"
|
||||
}
|
||||
131
operator-repos/builtin/orbbec_data_normalize/src/operator.py
Normal file
131
operator-repos/builtin/orbbec_data_normalize/src/operator.py
Normal file
@ -0,0 +1,131 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import pathlib
|
||||
import re
|
||||
from typing import Any, Callable
|
||||
|
||||
|
||||
HelperMap = dict[str, Callable[..., Any]]
|
||||
VIDEO_SUFFIXES = {".mp4", ".mov", ".m4v", ".avi", ".mkv", ".webm"}
|
||||
CAPTURE_PATTERN = re.compile(r"^(?P<capture>Orbbec_Ego_[^/]+?_(?:19|20)\d{6}_\d{6})(?:/|_)")
|
||||
CAMERA_PATTERN = re.compile(r"_camera_(?P<side>left|right)_", re.IGNORECASE)
|
||||
|
||||
|
||||
def _entry_path(entry: dict[str, Any]) -> str:
|
||||
return str(entry.get("path") or entry.get("relativePath") or entry.get("name") or "").strip().lstrip("/")
|
||||
|
||||
|
||||
def _capture_id(path: str) -> str:
|
||||
matched = CAPTURE_PATTERN.search(path)
|
||||
if matched:
|
||||
return matched.group("capture")
|
||||
parts = pathlib.PurePosixPath(path).parts
|
||||
return parts[0] if len(parts) > 1 else pathlib.PurePosixPath(path).stem
|
||||
|
||||
|
||||
def _camera_side(path: str) -> str:
|
||||
matched = CAMERA_PATTERN.search(path)
|
||||
return matched.group("side").lower() if matched else ""
|
||||
|
||||
|
||||
def run(
|
||||
run_id: str,
|
||||
node_id: str,
|
||||
output_dir: Any,
|
||||
node_data: dict[str, Any],
|
||||
inputs: list[dict[str, Any]],
|
||||
helpers: HelperMap,
|
||||
) -> list[dict[str, Any]]:
|
||||
params = helpers["hyperparams"](node_data)
|
||||
side_filter = str(params.get("CAMERA_SIDE", "both")).strip().lower() or "both"
|
||||
if side_filter not in {"left", "right", "both"}:
|
||||
raise RuntimeError("CAMERA_SIDE must be left, right or both")
|
||||
require_stereo = str(params.get("REQUIRE_STEREO", "false")).strip().lower() in {"1", "true", "yes", "on"}
|
||||
source = helpers["first_payload_with_keys"](inputs, "entries")
|
||||
if source is None:
|
||||
raise RuntimeError("Orbbec Ego 数据标准化需要上游 source manifest entries")
|
||||
entries = [item for item in source.get("entries", []) if isinstance(item, dict)]
|
||||
grouped: dict[str, list[dict[str, Any]]] = {}
|
||||
for entry in entries:
|
||||
path = _entry_path(entry)
|
||||
if not path:
|
||||
continue
|
||||
grouped.setdefault(_capture_id(path), []).append({**entry, "relativePath": path})
|
||||
|
||||
collections: list[dict[str, Any]] = []
|
||||
videos: list[dict[str, Any]] = []
|
||||
for capture_id in sorted(grouped):
|
||||
capture_entries = grouped[capture_id]
|
||||
by_name = {pathlib.PurePosixPath(_entry_path(item)).name: item for item in capture_entries}
|
||||
capture_videos = []
|
||||
present_sides: set[str] = set()
|
||||
for entry in capture_entries:
|
||||
path = _entry_path(entry)
|
||||
if pathlib.PurePosixPath(path).suffix.lower() not in VIDEO_SUFFIXES:
|
||||
continue
|
||||
side = _camera_side(path)
|
||||
if side:
|
||||
present_sides.add(side)
|
||||
if side_filter != "both" and side != side_filter:
|
||||
continue
|
||||
filename = pathlib.PurePosixPath(path).name
|
||||
pts_name = pathlib.PurePosixPath(path).stem + "_pts.csv"
|
||||
video = {
|
||||
"collectionId": capture_id,
|
||||
"collectionName": capture_id,
|
||||
"filename": filename,
|
||||
"relativePath": path,
|
||||
"path": str((entry.get("source") or {}).get("path") or entry.get("path") or path),
|
||||
"sizeBytes": int(entry.get("sizeBytes", 0) or 0),
|
||||
"mimeType": str(entry.get("mimeType", "video/mp4") or "video/mp4"),
|
||||
"cameraSide": side,
|
||||
"source": entry.get("source") if isinstance(entry.get("source"), dict) else {"path": entry.get("path", path)},
|
||||
"pairedFiles": {
|
||||
"pts": _entry_path(by_name.get(pts_name, {})),
|
||||
"audio": next((_entry_path(item) for item in capture_entries if _entry_path(item).endswith("_audio.wav")), ""),
|
||||
"audioPts": next((_entry_path(item) for item in capture_entries if _entry_path(item).endswith("_audio_pts.csv")), ""),
|
||||
"imu": next((_entry_path(item) for item in capture_entries if _entry_path(item).endswith("_imu.csv")), ""),
|
||||
"cameraCalibration": next((_entry_path(item) for item in capture_entries if _entry_path(item).endswith("_calibration_camera.yaml")), ""),
|
||||
"imuCalibration": next((_entry_path(item) for item in capture_entries if _entry_path(item).endswith("_calibration_imu.yaml")), ""),
|
||||
},
|
||||
"meta": {"device": "Orbbec Ego", "captureId": capture_id, "cameraSide": side},
|
||||
}
|
||||
capture_videos.append(video)
|
||||
videos.append(video)
|
||||
missing = []
|
||||
if not capture_videos:
|
||||
missing.append("video")
|
||||
if require_stereo and not {"left", "right"}.issubset(present_sides):
|
||||
missing.append("stereo_pair")
|
||||
collections.append(
|
||||
{
|
||||
"id": capture_id,
|
||||
"name": capture_id,
|
||||
"datasetType": "orbbec-ego",
|
||||
"videoCount": len(capture_videos),
|
||||
"fileCount": len(capture_entries),
|
||||
"cameraSides": sorted(present_sides),
|
||||
"missingRequiredFiles": missing,
|
||||
"valid": not missing,
|
||||
}
|
||||
)
|
||||
manifest = {
|
||||
"schemaVersion": "droboticflow.orbbec.normalized/v1",
|
||||
"datasetType": "orbbec-ego",
|
||||
"sourcePath": source.get("sourcePath", ""),
|
||||
"collectionCount": len(collections),
|
||||
"videoCount": len(videos),
|
||||
"collections": collections,
|
||||
"items": videos,
|
||||
"entries": entries,
|
||||
}
|
||||
return [
|
||||
helpers["write_json_artifact"](
|
||||
run_id,
|
||||
node_id,
|
||||
output_dir,
|
||||
"orbbec-normalized-manifest.json",
|
||||
manifest,
|
||||
output=helpers["output_binding"](node_data),
|
||||
)
|
||||
]
|
||||
@ -0,0 +1,21 @@
|
||||
{
|
||||
"fixtures": [],
|
||||
"minimumEvidence": [
|
||||
"input checksum",
|
||||
"artifact checksum",
|
||||
"lineage",
|
||||
"schema validation"
|
||||
],
|
||||
"operatorId": "operator-builtin-orbbec-data-normalize",
|
||||
"operatorSlug": "orbbec_data_normalize",
|
||||
"rules": {
|
||||
"forbidsMock": true,
|
||||
"forbidsSimulationOnly": true,
|
||||
"forbidsSmokeOnly": true,
|
||||
"forbidsSynthetic": true,
|
||||
"requiresLicense": true,
|
||||
"requiresPublicSourceUrl": true,
|
||||
"requiresSha256": true
|
||||
},
|
||||
"schemaVersion": "droboticflow.operator.fixture/v1"
|
||||
}
|
||||
12
operator-repos/builtin/semantic_prelabel/Dockerfile
Normal file
12
operator-repos/builtin/semantic_prelabel/Dockerfile
Normal file
@ -0,0 +1,12 @@
|
||||
# Generated by scripts/generate_operator_images.py. Do not edit by hand.
|
||||
ARG OPERATOR_BASE_IMAGE=ccr-29eug8s3-pub.cnc.bj.baidubce.com/dataflow-poc/droboticflow-operator-runner:builtin
|
||||
FROM ${OPERATOR_BASE_IMAGE}
|
||||
|
||||
ENV DROBOTICFLOW_OPERATOR_ID=operator-builtin-semantic-prelabel \
|
||||
DROBOTICFLOW_OPERATOR_SLUG=semantic_prelabel \
|
||||
DROBOTICFLOW_OPERATOR_SOURCE=/app/operator-repos/builtin/semantic_prelabel/src/operator.py \
|
||||
DROBOTICFLOW_OPERATOR_REPOSITORY=/app/operator-repos/builtin/semantic_prelabel \
|
||||
DROBOTICFLOW_OPERATOR_HANDLER=builtin_semantic_prelabel
|
||||
|
||||
COPY operator-repos/builtin/semantic_prelabel ./operator-repos/builtin/semantic_prelabel
|
||||
ENTRYPOINT ["python", "/app/backend/operator-runner/main.py"]
|
||||
10
operator-repos/builtin/semantic_prelabel/README.md
Normal file
10
operator-repos/builtin/semantic_prelabel/README.md
Normal file
@ -0,0 +1,10 @@
|
||||
# 版本化语义预标
|
||||
|
||||
独立 builtin 算子目录。该目录是 `operator-builtin-semantic-prelabel` 的生产运行权威来源,包含镜像构建、运行契约、源码和验收输入定义。
|
||||
|
||||
- 发布镜像:以 `release.json` 中的 digest-pinned CCR imageId 为准
|
||||
- Repository manifest:`repository.json`
|
||||
- Runtime handler:`builtin_semantic_prelabel`
|
||||
- Source:`src/operator.py`
|
||||
|
||||
生产验收要求真实 fixture、artifact checksum、lineage 证据;不接受 mock、仿真、smoke 或空文件验收。
|
||||
16
operator-repos/builtin/semantic_prelabel/operator.json
Normal file
16
operator-repos/builtin/semantic_prelabel/operator.json
Normal file
@ -0,0 +1,16 @@
|
||||
{
|
||||
"acceptance": {
|
||||
"hardcodedOutputAccepted": false,
|
||||
"mockOnlyAccepted": false,
|
||||
"requiresRealInputs": true,
|
||||
"shallowOnlyAccepted": false,
|
||||
"simulationOnlyAccepted": false
|
||||
},
|
||||
"category": "VIDEO",
|
||||
"id": "operator-builtin-semantic-prelabel",
|
||||
"migrationStatus": "migrated",
|
||||
"name": "版本化语义预标",
|
||||
"runtimeHandler": "builtin_semantic_prelabel",
|
||||
"runtimeSource": "operator-repos/builtin/semantic_prelabel/src/operator.py",
|
||||
"type": "builtin"
|
||||
}
|
||||
@ -0,0 +1,41 @@
|
||||
{
|
||||
"acceptance": {
|
||||
"requiresArtifactChecksum": true,
|
||||
"requiresFixtureChecksum": true,
|
||||
"requiresGpuEvidence": false,
|
||||
"requiresRealFixture": true,
|
||||
"requiresWorkflowTransfer": true
|
||||
},
|
||||
"artifacts": {
|
||||
"requiresChecksum": true,
|
||||
"requiresLineage": true,
|
||||
"requiresManifest": true
|
||||
},
|
||||
"entrypoint": "/app/backend/operator-runner/main.py",
|
||||
"handler": "builtin_semantic_prelabel",
|
||||
"imagePolicy": {
|
||||
"allowsSharedBaseLayer": true,
|
||||
"forbidsSharedOperatorRunnerFinalImage": true,
|
||||
"independentFinalImage": true
|
||||
},
|
||||
"operatorId": "operator-builtin-semantic-prelabel",
|
||||
"operatorSlug": "semantic_prelabel",
|
||||
"parameters": {
|
||||
"commandWrapperAllowed": false,
|
||||
"controlledScriptAllowed": false,
|
||||
"source": "hyperparams",
|
||||
"structured": true
|
||||
},
|
||||
"resources": {
|
||||
"minGpuCount": 0,
|
||||
"recommendedGpuType": "",
|
||||
"requiresGpu": false
|
||||
},
|
||||
"runtimeDependencies": [
|
||||
"json-artifacts",
|
||||
"annotation-schema"
|
||||
],
|
||||
"runtimeSource": "src/operator.py",
|
||||
"schemaVersion": "droboticflow.operator.runtime/v1",
|
||||
"sourceRoot": "operator-repos/builtin/semantic_prelabel"
|
||||
}
|
||||
109
operator-repos/builtin/semantic_prelabel/src/operator.py
Normal file
109
operator-repos/builtin/semantic_prelabel/src/operator.py
Normal file
@ -0,0 +1,109 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any, Callable
|
||||
|
||||
|
||||
HelperMap = dict[str, Callable[..., Any]]
|
||||
|
||||
|
||||
def _label_index(raw_labels: list[Any]) -> tuple[dict[str, dict[str, Any]], list[dict[str, Any]]]:
|
||||
index: dict[str, dict[str, Any]] = {}
|
||||
labels: list[dict[str, Any]] = []
|
||||
for position, raw in enumerate(raw_labels):
|
||||
if isinstance(raw, str):
|
||||
item = {"id": f"label-{position + 1}", "name": raw.strip(), "aliases": []}
|
||||
elif isinstance(raw, dict):
|
||||
item = {
|
||||
"id": str(raw.get("id") or f"label-{position + 1}").strip(),
|
||||
"name": str(raw.get("name") or "").strip(),
|
||||
"aliases": [str(value).strip() for value in raw.get("aliases", []) if str(value).strip()],
|
||||
}
|
||||
else:
|
||||
continue
|
||||
if not item["name"]:
|
||||
continue
|
||||
labels.append(item)
|
||||
for candidate in [item["id"], item["name"], *item["aliases"]]:
|
||||
index[candidate.lower()] = item
|
||||
return index, labels
|
||||
|
||||
|
||||
def run(
|
||||
run_id: str,
|
||||
node_id: str,
|
||||
output_dir: Any,
|
||||
node_data: dict[str, Any],
|
||||
inputs: list[dict[str, Any]],
|
||||
helpers: HelperMap,
|
||||
) -> list[dict[str, Any]]:
|
||||
params = helpers["hyperparams"](node_data)
|
||||
template_version = str(params.get("TEMPLATE_VERSION", "v1")).strip() or "v1"
|
||||
raw_labels = helpers["parse_json_param"](params, "LABEL_SCHEMA_JSON", [], list)
|
||||
phrases = helpers["parse_json_param"](params, "PHRASES_JSON", [], list)
|
||||
minimum_confidence = helpers["parse_unit_interval_param"](params, "MINIMUM_CONFIDENCE", 0.0)
|
||||
label_by_alias, labels = _label_index(raw_labels)
|
||||
if not labels:
|
||||
raise RuntimeError("LABEL_SCHEMA_JSON must define at least one semantic label")
|
||||
payload = helpers["first_payload_with_keys"](inputs, "annotationCount", "items")
|
||||
if payload is None:
|
||||
raise RuntimeError("版本化语义预标需要上游视频标注结果")
|
||||
items: list[dict[str, Any]] = []
|
||||
segment_count = 0
|
||||
for item in payload.get("items", []):
|
||||
if not isinstance(item, dict):
|
||||
continue
|
||||
annotation = item.get("annotation") if isinstance(item.get("annotation"), dict) else {}
|
||||
segments = []
|
||||
for position, action in enumerate(annotation.get("actions", [])):
|
||||
if not isinstance(action, dict):
|
||||
continue
|
||||
confidence = float(action.get("confidence", 0.0) or 0.0)
|
||||
if confidence < minimum_confidence:
|
||||
continue
|
||||
raw_label = str(action.get("label", "")).strip()
|
||||
definition = label_by_alias.get(raw_label.lower())
|
||||
if definition is None:
|
||||
continue
|
||||
segments.append(
|
||||
{
|
||||
"id": f"{item.get('clipId', 'clip')}-segment-{position + 1}",
|
||||
"labelId": definition["id"],
|
||||
"label": definition["name"],
|
||||
"start": float(action.get("start", 0.0) or 0.0),
|
||||
"end": float(action.get("end", 0.0) or 0.0),
|
||||
"confidence": confidence,
|
||||
"phrases": [str(value) for value in phrases],
|
||||
"source": "automatic_prelabel",
|
||||
}
|
||||
)
|
||||
segment_count += len(segments)
|
||||
items.append(
|
||||
{
|
||||
**item,
|
||||
"semanticAnnotation": {
|
||||
"schemaVersion": "droboticflow.semantic.annotation/v1",
|
||||
"templateVersion": template_version,
|
||||
"segments": segments,
|
||||
},
|
||||
}
|
||||
)
|
||||
manifest = {
|
||||
"schemaVersion": "droboticflow.semantic.prelabels/v1",
|
||||
"datasetType": "semantic-prelabels",
|
||||
"templateVersion": template_version,
|
||||
"labels": labels,
|
||||
"phrases": phrases,
|
||||
"annotationCount": len(items),
|
||||
"segmentCount": segment_count,
|
||||
"items": items,
|
||||
}
|
||||
return [
|
||||
helpers["write_json_artifact"](
|
||||
run_id,
|
||||
node_id,
|
||||
output_dir,
|
||||
"semantic-prelabels.json",
|
||||
manifest,
|
||||
output=helpers["output_binding"](node_data),
|
||||
)
|
||||
]
|
||||
@ -0,0 +1,21 @@
|
||||
{
|
||||
"fixtures": [],
|
||||
"minimumEvidence": [
|
||||
"input checksum",
|
||||
"artifact checksum",
|
||||
"lineage",
|
||||
"schema validation"
|
||||
],
|
||||
"operatorId": "operator-builtin-semantic-prelabel",
|
||||
"operatorSlug": "semantic_prelabel",
|
||||
"rules": {
|
||||
"forbidsMock": true,
|
||||
"forbidsSimulationOnly": true,
|
||||
"forbidsSmokeOnly": true,
|
||||
"forbidsSynthetic": true,
|
||||
"requiresLicense": true,
|
||||
"requiresPublicSourceUrl": true,
|
||||
"requiresSha256": true
|
||||
},
|
||||
"schemaVersion": "droboticflow.operator.fixture/v1"
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user