典型工作流示例
本页汇总 DaoAI 天眼系统内置的“模板工作流”示例。可在工作流编辑器中导入、查看并按需调整参数与区域配置。
办公场景
人员离岗检测
用途:识别人员是否离开指定办公区域(离岗/值班空缺)。需在编辑器中配置“监控区域”坐标。
- 组成与流程:
通用检测模型:标签输入
person检测场景中的人员;检测过滤: 过滤出置信度低于0.5的检测结果;
高速追踪:为检测到的对象分配并维护稳定的轨迹/ID,便于持续分析;
区域内存在时间:统计在区域内或者外停留时长;
属性定义: 提取区域内存在时间节点的 离开区域的时间值
time_out_of_zone;条件继续:当停留时长
>= 15秒时,进入后续步骤(可视化/事件保存);可视化与事件保存:
在图像上绘制“监控区域”多边形与半透明遮罩;
在仪表盘中展示带标注的图像;
保存事件与视频片段。
查看工作流 JSON
1{
2 "name": "离岗检测",
3 "category": "Office",
4 "notes": {
5 "notes_cn": "识别目标人员是否离开指定办公区域,用于监控员工离岗或值班空缺,需要用户自行配置区域坐标。",
6 "notes_en": "Detect whether the target person has left the specified office area, used to monitor employee absenteeism, need to configure the region coordinates by yourself."
7 },
8 "definition": {
9 "version": "1.0",
10 "inputs": [
11 {
12 "type": "WorkflowImage",
13 "name": "image"
14 }
15 ],
16 "steps": [
17 {
18 "type": "daoai/general_obj_det@v1",
19 "name": "general_object_detection_1",
20 "comments": null,
21 "images": "$inputs.image",
22 "classes": [
23 "person"
24 ],
25 "confidence_threshold": 0.5,
26 "label_confidence_thresholds": null,
27 "max_detections": 100
28 },
29 {
30 "type": "core/detections_filter@v1",
31 "name": "detections_filter_1",
32 "comments": null,
33 "predictions": "$steps.detections_filter_2.predictions",
34 "operations": [
35 {
36 "type": "DetectionsFilter",
37 "filter_operation": {
38 "type": "StatementGroup",
39 "statements": [
40 {
41 "type": "BinaryStatement",
42 "left_operand": {
43 "type": "DynamicOperand",
44 "operations": [
45 {
46 "type": "ExtractDetectionProperty",
47 "property_name": "class_name"
48 }
49 ]
50 },
51 "comparator": {
52 "type": "in (Sequence)"
53 },
54 "right_operand": {
55 "type": "StaticOperand",
56 "value": [
57 "person"
58 ]
59 }
60 },
61 {
62 "type": "BinaryStatement",
63 "left_operand": {
64 "type": "DynamicOperand",
65 "operations": [
66 {
67 "type": "ExtractDetectionProperty",
68 "property_name": "confidence"
69 }
70 ]
71 },
72 "comparator": {
73 "type": "(Number) >="
74 },
75 "right_operand": {
76 "type": "StaticOperand",
77 "value": 0.5
78 }
79 }
80 ]
81 }
82 }
83 ],
84 "image": "$inputs.image",
85 "uistate": {
86 "operations": {
87 "filterBy": "class_confidence",
88 "parentClassName": "",
89 "objectClassEnabled": true,
90 "objectClassType": "include",
91 "objectClasses": "person",
92 "attributeEnabled": false,
93 "attributeType": "include",
94 "attributes": "",
95 "confidenceEnabled": true,
96 "confidenceOperator": ">=",
97 "confidenceValue": 0.5,
98 "imageInput": "$inputs.image",
99 "detectionSizeOperator": "<=",
100 "detectionSizeValue": 5,
101 "detectionLocation": "in",
102 "detectionReferencePoint": "center",
103 "zoneDefinition": "Define in Editor",
104 "zonePoints": [],
105 "zoneJson": "[]"
106 }
107 }
108 },
109 {
110 "type": "daoai/event_saver@v1",
111 "name": "event_saver_1",
112 "comments": null,
113 "event_type": "Personnel leaving their posts",
114 "image": "$steps.polygon_zone_visualization_1.image",
115 "original_image": "$inputs.image",
116 "save_video": true,
117 "video_length_seconds": 15,
118 "cooldown_seconds": 20,
119 "cooldown_session_key": null,
120 "per_type_cooldown_seconds": 15
121 },
122 {
123 "type": "core/detections_filter@v1",
124 "name": "detections_filter_2",
125 "comments": null,
126 "predictions": "$steps.general_object_detection_1.predictions",
127 "operations": [
128 {
129 "type": "DetectionsFilter",
130 "filter_operation": {
131 "type": "StatementGroup",
132 "statements": []
133 }
134 }
135 ],
136 "image": "$inputs.image",
137 "uistate": {
138 "operations": {
139 "filterBy": "zone",
140 "parentClassName": "",
141 "objectClassEnabled": false,
142 "objectClassType": "include",
143 "objectClasses": "",
144 "attributeEnabled": false,
145 "attributeType": "include",
146 "attributes": "",
147 "confidenceEnabled": false,
148 "confidenceOperator": ">=",
149 "confidenceValue": 0.5,
150 "imageInput": "$inputs.image",
151 "detectionSizeOperator": "<=",
152 "detectionSizeValue": 5,
153 "detectionLocation": "in",
154 "detectionReferencePoint": "center",
155 "zoneDefinition": "Define in Editor",
156 "zonePoints": [],
157 "zoneJson": "[]"
158 }
159 }
160 },
161 {
162 "type": "daoai/highway_tracker@v1",
163 "name": "highway_tracker_1",
164 "comments": null,
165 "image": "$inputs.image",
166 "detections": "$steps.detections_filter_1.predictions",
167 "track_activation_threshold": 0.5,
168 "lost_track_buffer": 15,
169 "minimum_matching_threshold": 0.3,
170 "minimum_consecutive_frames": 1,
171 "instances_cache_size": 16384
172 },
173 {
174 "type": "daoai/time_out_zone@v1",
175 "name": "time_out_of_zone_1",
176 "comments": null,
177 "image": "$inputs.image",
178 "detections": "$steps.highway_tracker_1.already_seen_instances",
179 "zone": [],
180 "triggering_anchor": "CENTER",
181 "remove_in_zone_detections": true,
182 "target_label": null
183 },
184 {
185 "type": "core/property_definition@v1",
186 "name": "property_definition_1",
187 "comments": null,
188 "data": "$steps.time_out_of_zone_1.timed_detections",
189 "operations": [
190 {
191 "type": "DetectionsPropertyExtract",
192 "property_name": "time_out_of_zone"
193 },
194 {
195 "type": "NumericSequenceAggregate",
196 "function": "max"
197 }
198 ],
199 "image": "$inputs.image"
200 },
201 {
202 "type": "core/continue_if@v1",
203 "name": "continue_if_1",
204 "comments": null,
205 "condition_statement": {
206 "type": "StatementGroup",
207 "statements": [
208 {
209 "type": "BinaryStatement",
210 "left_operand": {
211 "type": "DynamicOperand",
212 "operand_name": "left"
213 },
214 "comparator": {
215 "type": "(Number) >="
216 },
217 "right_operand": {
218 "type": "StaticOperand",
219 "value": 15
220 }
221 }
222 ],
223 "operator": "and",
224 "uistate": {
225 "leftOperand": "$steps.property_definition_1.output",
226 "detectionsEvaluationProperty": "value",
227 "selectedFilterType": "not_selected",
228 "isClassFilteringActive": false,
229 "isAttrFilteringActive": false,
230 "isConfidenceFilteringActive": false,
231 "classSetInclusionMode": "include",
232 "classList": [],
233 "attrList": [],
234 "attrSetInclusionMode": "include",
235 "confidenceThreshold": 0.5,
236 "confidenceOperator": ">=",
237 "referenceImage": null,
238 "sizeThreshold": 5,
239 "sizeThresholdOperator": "<=",
240 "zoneOperator": "in",
241 "zonePoints": [],
242 "detectionReferencePoint": "center",
243 "isZoneStatic": true,
244 "dynamicZone": null,
245 "runtimeParameter": null,
246 "parentClassName": "",
247 "confidenceAggregationMode": "max",
248 "confidenceAggregationOperator": ">=",
249 "confidenceAggregationThreshold": 0.5,
250 "comparator": "(Number) ==",
251 "comparisonType": "Statically",
252 "comparisonValue": "0",
253 "detectionsNumberOperator": "(Number) >=",
254 "detectionsNumberThreshold": 30,
255 "extractedImageProperty": "height",
256 "propertyValueOperator": ">=",
257 "referenceValue": 30,
258 "isReferenceValueStatic": true,
259 "nonImageInputOperation": "(Number) ==",
260 "isMultiLabel": false,
261 "multiLabelOperation": "==",
262 "isFilteringEnabled": false
263 }
264 },
265 "evaluation_parameters": {
266 "left": "$steps.property_definition_1.output"
267 },
268 "next_steps": [
269 "$steps.polygon_zone_visualization_1"
270 ],
271 "image": "$inputs.image"
272 },
273 {
274 "type": "core/polygon_zone_visualization@v1",
275 "name": "polygon_zone_visualization_1",
276 "comments": null,
277 "image": "$inputs.image",
278 "copy_image": true,
279 "zone": [],
280 "color": "#F00",
281 "opacity": 0.3
282 },
283 {
284 "type": "daoai/dashboard_visualization@v1",
285 "name": "dashboard_visualization_1",
286 "comments": null,
287 "image": "$steps.polygon_zone_visualization_1.image"
288 }
289 ],
290 "outputs": [
291 {
292 "type": "JsonField",
293 "name": "event_saver_1_1",
294 "coordinates_system": "own",
295 "selector": "$steps.event_saver_1.error_status"
296 },
297 {
298 "type": "JsonField",
299 "name": "event_saver_1_2",
300 "coordinates_system": "own",
301 "selector": "$steps.event_saver_1.throttling_status"
302 },
303 {
304 "type": "JsonField",
305 "name": "event_saver_1_3",
306 "coordinates_system": "own",
307 "selector": "$steps.event_saver_1.message"
308 },
309 {
310 "type": "JsonField",
311 "name": "event_saver_1_4",
312 "coordinates_system": "own",
313 "selector": "$steps.event_saver_1.image_url"
314 },
315 {
316 "type": "JsonField",
317 "name": "event_saver_1_5",
318 "coordinates_system": "own",
319 "selector": "$steps.event_saver_1.video_url"
320 },
321 {
322 "type": "JsonField",
323 "name": "detections_filter_2_1",
324 "coordinates_system": "own",
325 "selector": "$steps.detections_filter_2.predictions"
326 },
327 {
328 "type": "JsonField",
329 "name": "highway_tracker_1_1",
330 "coordinates_system": "own",
331 "selector": "$steps.highway_tracker_1.tracked_detections"
332 },
333 {
334 "type": "JsonField",
335 "name": "highway_tracker_1_2",
336 "coordinates_system": "own",
337 "selector": "$steps.highway_tracker_1.new_instances"
338 },
339 {
340 "type": "JsonField",
341 "name": "highway_tracker_1_3",
342 "coordinates_system": "own",
343 "selector": "$steps.highway_tracker_1.already_seen_instances"
344 },
345 {
346 "type": "JsonField",
347 "name": "time_out_of_zone_1_1",
348 "coordinates_system": "own",
349 "selector": "$steps.time_out_of_zone_1.timed_detections"
350 },
351 {
352 "type": "JsonField",
353 "name": "property_definition_1_1",
354 "coordinates_system": "own",
355 "selector": "$steps.property_definition_1.output"
356 },
357 {
358 "type": "JsonField",
359 "name": "polygon_zone_visualization_1_1",
360 "coordinates_system": "own",
361 "selector": "$steps.polygon_zone_visualization_1.image"
362 }
363 ]
364 }
365 }
人员聚集检测
用途:识别指定区域内的人员聚集/拥挤情况。
- 组成与流程:
人员检测:标签输入
person检测画面中的人员;区域过滤:在设定区域内筛选检测结果;
条件继续:当区域内人数
>= 4时,进入后续步骤;可视化与事件保存:叠加框与标签并保存事件。
查看工作流 JSON
1{
2 "name": "人员聚集检测",
3 "category": "Office",
4 "notes": {
5 "notes_cn": "根据画面中指定区域内人员数量判断聚集程度,用于识别会议区、公共区域的拥挤或聚集现象,需要用户自行配置区域坐标。",
6 "notes_en": "Determine the degree of crowding based on the size of the people in the image, used to identify the crowded or clustered phenomenon in the meeting area and public area, need to configure the region coordinates by yourself."
7 },
8 "definition": {
9 "version": "1.0",
10 "inputs": [
11 {
12 "type": "WorkflowImage",
13 "name": "image"
14 }
15 ],
16 "steps": [
17 {
18 "type": "daoai/general_obj_det@v1",
19 "name": "general_object_detection_1",
20 "comments": null,
21 "images": "$inputs.image",
22 "classes": [
23 "person"
24 ],
25 "confidence_threshold": null,
26 "label_confidence_thresholds": null,
27 "max_detections": 100
28 },
29 {
30 "type": "core/detections_filter@v1",
31 "name": "detections_filter_1",
32 "comments": null,
33 "predictions": "$steps.general_object_detection_1.predictions",
34 "operations": [
35 {
36 "type": "DetectionsFilter",
37 "filter_operation": {
38 "type": "StatementGroup",
39 "statements": []
40 }
41 }
42 ],
43 "image": "$steps.line_counter_visualization_1.image",
44 "uistate": {
45 "operations": {
46 "filterBy": "zone",
47 "parentClassName": "",
48 "objectClassEnabled": false,
49 "objectClassType": "include",
50 "objectClasses": "",
51 "attributeEnabled": false,
52 "attributeType": "include",
53 "attributes": "",
54 "confidenceEnabled": false,
55 "confidenceOperator": ">=",
56 "confidenceValue": 0.5,
57 "imageInput": "$inputs.image",
58 "detectionSizeOperator": "<=",
59 "detectionSizeValue": 5,
60 "detectionLocation": "in",
61 "detectionReferencePoint": "center",
62 "zoneDefinition": "Define in Editor",
63 "zonePoints": [],
64 "zoneJson": "[]"
65 }
66 }
67 },
68 {
69 "type": "core/continue_if@v1",
70 "name": "continue_if_1",
71 "comments": null,
72 "condition_statement": {
73 "type": "StatementGroup",
74 "statements": [
75 {
76 "type": "BinaryStatement",
77 "left_operand": {
78 "type": "DynamicOperand",
79 "operand_name": "left",
80 "operations": [
81 {
82 "type": "DetectionsFilter",
83 "filter_operation": {
84 "type": "StatementGroup",
85 "operator": "and",
86 "statements": [
87 {
88 "type": "BinaryStatement",
89 "negate": false,
90 "left_operand": {
91 "type": "DynamicOperand",
92 "operand_name": "_",
93 "operations": [
94 {
95 "type": "ExtractDetectionProperty",
96 "property_name": "class_name"
97 }
98 ]
99 },
100 "comparator": {
101 "type": "in (Sequence)"
102 },
103 "right_operand": {
104 "type": "StaticOperand",
105 "value": [
106 "person"
107 ]
108 }
109 }
110 ]
111 }
112 },
113 {
114 "type": "SequenceLength"
115 }
116 ]
117 },
118 "comparator": {
119 "type": "(Number) >="
120 },
121 "right_operand": {
122 "type": "StaticOperand",
123 "value": 4
124 }
125 }
126 ],
127 "operator": "and",
128 "uistate": {
129 "leftOperand": "$steps.detections_filter_1.predictions",
130 "detectionsEvaluationProperty": "detection_count",
131 "selectedFilterType": "class_confidence",
132 "isClassFilteringActive": true,
133 "isAttrFilteringActive": false,
134 "isConfidenceFilteringActive": false,
135 "classSetInclusionMode": "include",
136 "classList": [
137 "person"
138 ],
139 "attrList": [],
140 "attrSetInclusionMode": "include",
141 "confidenceThreshold": 0.5,
142 "confidenceOperator": ">=",
143 "referenceImage": null,
144 "sizeThreshold": 5,
145 "sizeThresholdOperator": "<=",
146 "zoneOperator": "in",
147 "zonePoints": [],
148 "detectionReferencePoint": "center",
149 "isZoneStatic": true,
150 "dynamicZone": null,
151 "runtimeParameter": null,
152 "parentClassName": "",
153 "confidenceAggregationMode": "max",
154 "confidenceAggregationOperator": ">=",
155 "confidenceAggregationThreshold": 0.5,
156 "comparator": "(Number) ==",
157 "comparisonType": "Statically",
158 "comparisonValue": "0",
159 "detectionsNumberOperator": "(Number) >=",
160 "detectionsNumberThreshold": "4",
161 "extractedImageProperty": "height",
162 "propertyValueOperator": ">=",
163 "referenceValue": "4",
164 "isReferenceValueStatic": true,
165 "nonImageInputOperation": "(Number) ==",
166 "isMultiLabel": false,
167 "multiLabelOperation": "==",
168 "isFilteringEnabled": true
169 }
170 },
171 "evaluation_parameters": {
172 "left": "$steps.detections_filter_1.predictions"
173 },
174 "next_steps": [
175 "$steps.event_saver_1"
176 ],
177 "image": "$inputs.image"
178 },
179 {
180 "type": "core/bounding_box_visualization@v1",
181 "name": "bounding_box_visualization_1",
182 "comments": null,
183 "image": "$inputs.image",
184 "copy_image": true,
185 "predictions": "$steps.general_object_detection_1.predictions",
186 "color_palette": "DEFAULT",
187 "palette_size": 10,
188 "custom_colors": [],
189 "color_axis": "CLASS",
190 "thickness": 2,
191 "roundness": 0
192 },
193 {
194 "type": "daoai/event_saver@v1",
195 "name": "event_saver_1",
196 "comments": null,
197 "event_type": "Crowded",
198 "image": "$steps.label_visualization_1.image",
199 "original_image": "$inputs.image",
200 "save_video": true,
201 "video_length_seconds": 30,
202 "cooldown_seconds": 20,
203 "cooldown_session_key": null,
204 "per_type_cooldown_seconds": 30
205 },
206 {
207 "type": "core/label_visualization@v1",
208 "name": "label_visualization_1",
209 "comments": null,
210 "image": "$steps.bounding_box_visualization_1.image",
211 "copy_image": true,
212 "predictions": "$steps.general_object_detection_1.predictions",
213 "color_palette": "DEFAULT",
214 "palette_size": 10,
215 "custom_colors": [],
216 "color_axis": "CLASS",
217 "text": "Class",
218 "text_position": "TOP_LEFT",
219 "text_color": "WHITE",
220 "text_scale": 1,
221 "text_thickness": 1,
222 "text_padding": 10,
223 "border_radius": 0
224 }
225 ],
226 "outputs": [
227 {
228 "name": "detections_filter_1_1",
229 "type": "JsonField",
230 "selector": "$steps.detections_filter_1.predictions"
231 },
232 {
233 "name": "label_visualization_1_1",
234 "type": "JsonField",
235 "selector": "$steps.label_visualization_1.image"
236 }
237 ]
238 }
239
240}
异常行为检测
用途:识别抽烟、打电话、玩手机、摔倒、睡岗、翻越围栏等异常/不当行为(需自训练对应模型)。
- 组成与流程:
行为检测模型:输出异常行为类别与位置;
类别过滤:仅保留目标异常类别;
条件继续:当检测数量
>= 1时,进入后续步骤;可视化与事件保存:绘制框与标签、保存事件并在仪表盘展示。
查看工作流 JSON
1{
2 "name": "异常行为检测",
3 "category": "Office",
4 "notes": {
5 "notes_cn": "检测并识别抽烟、打电话、玩手机、摔倒、睡岗、翻越围栏等不当或异常行为,需要用户使用dw训练对应行为的检测模型",
6 "notes_en": "Detect and identify smoking, calling, playing with mobile phones, falling down, sleeping on duty, crossing fences and other improper or abnormal behaviors, need to use dw to train the detection model for the corresponding behavior."
7 },
8 "definition": {
9 "version": "1.0",
10 "inputs": [
11 {
12 "type": "WorkflowImage",
13 "name": "image"
14 }
15 ],
16 "steps": [
17 {
18 "type": "daoai/general_detection_model@v1",
19 "name": "general_detection_model_fast_1",
20 "comments": null,
21 "images": "$inputs.image",
22 "classes": ["Abnormal behavior"],
23 "confidence_threshold": null,
24 "label_confidence_thresholds": null,
25 "precision": "fp32",
26 "image_size": "640"
27 },
28 {
29 "type": "core/detections_filter@v1",
30 "name": "detections_filter_1",
31 "comments": null,
32 "predictions": "$steps.general_detection_model_fast_1.predictions",
33 "operations": [
34 {
35 "type": "DetectionsFilter",
36 "filter_operation": {
37 "type": "StatementGroup",
38 "statements": [
39 {
40 "type": "BinaryStatement",
41 "left_operand": {
42 "type": "DynamicOperand",
43 "operations": [
44 {
45 "type": "ExtractDetectionProperty",
46 "property_name": "class_name"
47 }
48 ]
49 },
50 "comparator": {
51 "type": "in (Sequence)"
52 },
53 "right_operand": {
54 "type": "StaticOperand",
55 "value": ["Abnormal behavior"]
56 }
57 }
58 ]
59 }
60 }
61 ],
62 "image": "$inputs.image",
63 "uistate": {
64 "operations": {
65 "filterBy": "class_confidence",
66 "parentClassName": "",
67 "objectClassEnabled": true,
68 "objectClassType": "include",
69 "objectClasses": "Abnormal behavior",
70 "attributeEnabled": false,
71 "attributeType": "include",
72 "attributes": "",
73 "confidenceEnabled": false,
74 "confidenceOperator": ">=",
75 "confidenceValue": 0.5,
76 "imageInput": "$inputs.image",
77 "detectionSizeOperator": "<=",
78 "detectionSizeValue": 5,
79 "detectionLocation": "in",
80 "detectionReferencePoint": "center",
81 "zoneDefinition": "Define in Editor",
82 "zonePoints": [],
83 "zoneJson": "[]"
84 }
85 }
86 },
87 {
88 "type": "core/continue_if@v1",
89 "name": "continue_if_1",
90 "comments": null,
91 "condition_statement": {
92 "type": "StatementGroup",
93 "statements": [
94 {
95 "type": "BinaryStatement",
96 "left_operand": {
97 "type": "DynamicOperand",
98 "operand_name": "left",
99 "operations": [
100 {
101 "type": "SequenceLength"
102 }
103 ]
104 },
105 "comparator": {
106 "type": "(Number) >="
107 },
108 "right_operand": {
109 "type": "StaticOperand",
110 "value": 1
111 }
112 }
113 ],
114 "operator": "and",
115 "uistate": {
116 "leftOperand": "$steps.detections_filter_1.predictions",
117 "detectionsEvaluationProperty": "detection_count",
118 "selectedFilterType": "not_selected",
119 "isClassFilteringActive": false,
120 "isAttrFilteringActive": false,
121 "isConfidenceFilteringActive": false,
122 "classSetInclusionMode": "include",
123 "classList": [],
124 "attrList": [],
125 "attrSetInclusionMode": "include",
126 "confidenceThreshold": 0.5,
127 "confidenceOperator": ">=",
128 "referenceImage": null,
129 "sizeThreshold": 5,
130 "sizeThresholdOperator": "<=",
131 "zoneOperator": "in",
132 "zonePoints": [],
133 "detectionReferencePoint": "center",
134 "isZoneStatic": true,
135 "dynamicZone": null,
136 "runtimeParameter": null,
137 "parentClassName": "",
138 "confidenceAggregationMode": "max",
139 "confidenceAggregationOperator": ">=",
140 "confidenceAggregationThreshold": 0.5,
141 "comparator": "(Number) ==",
142 "comparisonType": "Statically",
143 "comparisonValue": "0",
144 "detectionsNumberOperator": "(Number) >=",
145 "detectionsNumberThreshold": 1,
146 "extractedImageProperty": "height",
147 "propertyValueOperator": ">=",
148 "referenceValue": 1,
149 "isReferenceValueStatic": true,
150 "nonImageInputOperation": "(Number) ==",
151 "isMultiLabel": false,
152 "multiLabelOperation": "==",
153 "isFilteringEnabled": false
154 }
155 },
156 "evaluation_parameters": {
157 "left": "$steps.detections_filter_1.predictions"
158 },
159 "next_steps": ["$steps.bounding_box_visualization_1"],
160 "image": "$inputs.image"
161 },
162 {
163 "type": "core/bounding_box_visualization@v1",
164 "name": "bounding_box_visualization_1",
165 "comments": null,
166 "image": "$inputs.image",
167 "copy_image": true,
168 "predictions": "$steps.general_detection_model_fast_1.predictions",
169 "color_palette": "DEFAULT",
170 "palette_size": 10,
171 "custom_colors": [],
172 "color_axis": "CLASS",
173 "thickness": 2,
174 "roundness": 0
175 },
176 {
177 "type": "core/label_visualization@v1",
178 "name": "label_visualization_1",
179 "comments": null,
180 "image": "$steps.bounding_box_visualization_1.image",
181 "copy_image": true,
182 "predictions": "$steps.general_detection_model_fast_1.predictions",
183 "color_palette": "DEFAULT",
184 "palette_size": 10,
185 "custom_colors": [],
186 "color_axis": "CLASS",
187 "text": "Class",
188 "text_position": "TOP_LEFT",
189 "text_color": "WHITE",
190 "text_scale": 1,
191 "text_thickness": 1,
192 "text_padding": 10,
193 "border_radius": 0
194 },
195 {
196 "type": "daoai/event_saver@v1",
197 "name": "event_saver_1",
198 "comments": null,
199 "event_type": "Abnormal Behavior Detected",
200 "image": "$steps.label_visualization_1.image",
201 "original_image": "$inputs.image",
202 "save_video": true,
203 "video_length_seconds": 30,
204 "cooldown_seconds": 20,
205 "cooldown_session_key": null,
206 "per_type_cooldown_seconds": 30
207 },
208 {
209 "type": "daoai/dashboard_visualization@v1",
210 "name": "dashboard_visualization_1",
211 "comments": null,
212 "image": "$steps.label_visualization_1.image"
213 }
214 ],
215 "outputs": [
216 {
217 "type": "JsonField",
218 "name": "general_detection_model_fast_1_1",
219 "coordinates_system": "own",
220 "selector": "$steps.general_detection_model_fast_1.predictions"
221 },
222 {
223 "type": "JsonField",
224 "name": "detections_filter_1_1",
225 "coordinates_system": "own",
226 "selector": "$steps.detections_filter_1.predictions"
227 },
228 {
229 "type": "JsonField",
230 "name": "bounding_box_visualization_1_1",
231 "coordinates_system": "own",
232 "selector": "$steps.bounding_box_visualization_1.image"
233 },
234 {
235 "type": "JsonField",
236 "name": "label_visualization_1_1",
237 "coordinates_system": "own",
238 "selector": "$steps.label_visualization_1.image"
239 },
240 {
241 "type": "JsonField",
242 "name": "event_saver_1_1",
243 "coordinates_system": "own",
244 "selector": "$steps.event_saver_1.error_status"
245 },
246 {
247 "type": "JsonField",
248 "name": "event_saver_1_2",
249 "coordinates_system": "own",
250 "selector": "$steps.event_saver_1.throttling_status"
251 },
252 {
253 "type": "JsonField",
254 "name": "event_saver_1_3",
255 "coordinates_system": "own",
256 "selector": "$steps.event_saver_1.message"
257 },
258 {
259 "type": "JsonField",
260 "name": "event_saver_1_4",
261 "coordinates_system": "own",
262 "selector": "$steps.event_saver_1.image_url"
263 },
264 {
265 "type": "JsonField",
266 "name": "event_saver_1_5",
267 "coordinates_system": "own",
268 "selector": "$steps.event_saver_1.video_url"
269 }
270 ]
271 }
272}
长时停留检测
用途:统计目标在指定区域内的停留时长,识别过长停留(如长时间玩手机)。
- 组成与流程:
通用检测模型:检测场景中的目标对象;
检测过滤:按需要在设定区域或类别上筛选用于跟踪的检测结果;
目标跟踪:为检测到的对象分配并维护稳定的轨迹/ID;
区域内存在时间:统计在区内停留时长;
属性定义: 提取区域内存在时间节点的 离开区域的时间值
time_in_zone;条件继续:当停留时间达到阈值(示例为
>= 1,实际可在编辑器设定秒数)时,进入后续步骤(可视化/事件保存);可视化与事件保存:叠加框与“Time In Zone”标签,保存事件与视频片段;
查看工作流 JSON
1{
2 "name": "停留时长检测",
3 "category": "Office",
4 "notes": {
5 "notes_cn": "分析目标在指定区域内的停留时间,用于检测过长停留行为(如长时间玩手机),需要用户自行配置区域坐标。",
6 "notes_en": "Analyze the time spent by the target in the specified area, used to detect long-term stay behavior (such as long-term玩手机), need to configure the region coordinates by yourself."
7 },
8 "definition":{
9 "version": "1.0",
10 "inputs": [
11 {
12 "type": "WorkflowImage",
13 "name": "image"
14 }
15 ],
16 "steps": [
17 {
18 "type": "daoai/highway_tracker@v1",
19 "name": "highway_tracker_1",
20 "comments": null,
21 "image": "$inputs.image",
22 "detections": "$steps.detections_filter_2.predictions",
23 "track_activation_threshold": 0.25,
24 "lost_track_buffer": 15,
25 "minimum_matching_threshold": 0.3,
26 "minimum_consecutive_frames": 1,
27 "instances_cache_size": 16384
28 },
29 {
30 "type": "core/time_in_zone@v3",
31 "name": "time_in_zone_1",
32 "comments": null,
33 "image": "$inputs.image",
34 "detections": "$steps.highway_tracker_1.tracked_detections",
35 "zone": [],
36 "triggering_anchor": "CENTER",
37 "remove_out_of_zone_detections": true,
38 "reset_out_of_zone_detections": true,
39 "count_out_of_zone_time": false,
40 "count_out_of_image": false,
41 "clear_disappeared_track": false,
42 "clear_disappeared_track_gap_threshold": 8
43 },
44 {
45 "type": "core/property_definition@v1",
46 "name": "property_definition_1",
47 "comments": null,
48 "data": "$steps.time_in_zone_1.timed_detections",
49 "operations": [
50 {
51 "type": "DetectionsPropertyExtract",
52 "property_name": "time_in_zone"
53 },
54 {
55 "type": "NumericSequenceAggregate",
56 "function": "max"
57 }
58 ],
59 "image": "$inputs.image"
60 },
61 {
62 "type": "core/continue_if@v1",
63 "name": "continue_if_1",
64 "comments": null,
65 "condition_statement": {
66 "type": "StatementGroup",
67 "statements": [
68 {
69 "type": "BinaryStatement",
70 "left_operand": {
71 "type": "DynamicOperand",
72 "operand_name": "left"
73 },
74 "comparator": {
75 "type": "(Number) >="
76 },
77 "right_operand": {
78 "type": "StaticOperand",
79 "value": 0
80 }
81 }
82 ],
83 "operator": "and",
84 "uistate": {
85 "leftOperand": "$steps.property_definition_1.output",
86 "detectionsEvaluationProperty": "value",
87 "selectedFilterType": "not_selected",
88 "isClassFilteringActive": false,
89 "isAttrFilteringActive": false,
90 "isConfidenceFilteringActive": false,
91 "classSetInclusionMode": "include",
92 "classList": [],
93 "attrList": [],
94 "attrSetInclusionMode": "include",
95 "confidenceThreshold": 0.5,
96 "confidenceOperator": ">=",
97 "referenceImage": null,
98 "sizeThreshold": 5,
99 "sizeThresholdOperator": "<=",
100 "zoneOperator": "in",
101 "zonePoints": [],
102 "detectionReferencePoint": "center",
103 "isZoneStatic": true,
104 "dynamicZone": null,
105 "runtimeParameter": null,
106 "parentClassName": "",
107 "confidenceAggregationMode": "max",
108 "confidenceAggregationOperator": ">=",
109 "confidenceAggregationThreshold": 0.5,
110 "comparator": "(Number) ==",
111 "comparisonType": "Statically",
112 "comparisonValue": "0",
113 "detectionsNumberOperator": "(Number) >=",
114 "detectionsNumberThreshold": 5,
115 "extractedImageProperty": "height",
116 "propertyValueOperator": ">=",
117 "referenceValue": 5,
118 "isReferenceValueStatic": true,
119 "nonImageInputOperation": "(Number) ==",
120 "isMultiLabel": false,
121 "multiLabelOperation": "==",
122 "isFilteringEnabled": false
123 }
124 },
125 "evaluation_parameters": {
126 "left": "$steps.property_definition_1.output"
127 },
128 "next_steps": [
129 "$steps.event_saver_1"
130 ],
131 "image": "$inputs.image"
132 },
133 {
134 "type": "daoai/event_saver@v1",
135 "name": "event_saver_1",
136 "comments": null,
137 "event_type": "Stay for A Long Time",
138 "image": "$steps.label_visualization_1.image",
139 "original_image": "$inputs.image",
140 "save_video": true,
141 "video_length_seconds": 30,
142 "cooldown_seconds": 20,
143 "cooldown_session_key": null,
144 "per_type_cooldown_seconds": 30
145 },
146 {
147 "type": "core/bounding_box_visualization@v1",
148 "name": "bounding_box_visualization_1",
149 "comments": null,
150 "image": "$inputs.image",
151 "copy_image": true,
152 "predictions": "$steps.highway_tracker_1.tracked_detections",
153 "color_palette": "DEFAULT",
154 "palette_size": 10,
155 "custom_colors": [],
156 "color_axis": "CLASS",
157 "thickness": 2,
158 "roundness": 0
159 },
160 {
161 "type": "core/detections_filter@v1",
162 "name": "detections_filter_1",
163 "comments": null,
164 "predictions": "$steps.general_object_detection_1.predictions",
165 "operations": [
166 {
167 "type": "DetectionsFilter",
168 "filter_operation": {
169 "type": "StatementGroup",
170 "statements": []
171 }
172 }
173 ],
174 "image": "$steps.bounding_box_visualization_2.image",
175 "uistate": {
176 "operations": {
177 "filterBy": "zone",
178 "parentClassName": "",
179 "objectClassEnabled": false,
180 "objectClassType": "include",
181 "objectClasses": "",
182 "attributeEnabled": false,
183 "attributeType": "include",
184 "attributes": "",
185 "confidenceEnabled": false,
186 "confidenceOperator": ">=",
187 "confidenceValue": 0.5,
188 "imageInput": "$inputs.image",
189 "detectionSizeOperator": "<=",
190 "detectionSizeValue": 5,
191 "detectionLocation": "in",
192 "detectionReferencePoint": "center",
193 "zoneDefinition": "Define in Editor",
194 "zonePoints": [],
195 "zoneJson": "[]"
196 }
197 }
198 },
199 {
200 "type": "core/label_visualization@v1",
201 "name": "label_visualization_1",
202 "comments": null,
203 "image": "$steps.bounding_box_visualization_1.image",
204 "copy_image": true,
205 "predictions": "$steps.highway_tracker_1.tracked_detections",
206 "color_palette": "DEFAULT",
207 "palette_size": 10,
208 "custom_colors": [],
209 "color_axis": "CLASS",
210 "text": "Time In Zone",
211 "text_position": "TOP_LEFT",
212 "text_color": "WHITE",
213 "text_scale": 1,
214 "text_thickness": 1,
215 "text_padding": 10,
216 "border_radius": 0
217 },
218 {
219 "type": "core/detections_filter@v1",
220 "name": "detections_filter_2",
221 "comments": null,
222 "predictions": "$steps.detections_filter_1.predictions",
223 "operations": [
224 {
225 "type": "DetectionsFilter",
226 "filter_operation": {
227 "type": "StatementGroup",
228 "statements": [
229 {
230 "type": "BinaryStatement",
231 "left_operand": {
232 "type": "DynamicOperand",
233 "operations": [
234 {
235 "type": "ExtractDetectionProperty",
236 "property_name": "class_name"
237 }
238 ]
239 },
240 "comparator": {
241 "type": "in (Sequence)"
242 },
243 "right_operand": {
244 "type": "StaticOperand",
245 "value": [
246 "phone scrolling"
247 ]
248 }
249 }
250 ]
251 }
252 }
253 ],
254 "image": "$inputs.image",
255 "uistate": {
256 "operations": {
257 "filterBy": "class_confidence",
258 "parentClassName": "",
259 "objectClassEnabled": true,
260 "objectClassType": "include",
261 "objectClasses": "phone scrolling",
262 "attributeEnabled": false,
263 "attributeType": "include",
264 "attributes": "",
265 "confidenceEnabled": false,
266 "confidenceOperator": ">=",
267 "confidenceValue": 0.5,
268 "imageInput": "$inputs.image",
269 "detectionSizeOperator": "<=",
270 "detectionSizeValue": 5,
271 "detectionLocation": "in",
272 "detectionReferencePoint": "center",
273 "zoneDefinition": "Define in Editor",
274 "zonePoints": [],
275 "zoneJson": "[]"
276 }
277 }
278 },
279 {
280 "type": "daoai/general_obj_det@v1",
281 "name": "general_object_detection_1",
282 "comments": null,
283 "images": "$inputs.image",
284 "classes": [
285 "phone scrolling"
286 ],
287 "confidence_threshold": null,
288 "label_confidence_thresholds": null,
289 "max_detections": 100
290 }
291 ],
292 "outputs": [
293 {
294 "type": "JsonField",
295 "name": "highway_tracker_1_1",
296 "coordinates_system": "own",
297 "selector": "$steps.highway_tracker_1.tracked_detections"
298 },
299 {
300 "type": "JsonField",
301 "name": "highway_tracker_1_2",
302 "coordinates_system": "own",
303 "selector": "$steps.highway_tracker_1.new_instances"
304 },
305 {
306 "type": "JsonField",
307 "name": "highway_tracker_1_3",
308 "coordinates_system": "own",
309 "selector": "$steps.highway_tracker_1.already_seen_instances"
310 },
311 {
312 "type": "JsonField",
313 "name": "time_in_zone_1_1",
314 "coordinates_system": "own",
315 "selector": "$steps.time_in_zone_1.timed_detections"
316 },
317 {
318 "type": "JsonField",
319 "name": "time_in_zone_1_2",
320 "coordinates_system": "own",
321 "selector": "$steps.time_in_zone_1.disappeared_detections"
322 },
323 {
324 "type": "JsonField",
325 "name": "property_definition_1_1",
326 "coordinates_system": "own",
327 "selector": "$steps.property_definition_1.output"
328 },
329 {
330 "type": "JsonField",
331 "name": "event_saver_1_1",
332 "coordinates_system": "own",
333 "selector": "$steps.event_saver_1.error_status"
334 },
335 {
336 "type": "JsonField",
337 "name": "event_saver_1_2",
338 "coordinates_system": "own",
339 "selector": "$steps.event_saver_1.throttling_status"
340 },
341 {
342 "type": "JsonField",
343 "name": "event_saver_1_3",
344 "coordinates_system": "own",
345 "selector": "$steps.event_saver_1.message"
346 },
347 {
348 "type": "JsonField",
349 "name": "event_saver_1_4",
350 "coordinates_system": "own",
351 "selector": "$steps.event_saver_1.image_url"
352 },
353 {
354 "type": "JsonField",
355 "name": "event_saver_1_5",
356 "coordinates_system": "own",
357 "selector": "$steps.event_saver_1.video_url"
358 },
359 {
360 "type": "JsonField",
361 "name": "bounding_box_visualization_1_1",
362 "coordinates_system": "own",
363 "selector": "$steps.bounding_box_visualization_1.image"
364 },
365 {
366 "type": "JsonField",
367 "name": "detections_filter_1_1",
368 "coordinates_system": "own",
369 "selector": "$steps.detections_filter_1.predictions"
370 },
371 {
372 "type": "JsonField",
373 "name": "label_visualization_1_1",
374 "coordinates_system": "own",
375 "selector": "$steps.label_visualization_1.image"
376 },
377 {
378 "type": "JsonField",
379 "name": "detections_filter_2_1",
380 "coordinates_system": "own",
381 "selector": "$steps.detections_filter_2.predictions"
382 },
383 {
384 "type": "JsonField",
385 "name": "general_object_detection_1_1",
386 "coordinates_system": "own",
387 "selector": "$steps.general_object_detection_1.predictions"
388 }
389 ]
390 }
391 }
Highway 场景
交通拥堵检测
用途:结合车辆检测、跟踪与速度估计,识别道路拥堵程度(轻度/中度/重度),并输出事件类型与摘要。
- 组成与流程:
目标检测:检测车、卡车、摩托等对象;
目标跟踪:为车辆分配并维护稳定轨迹/ID;
速度估计:依据标定多边形、方向点与边缘距离计算车速(km/h);
在区时长:统计车辆在指定区域的停留时间;
拥堵综合分析:融合检测、轨迹、速度与停留信息,计算占用率与拥堵等级,并输出事件类型;
逻辑判断:当拥堵条件为真时继续进入可视化与事件保存;
可视化与事件保存:叠加事件标签、保存图像与视频片段,并可在仪表盘展示。
查看工作流 JSON
1{
2 "name": "交通拥堵检测",
3 "category": "Highway",
4 "notes": {
5 "notes_cn": "结合检测结果的置信度与车辆分布特征,识别道路拥堵程度,并按轻度、中度、重度触发不同级别报警,需要用户自行配置车道信息",
6 "notes_en": "Combine the confidence of detection results and the distribution characteristics of vehicles to identify the degree of road congestion, and trigger different levels of alarms according to light, medium, and heavy congestion."
7 },
8 "definition": {
9 "version": "1.0",
10 "inputs": [
11 {
12 "type": "WorkflowImage",
13 "name": "image"
14 }
15 ],
16 "steps": [
17 {
18 "type": "daoai/highway_tracker@v1",
19 "name": "highway_tracker_1",
20 "comments": null,
21 "image": "$inputs.image",
22 "detections": "$steps.general_detection_model_fast_1.predictions",
23 "track_activation_threshold": 0.5,
24 "lost_track_buffer": 15,
25 "minimum_matching_threshold": 0.3,
26 "minimum_consecutive_frames": 1,
27 "instances_cache_size": 16384
28 },
29 {
30 "type": "daoai/highway_speed@v1",
31 "name": "highway_speed_1",
32 "comments": null,
33 "image": "$inputs.image",
34 "detections": "$steps.highway_tracker_1.already_seen_instances",
35 "calibration_polygon": [
36 [
37 1025.3333333333337,
38 318.6666666666667
39 ],
40 [
41 1628,
42 312
43 ],
44 [
45 1758,
46 728
47 ],
48 [
49 0.3333333333333495,
50 674.3655913978495
51 ]
52 ],
53 "edge_distances": [
54 20,
55 200,
56 20,
57 200
58 ],
59 "direction_points": [
60 [
61 903.0208333333334,
62 893.3333333333334
63 ],
64 [
65 1207.5,
66 596.6666666666667
67 ]
68 ],
69 "output_unit": "kmh",
70 "smoothing_alpha": 0.5
71 },
72 {
73 "type": "core/bounding_box_visualization@v1",
74 "name": "bounding_box_visualization_1",
75 "comments": null,
76 "image": "$inputs.image",
77 "copy_image": true,
78 "predictions": "$steps.highway_tracker_1.tracked_detections",
79 "color_palette": "DEFAULT",
80 "palette_size": 10,
81 "custom_colors": [],
82 "color_axis": "CLASS",
83 "thickness": 2,
84 "roundness": 0
85 },
86 {
87 "type": "core/label_visualization@v1",
88 "name": "label_visualization_1",
89 "comments": null,
90 "image": "$steps.bounding_box_visualization_1.image",
91 "copy_image": true,
92 "predictions": "$steps.highway_speed_1.highway_speed_detections",
93 "color_palette": "DEFAULT",
94 "palette_size": 10,
95 "custom_colors": [],
96 "color_axis": "CLASS",
97 "text": "Speed",
98 "text_position": "TOP_LEFT",
99 "text_color": "WHITE",
100 "text_scale": 1,
101 "text_thickness": 1,
102 "text_padding": 10,
103 "border_radius": 0
104 },
105 {
106 "type": "daoai/highway_detection@v1",
107 "name": "highway_detection_1",
108 "comments": null,
109 "image": "$inputs.image",
110 "model_predictions": "$steps.general_detection_model_fast_1.predictions",
111 "tracked_detections": "$steps.highway_tracker_1.tracked_detections",
112 "velocity_detections": "$steps.highway_speed_1.highway_speed_detections",
113 "timed_detections": "$steps.time_in_zone_1.timed_detections",
114 "lane_zones": [
115 {
116 "lane_id": 1,
117 "name": "1",
118 "zone": [
119 [
120 1529,
121 325
122 ],
123 [
124 1620,
125 319
126 ],
127 [
128 1700,
129 427
130 ],
131 [
132 1729,
133 564
134 ],
135 [
136 1757,
137 826
138 ],
139 [
140 1763,
141 932
142 ],
143 [
144 1355,
145 915
146 ],
147 [
148 1503,
149 573
150 ],
151 [
152 1535,
153 436
154 ],
155 [
156 1523,
157 313
158 ]
159 ]
160 },
161 {
162 "lane_id": 2,
163 "name": "2",
164 "zone": [
165 [
166 1404,
167 321
168 ],
169 [
170 1520,
171 326
172 ],
173 [
174 1529,
175 440
176 ],
177 [
178 1478,
179 645
180 ],
181 [
182 1358,
183 910
184 ],
185 [
186 896,
187 893
188 ],
189 [
190 1081,
191 720
192 ],
193 [
194 1224,
195 566
196 ],
197 [
198 1347,
199 432
200 ],
201 [
202 1401,
203 318
204 ]
205 ]
206 },
207 {
208 "lane_id": 3,
209 "name": "3",
210 "zone": [
211 [
212 1284,
213 312
214 ],
215 [
216 1406,
217 312
218 ],
219 [
220 1355,
221 395
222 ],
223 [
224 1287,
225 497
226 ],
227 [
228 1190,
229 606
230 ],
231 [
232 1030,
233 757
234 ],
235 [
236 888,
237 891
238 ],
239 [
240 426,
241 873
242 ],
243 [
244 654,
245 731
246 ],
247 [
248 776,
249 671
250 ],
251 [
252 948,
253 571
254 ],
255 [
256 1099,
257 472
258 ],
259 [
260 1235,
261 366
262 ],
263 [
264 1275,
265 312
266 ]
267 ]
268 },
269 {
270 "lane_id": 4,
271 "name": "4",
272 "zone": [
273 [
274 1167,
275 309
276 ],
277 [
278 1275,
279 309
280 ],
281 [
282 1181,
283 406
284 ],
285 [
286 1090,
287 466
288 ],
289 [
290 896,
291 603
292 ],
293 [
294 762,
295 677
296 ],
297 [
298 543,
299 791
300 ],
301 [
302 420,
303 882
304 ],
305 [
306 10,
307 856
308 ],
309 [
310 509,
311 634
312 ],
313 [
314 714,
315 534
316 ],
317 [
318 945,
319 440
320 ],
321 [
322 1101,
323 349
324 ],
325 [
326 1167,
327 303
328 ]
329 ]
330 },
331 {
332 "lane_id": 5,
333 "name": "5",
334 "zone": [
335 [
336 1050,
337 306
338 ],
339 [
340 1164,
341 301
342 ],
343 [
344 990,
345 409
346 ],
347 [
348 805,
349 489
350 ],
351 [
352 563,
353 594
354 ],
355 [
356 352,
357 705
358 ],
359 [
360 10,
361 853
362 ],
363 [
364 7,
365 682
366 ],
367 [
368 98,
369 645
370 ],
371 [
372 543,
373 500
374 ],
375 [
376 885,
377 372
378 ],
379 [
380 1042,
381 303
382 ]
383 ]
384 }
385 ],
386 "enable_car_count": false,
387 "car_count_labels_to_count": null,
388 "car_count_flags_to_count": null,
389 "car_count_counting_line": [
390 [
391 0,
392 0
393 ],
394 [
395 100,
396 100
397 ]
398 ],
399 "car_count_pixel_distance": 50,
400 "car_count_triggering_anchor": "CENTER",
401 "car_count_reporting_window_min": 60,
402 "enable_average_speed": false,
403 "avg_speed_entry_line": [
404 [
405 0,
406 0
407 ],
408 [
409 100,
410 0
411 ]
412 ],
413 "avg_speed_exit_line": [
414 [
415 0,
416 100
417 ],
418 [
419 100,
420 100
421 ]
422 ],
423 "avg_speed_lane_ids": null,
424 "avg_speed_reporting_window_min": 30,
425 "avg_speed_max_speed_kph": 180,
426 "avg_speed_labels_to_count": null,
427 "enable_traffic_jam": true,
428 "jam_max_avg_speed_kph": 60,
429 "jam_min_count": 6,
430 "jam_occupancy_threshold": 0.5,
431 "jam_speed_limit_kph": 120,
432 "enable_illegal_events": true,
433 "illegal_forbidden_lanes": [
434 1
435 ],
436 "illegal_forbidden_lane_change_pairs": [
437 [
438 1,
439 2
440 ],
441 [
442 2,
443 3
444 ],
445 [
446 3,
447 4
448 ],
449 [
450 4,
451 5
452 ]
453 ],
454 "illegal_excluded_labels": [],
455 "illegal_max_speed_kph": 144,
456 "illegal_max_lane_changes": 2,
457 "illegal_time_limit_s": 15,
458 "enable_illegal_moving_backward": true,
459 "backward_time_threshold_s": 3,
460 "enable_illegal_parking": false,
461 "parking_lane_ids": null,
462 "parking_time_threshold_s": 20,
463 "parking_excluded_labels": [],
464 "enable_traffic_accident": false,
465 "accident_time_threshold_s": 10,
466 "accident_distance_threshold_px": 20,
467 "accident_triggering_labels": [
468 "emergency_warning_triangle"
469 ]
470 },
471 {
472 "type": "core/time_in_zone@v3",
473 "name": "time_in_zone_1",
474 "comments": null,
475 "image": "$inputs.image",
476 "detections": "$steps.highway_tracker_1.tracked_detections",
477 "zone": [
478 [
479 1025.3333333333337,
480 318.6666666666667
481 ],
482 [
483 1628,
484 312
485 ],
486 [
487 1758,
488 728
489 ],
490 [
491 0.3333333333333495,
492 674.3655913978495
493 ]
494 ],
495 "triggering_anchor": "CENTER",
496 "remove_out_of_zone_detections": true,
497 "reset_out_of_zone_detections": true,
498 "count_out_of_zone_time": false,
499 "count_out_of_image": false,
500 "clear_disappeared_track": false,
501 "clear_disappeared_track_gap_threshold": 8
502 },
503 {
504 "type": "daoai/general_detection_model@v1",
505 "name": "general_detection_model_fast_1",
506 "comments": null,
507 "images": "$inputs.image",
508 "classes": [
509 "car",
510 "truck",
511 "motorcycle"
512 ],
513 "confidence_threshold": null,
514 "label_confidence_thresholds": null,
515 "precision": "fp32",
516 "image_size": "640"
517 },
518 {
519 "type": "core/expression@v1",
520 "name": "expression_1",
521 "comments": null,
522 "data": {
523 "para_1": "$steps.highway_detection_1.traffic_jam"
524 },
525 "data_operations": {},
526 "switch": {
527 "type": "CasesDefinition",
528 "default": {
529 "type": "StaticCaseResult",
530 "value": false
531 },
532 "cases": [
533 {
534 "type": "CaseDefinition",
535 "condition": {
536 "type": "StatementGroup",
537 "statements": [
538 {
539 "type": "BinaryStatement",
540 "left_operand": {
541 "type": "DynamicOperand",
542 "operand_name": "para_1",
543 "operations": []
544 },
545 "comparator": {
546 "type": "=="
547 },
548 "right_operand": {
549 "type": "StaticOperand",
550 "value": true
551 }
552 }
553 ]
554 },
555 "result": {
556 "type": "StaticCaseResult",
557 "value": true
558 }
559 }
560 ]
561 },
562 "image": "$inputs.image"
563 },
564 {
565 "type": "core/continue_if@v1",
566 "name": "continue_if_1",
567 "comments": null,
568 "condition_statement": {
569 "type": "StatementGroup",
570 "statements": [
571 {
572 "type": "UnaryStatement",
573 "operand": {
574 "type": "DynamicOperand",
575 "operand_name": "left"
576 },
577 "operator": {
578 "type": "(Boolean) is True"
579 }
580 }
581 ],
582 "uistate": {
583 "leftOperand": "$steps.expression_1.output",
584 "detectionsEvaluationProperty": "value",
585 "selectedFilterType": "not_selected",
586 "isClassFilteringActive": false,
587 "isAttrFilteringActive": false,
588 "isConfidenceFilteringActive": false,
589 "classSetInclusionMode": "include",
590 "classList": [],
591 "attrList": [],
592 "attrSetInclusionMode": "include",
593 "confidenceThreshold": 0.5,
594 "confidenceOperator": ">=",
595 "referenceImage": null,
596 "sizeThreshold": 5,
597 "sizeThresholdOperator": "<=",
598 "zoneOperator": "in",
599 "zonePoints": [],
600 "detectionReferencePoint": "center",
601 "isZoneStatic": true,
602 "dynamicZone": null,
603 "runtimeParameter": null,
604 "parentClassName": "",
605 "confidenceAggregationMode": "max",
606 "confidenceAggregationOperator": ">=",
607 "confidenceAggregationThreshold": 0.5,
608 "comparator": "(Number) ==",
609 "comparisonType": "Statically",
610 "comparisonValue": "0",
611 "detectionsNumberOperator": "(Number) >=",
612 "detectionsNumberThreshold": 1,
613 "extractedImageProperty": "height",
614 "propertyValueOperator": ">=",
615 "referenceValue": 1,
616 "isReferenceValueStatic": true,
617 "nonImageInputOperation": "(Number) ==",
618 "isMultiLabel": false,
619 "multiLabelOperation": "==",
620 "isFilteringEnabled": false
621 }
622 },
623 "evaluation_parameters": {
624 "left": "$steps.expression_1.output"
625 },
626 "next_steps": [
627 "$steps.highway_visualization_1"
628 ],
629 "image": "$inputs.image"
630 },
631 {
632 "type": "daoai/highway_visualization@v1",
633 "name": "highway_visualization_1",
634 "comments": null,
635 "image": "$inputs.image",
636 "copy_image": true,
637 "predictions": "$steps.highway_detection_1.violations_detections",
638 "color_palette": "DEFAULT",
639 "palette_size": 10,
640 "custom_colors": [],
641 "color_axis": "CLASS",
642 "show_event_labels": true,
643 "show_timestamp": true,
644 "show_status_info": true,
645 "bbox_thickness": 4,
646 "roundness": 0,
647 "text_position": "TOP_LEFT",
648 "text_color": "WHITE",
649 "text_scale": 1,
650 "text_thickness": 1,
651 "text_padding": 10,
652 "border_radius": 0
653 },
654 {
655 "type": "daoai/event_saver@v1",
656 "name": "event_saver_1",
657 "comments": null,
658 "event_type": "$steps.highway_detection_1.event_type",
659 "image": "$steps.highway_visualization_1.image",
660 "original_image": "$inputs.image",
661 "save_video": true,
662 "video_length_seconds": 30,
663 "cooldown_seconds": 20,
664 "cooldown_session_key": null,
665 "per_type_cooldown_seconds": 30
666 },
667 {
668 "type": "daoai/dashboard_visualization@v1",
669 "name": "dashboard_visualization_1",
670 "comments": null,
671 "image": "$steps.label_visualization_1.image"
672 }
673 ],
674 "outputs": [
675 {
676 "type": "JsonField",
677 "name": "highway_tracker_1_1",
678 "coordinates_system": "own",
679 "selector": "$steps.highway_tracker_1.tracked_detections"
680 },
681 {
682 "type": "JsonField",
683 "name": "highway_tracker_1_2",
684 "coordinates_system": "own",
685 "selector": "$steps.highway_tracker_1.new_instances"
686 },
687 {
688 "type": "JsonField",
689 "name": "highway_tracker_1_3",
690 "coordinates_system": "own",
691 "selector": "$steps.highway_tracker_1.already_seen_instances"
692 },
693 {
694 "type": "JsonField",
695 "name": "highway_speed_1_1",
696 "coordinates_system": "own",
697 "selector": "$steps.highway_speed_1.highway_speed_detections"
698 },
699 {
700 "type": "JsonField",
701 "name": "bounding_box_visualization_1_1",
702 "coordinates_system": "own",
703 "selector": "$steps.bounding_box_visualization_1.image"
704 },
705 {
706 "type": "JsonField",
707 "name": "label_visualization_1_1",
708 "coordinates_system": "own",
709 "selector": "$steps.label_visualization_1.image"
710 },
711 {
712 "type": "JsonField",
713 "name": "highway_detection_1_1",
714 "coordinates_system": "own",
715 "selector": "$steps.highway_detection_1.count"
716 },
717 {
718 "type": "JsonField",
719 "name": "highway_detection_1_2",
720 "coordinates_system": "own",
721 "selector": "$steps.highway_detection_1.count_by_label"
722 },
723 {
724 "type": "JsonField",
725 "name": "highway_detection_1_3",
726 "coordinates_system": "own",
727 "selector": "$steps.highway_detection_1.count_by_flag"
728 },
729 {
730 "type": "JsonField",
731 "name": "highway_detection_1_4",
732 "coordinates_system": "own",
733 "selector": "$steps.highway_detection_1.car_count_triggered"
734 },
735 {
736 "type": "JsonField",
737 "name": "highway_detection_1_5",
738 "coordinates_system": "own",
739 "selector": "$steps.highway_detection_1.average_speed_kph"
740 },
741 {
742 "type": "JsonField",
743 "name": "highway_detection_1_6",
744 "coordinates_system": "own",
745 "selector": "$steps.highway_detection_1.average_speed_triggered"
746 },
747 {
748 "type": "JsonField",
749 "name": "highway_detection_1_7",
750 "coordinates_system": "own",
751 "selector": "$steps.highway_detection_1.lane_average_speeds"
752 },
753 {
754 "type": "JsonField",
755 "name": "highway_detection_1_8",
756 "coordinates_system": "own",
757 "selector": "$steps.highway_detection_1.illegal_event"
758 },
759 {
760 "type": "JsonField",
761 "name": "highway_detection_1_9",
762 "coordinates_system": "own",
763 "selector": "$steps.highway_detection_1.illegal_moving_backward"
764 },
765 {
766 "type": "JsonField",
767 "name": "highway_detection_1_10",
768 "coordinates_system": "own",
769 "selector": "$steps.highway_detection_1.traffic_jam"
770 },
771 {
772 "type": "JsonField",
773 "name": "highway_detection_1_11",
774 "coordinates_system": "own",
775 "selector": "$steps.highway_detection_1.jam_level"
776 },
777 {
778 "type": "JsonField",
779 "name": "highway_detection_1_12",
780 "coordinates_system": "own",
781 "selector": "$steps.highway_detection_1.occupancy"
782 },
783 {
784 "type": "JsonField",
785 "name": "highway_detection_1_13",
786 "coordinates_system": "own",
787 "selector": "$steps.highway_detection_1.illegal_parking"
788 },
789 {
790 "type": "JsonField",
791 "name": "highway_detection_1_14",
792 "coordinates_system": "own",
793 "selector": "$steps.highway_detection_1.traffic_accident"
794 },
795 {
796 "type": "JsonField",
797 "name": "highway_detection_1_15",
798 "coordinates_system": "own",
799 "selector": "$steps.highway_detection_1.violations_detections"
800 },
801 {
802 "type": "JsonField",
803 "name": "highway_detection_1_16",
804 "coordinates_system": "own",
805 "selector": "$steps.highway_detection_1.event_flags"
806 },
807 {
808 "type": "JsonField",
809 "name": "highway_detection_1_17",
810 "coordinates_system": "own",
811 "selector": "$steps.highway_detection_1.event_type"
812 },
813 {
814 "type": "JsonField",
815 "name": "time_in_zone_1_1",
816 "coordinates_system": "own",
817 "selector": "$steps.time_in_zone_1.timed_detections"
818 },
819 {
820 "type": "JsonField",
821 "name": "time_in_zone_1_2",
822 "coordinates_system": "own",
823 "selector": "$steps.time_in_zone_1.disappeared_detections"
824 },
825 {
826 "type": "JsonField",
827 "name": "general_detection_model_fast_1_1",
828 "coordinates_system": "own",
829 "selector": "$steps.general_detection_model_fast_1.predictions"
830 },
831 {
832 "type": "JsonField",
833 "name": "expression_1_1",
834 "coordinates_system": "own",
835 "selector": "$steps.expression_1.output"
836 },
837 {
838 "type": "JsonField",
839 "name": "highway_visualization_1_1",
840 "coordinates_system": "own",
841 "selector": "$steps.highway_visualization_1.image"
842 },
843 {
844 "type": "JsonField",
845 "name": "highway_visualization_1_2",
846 "coordinates_system": "own",
847 "selector": "$steps.highway_visualization_1.output_image_base64"
848 },
849 {
850 "type": "JsonField",
851 "name": "highway_visualization_1_3",
852 "coordinates_system": "own",
853 "selector": "$steps.highway_visualization_1.image_bytes"
854 },
855 {
856 "type": "JsonField",
857 "name": "highway_visualization_1_4",
858 "coordinates_system": "own",
859 "selector": "$steps.highway_visualization_1.has_violations"
860 },
861 {
862 "type": "JsonField",
863 "name": "highway_visualization_1_5",
864 "coordinates_system": "own",
865 "selector": "$steps.highway_visualization_1.event_summary"
866 },
867 {
868 "type": "JsonField",
869 "name": "event_saver_1_1",
870 "coordinates_system": "own",
871 "selector": "$steps.event_saver_1.error_status"
872 },
873 {
874 "type": "JsonField",
875 "name": "event_saver_1_2",
876 "coordinates_system": "own",
877 "selector": "$steps.event_saver_1.throttling_status"
878 },
879 {
880 "type": "JsonField",
881 "name": "event_saver_1_3",
882 "coordinates_system": "own",
883 "selector": "$steps.event_saver_1.message"
884 },
885 {
886 "type": "JsonField",
887 "name": "event_saver_1_4",
888 "coordinates_system": "own",
889 "selector": "$steps.event_saver_1.image_url"
890 },
891 {
892 "type": "JsonField",
893 "name": "event_saver_1_5",
894 "coordinates_system": "own",
895 "selector": "$steps.event_saver_1.video_url"
896 }
897 ]
898 }
899}
昼夜模型切换
用途:根据时间自动切换白天/夜间检测模型,适应光照变化,保证识别稳定性(需配置模型 UID)。
- 组成与流程:
自定义 Python 模块:根据当前时间输出应使用的模型 UID,;
通用检测:按动态 UID 选择并运行检测模型;
目标跟踪、速度估计、在区时长:与拥堵检测一致,分别统计轨迹、速度与在区停留;
违法/拥堵判定:输出是否违规/拥堵及事件类型;
逻辑判断:当触发条件成立时进入可视化与事件保存;
可视化与事件保存:绘制事件信息并保存图像/视频,支持仪表盘展示。
查看工作流 JSON
1{
2 "name": "昼夜模型切换",
3 "category": "Highway",
4 "notes": {
5 "notes_cn": "根据时间自动切换白天与夜间检测模型,确保在光照变化条件下持续稳定识别,需要用户自行配置模型uid",
6 "notes_en": "Automatically switch between day and night detection models based on time, ensuring continuous and stable recognition under varying lighting conditions, need to configure the model uid by yourself."
7 },
8 "definition": {
9 "version": "1.0",
10 "inputs": [
11 {
12 "type": "WorkflowImage",
13 "name": "image"
14 }
15 ],
16 "steps": [
17 {
18 "type": "daoai/highway_tracker@v1",
19 "name": "highway_tracker_1",
20 "comments": null,
21 "image": "$inputs.image",
22 "detections": "$steps.daoai_world_model_1.predictions",
23 "track_activation_threshold": 0.5,
24 "lost_track_buffer": 15,
25 "minimum_matching_threshold": 0.3,
26 "minimum_consecutive_frames": 1,
27 "instances_cache_size": 16384
28 },
29 {
30 "type": "daoai/highway_speed@v1",
31 "name": "highway_speed_1",
32 "comments": null,
33 "image": "$inputs.image",
34 "detections": "$steps.highway_tracker_1.already_seen_instances",
35 "calibration_polygon": [
36 [
37 1025.3333333333337,
38 318.6666666666667
39 ],
40 [
41 1628,
42 312
43 ],
44 [
45 1758,
46 728
47 ],
48 [
49 0.3333333333333495,
50 674.3655913978495
51 ]
52 ],
53 "edge_distances": [
54 20,
55 200,
56 20,
57 200
58 ],
59 "direction_points": [
60 [
61 903.0208333333334,
62 893.3333333333334
63 ],
64 [
65 1207.5,
66 596.6666666666667
67 ]
68 ],
69 "output_unit": "kmh",
70 "smoothing_alpha": 0.5
71 },
72 {
73 "type": "core/bounding_box_visualization@v1",
74 "name": "bounding_box_visualization_1",
75 "comments": null,
76 "image": "$inputs.image",
77 "copy_image": true,
78 "predictions": "$steps.highway_tracker_1.tracked_detections",
79 "color_palette": "DEFAULT",
80 "palette_size": 10,
81 "custom_colors": [],
82 "color_axis": "CLASS",
83 "thickness": 2,
84 "roundness": 0
85 },
86 {
87 "type": "core/label_visualization@v1",
88 "name": "label_visualization_1",
89 "comments": null,
90 "image": "$steps.bounding_box_visualization_1.image",
91 "copy_image": true,
92 "predictions": "$steps.highway_speed_1.highway_speed_detections",
93 "color_palette": "DEFAULT",
94 "palette_size": 10,
95 "custom_colors": [],
96 "color_axis": "CLASS",
97 "text": "Speed",
98 "text_position": "TOP_LEFT",
99 "text_color": "WHITE",
100 "text_scale": 1,
101 "text_thickness": 1,
102 "text_padding": 10,
103 "border_radius": 0
104 },
105 {
106 "type": "daoai/highway_detection@v1",
107 "name": "highway_detection_1",
108 "comments": null,
109 "image": "$inputs.image",
110 "model_predictions": "$steps.daoai_world_model_1.predictions",
111 "tracked_detections": "$steps.highway_tracker_1.tracked_detections",
112 "velocity_detections": "$steps.highway_speed_1.highway_speed_detections",
113 "timed_detections": "$steps.time_in_zone_1.timed_detections",
114 "lane_zones": [
115 {
116 "lane_id": 1,
117 "name": "1",
118 "zone": [
119 [
120 1529,
121 325
122 ],
123 [
124 1620,
125 319
126 ],
127 [
128 1700,
129 427
130 ],
131 [
132 1729,
133 564
134 ],
135 [
136 1757,
137 826
138 ],
139 [
140 1763,
141 932
142 ],
143 [
144 1355,
145 915
146 ],
147 [
148 1503,
149 573
150 ],
151 [
152 1535,
153 436
154 ],
155 [
156 1523,
157 313
158 ]
159 ]
160 },
161 {
162 "lane_id": 2,
163 "name": "2",
164 "zone": [
165 [
166 1404,
167 321
168 ],
169 [
170 1520,
171 326
172 ],
173 [
174 1529,
175 440
176 ],
177 [
178 1478,
179 645
180 ],
181 [
182 1358,
183 910
184 ],
185 [
186 896,
187 893
188 ],
189 [
190 1081,
191 720
192 ],
193 [
194 1224,
195 566
196 ],
197 [
198 1347,
199 432
200 ],
201 [
202 1401,
203 318
204 ]
205 ]
206 },
207 {
208 "lane_id": 3,
209 "name": "3",
210 "zone": [
211 [
212 1284,
213 312
214 ],
215 [
216 1406,
217 312
218 ],
219 [
220 1355,
221 395
222 ],
223 [
224 1287,
225 497
226 ],
227 [
228 1190,
229 606
230 ],
231 [
232 1030,
233 757
234 ],
235 [
236 888,
237 891
238 ],
239 [
240 426,
241 873
242 ],
243 [
244 654,
245 731
246 ],
247 [
248 776,
249 671
250 ],
251 [
252 948,
253 571
254 ],
255 [
256 1099,
257 472
258 ],
259 [
260 1235,
261 366
262 ],
263 [
264 1275,
265 312
266 ]
267 ]
268 },
269 {
270 "lane_id": 4,
271 "name": "4",
272 "zone": [
273 [
274 1167,
275 309
276 ],
277 [
278 1275,
279 309
280 ],
281 [
282 1181,
283 406
284 ],
285 [
286 1090,
287 466
288 ],
289 [
290 896,
291 603
292 ],
293 [
294 762,
295 677
296 ],
297 [
298 543,
299 791
300 ],
301 [
302 420,
303 882
304 ],
305 [
306 10,
307 856
308 ],
309 [
310 509,
311 634
312 ],
313 [
314 714,
315 534
316 ],
317 [
318 945,
319 440
320 ],
321 [
322 1101,
323 349
324 ],
325 [
326 1167,
327 303
328 ]
329 ]
330 },
331 {
332 "lane_id": 5,
333 "name": "5",
334 "zone": [
335 [
336 1050,
337 306
338 ],
339 [
340 1164,
341 301
342 ],
343 [
344 990,
345 409
346 ],
347 [
348 805,
349 489
350 ],
351 [
352 563,
353 594
354 ],
355 [
356 352,
357 705
358 ],
359 [
360 10,
361 853
362 ],
363 [
364 7,
365 682
366 ],
367 [
368 98,
369 645
370 ],
371 [
372 543,
373 500
374 ],
375 [
376 885,
377 372
378 ],
379 [
380 1042,
381 303
382 ]
383 ]
384 }
385 ],
386 "enable_car_count": false,
387 "car_count_labels_to_count": null,
388 "car_count_flags_to_count": null,
389 "car_count_counting_line": [
390 [
391 0,
392 0
393 ],
394 [
395 100,
396 100
397 ]
398 ],
399 "car_count_pixel_distance": 50,
400 "car_count_triggering_anchor": "CENTER",
401 "car_count_reporting_window_min": 60,
402 "enable_average_speed": false,
403 "avg_speed_entry_line": [
404 [
405 0,
406 0
407 ],
408 [
409 100,
410 0
411 ]
412 ],
413 "avg_speed_exit_line": [
414 [
415 0,
416 100
417 ],
418 [
419 100,
420 100
421 ]
422 ],
423 "avg_speed_lane_ids": null,
424 "avg_speed_reporting_window_min": 30,
425 "avg_speed_max_speed_kph": 180,
426 "avg_speed_labels_to_count": null,
427 "enable_traffic_jam": true,
428 "jam_max_avg_speed_kph": 60,
429 "jam_min_count": 6,
430 "jam_occupancy_threshold": 0.5,
431 "jam_speed_limit_kph": 120,
432 "enable_illegal_events": true,
433 "illegal_forbidden_lanes": [
434 1
435 ],
436 "illegal_forbidden_lane_change_pairs": [
437 [
438 1,
439 2
440 ],
441 [
442 2,
443 3
444 ],
445 [
446 3,
447 4
448 ],
449 [
450 4,
451 5
452 ]
453 ],
454 "illegal_excluded_labels": [],
455 "illegal_max_speed_kph": 144,
456 "illegal_max_lane_changes": 2,
457 "illegal_time_limit_s": 15,
458 "enable_illegal_moving_backward": true,
459 "backward_time_threshold_s": 3,
460 "enable_illegal_parking": false,
461 "parking_lane_ids": null,
462 "parking_time_threshold_s": 20,
463 "parking_excluded_labels": [],
464 "enable_traffic_accident": false,
465 "accident_time_threshold_s": 10,
466 "accident_distance_threshold_px": 20,
467 "accident_triggering_labels": [
468 "emergency_warning_triangle"
469 ]
470 },
471 {
472 "type": "core/time_in_zone@v3",
473 "name": "time_in_zone_1",
474 "comments": null,
475 "image": "$inputs.image",
476 "detections": "$steps.highway_tracker_1.tracked_detections",
477 "zone": [
478 [
479 1025.3333333333337,
480 318.6666666666667
481 ],
482 [
483 1628,
484 312
485 ],
486 [
487 1758,
488 728
489 ],
490 [
491 0.3333333333333495,
492 674.3655913978495
493 ]
494 ],
495 "triggering_anchor": "CENTER",
496 "remove_out_of_zone_detections": true,
497 "reset_out_of_zone_detections": true,
498 "count_out_of_zone_time": false,
499 "count_out_of_image": false,
500 "clear_disappeared_track": false,
501 "clear_disappeared_track_gap_threshold": 8
502 },
503 {
504 "type": "core/expression@v1",
505 "name": "expression_1",
506 "comments": null,
507 "data": {
508 "para_1": "$steps.highway_detection_1.illegal_event"
509 },
510 "data_operations": {},
511 "switch": {
512 "type": "CasesDefinition",
513 "default": {
514 "type": "StaticCaseResult",
515 "value": false
516 },
517 "cases": [
518 {
519 "type": "CaseDefinition",
520 "condition": {
521 "type": "StatementGroup",
522 "statements": [
523 {
524 "type": "BinaryStatement",
525 "left_operand": {
526 "type": "DynamicOperand",
527 "operand_name": "para_1",
528 "operations": []
529 },
530 "comparator": {
531 "type": "=="
532 },
533 "right_operand": {
534 "type": "StaticOperand",
535 "value": true
536 }
537 }
538 ]
539 },
540 "result": {
541 "type": "StaticCaseResult",
542 "value": true
543 }
544 }
545 ]
546 },
547 "image": "$inputs.image"
548 },
549 {
550 "type": "core/continue_if@v1",
551 "name": "continue_if_1",
552 "comments": null,
553 "condition_statement": {
554 "type": "StatementGroup",
555 "statements": [
556 {
557 "type": "UnaryStatement",
558 "operand": {
559 "type": "DynamicOperand",
560 "operand_name": "left"
561 },
562 "operator": {
563 "type": "(Boolean) is True"
564 }
565 }
566 ],
567 "uistate": {
568 "leftOperand": "$steps.expression_1.output",
569 "detectionsEvaluationProperty": "value",
570 "selectedFilterType": "not_selected",
571 "isClassFilteringActive": false,
572 "isAttrFilteringActive": false,
573 "isConfidenceFilteringActive": false,
574 "classSetInclusionMode": "include",
575 "classList": [],
576 "attrList": [],
577 "attrSetInclusionMode": "include",
578 "confidenceThreshold": 0.5,
579 "confidenceOperator": ">=",
580 "referenceImage": null,
581 "sizeThreshold": 5,
582 "sizeThresholdOperator": "<=",
583 "zoneOperator": "in",
584 "zonePoints": [],
585 "detectionReferencePoint": "center",
586 "isZoneStatic": true,
587 "dynamicZone": null,
588 "runtimeParameter": null,
589 "parentClassName": "",
590 "confidenceAggregationMode": "max",
591 "confidenceAggregationOperator": ">=",
592 "confidenceAggregationThreshold": 0.5,
593 "comparator": "(Number) ==",
594 "comparisonType": "Statically",
595 "comparisonValue": "0",
596 "detectionsNumberOperator": "(Number) >=",
597 "detectionsNumberThreshold": 1,
598 "extractedImageProperty": "height",
599 "propertyValueOperator": ">=",
600 "referenceValue": 1,
601 "isReferenceValueStatic": true,
602 "nonImageInputOperation": "(Number) ==",
603 "isMultiLabel": false,
604 "multiLabelOperation": "==",
605 "isFilteringEnabled": false
606 }
607 },
608 "evaluation_parameters": {
609 "left": "$steps.expression_1.output"
610 },
611 "next_steps": [
612 "$steps.highway_visualization_1"
613 ],
614 "image": "$inputs.image"
615 },
616 {
617 "type": "daoai/highway_visualization@v1",
618 "name": "highway_visualization_1",
619 "comments": null,
620 "image": "$inputs.image",
621 "copy_image": true,
622 "predictions": "$steps.highway_detection_1.violations_detections",
623 "color_palette": "DEFAULT",
624 "palette_size": 10,
625 "custom_colors": [],
626 "color_axis": "CLASS",
627 "show_event_labels": true,
628 "show_timestamp": true,
629 "show_status_info": true,
630 "bbox_thickness": 4,
631 "roundness": 0,
632 "text_position": "TOP_LEFT",
633 "text_color": "WHITE",
634 "text_scale": 1,
635 "text_thickness": 1,
636 "text_padding": 10,
637 "border_radius": 0
638 },
639 {
640 "type": "daoai/event_saver@v1",
641 "name": "event_saver_1",
642 "comments": null,
643 "event_type": "$steps.highway_detection_1.event_type",
644 "image": "$steps.highway_visualization_1.image",
645 "original_image": "$inputs.image",
646 "save_video": true,
647 "video_length_seconds": 30,
648 "cooldown_seconds": 20,
649 "cooldown_session_key": null,
650 "per_type_cooldown_seconds": 30
651 },
652 {
653 "type": "daoai/dashboard_visualization@v1",
654 "name": "dashboard_visualization_1",
655 "comments": null,
656 "image": "$steps.label_visualization_1.image"
657 },
658 {
659 "type": "daoai/daoai_world_model@v1",
660 "name": "daoai_world_model_1",
661 "comments": null,
662 "images": "$inputs.image",
663 "model_type": "detection",
664 "model_uid": "$steps.DayOrNight.Model_ID",
665 "confidence_threshold": null,
666 "label_confidence_thresholds": null
667 },
668 {
669 "type": "DayOrNight",
670 "name": "DayOrNight"
671 }
672 ],
673 "outputs": [
674 {
675 "type": "JsonField",
676 "name": "highway_tracker_1_1",
677 "coordinates_system": "own",
678 "selector": "$steps.highway_tracker_1.tracked_detections"
679 },
680 {
681 "type": "JsonField",
682 "name": "highway_tracker_1_2",
683 "coordinates_system": "own",
684 "selector": "$steps.highway_tracker_1.new_instances"
685 },
686 {
687 "type": "JsonField",
688 "name": "highway_tracker_1_3",
689 "coordinates_system": "own",
690 "selector": "$steps.highway_tracker_1.already_seen_instances"
691 },
692 {
693 "type": "JsonField",
694 "name": "highway_speed_1_1",
695 "coordinates_system": "own",
696 "selector": "$steps.highway_speed_1.highway_speed_detections"
697 },
698 {
699 "type": "JsonField",
700 "name": "bounding_box_visualization_1_1",
701 "coordinates_system": "own",
702 "selector": "$steps.bounding_box_visualization_1.image"
703 },
704 {
705 "type": "JsonField",
706 "name": "label_visualization_1_1",
707 "coordinates_system": "own",
708 "selector": "$steps.label_visualization_1.image"
709 },
710 {
711 "type": "JsonField",
712 "name": "highway_detection_1_1",
713 "coordinates_system": "own",
714 "selector": "$steps.highway_detection_1.count"
715 },
716 {
717 "type": "JsonField",
718 "name": "highway_detection_1_2",
719 "coordinates_system": "own",
720 "selector": "$steps.highway_detection_1.count_by_label"
721 },
722 {
723 "type": "JsonField",
724 "name": "highway_detection_1_3",
725 "coordinates_system": "own",
726 "selector": "$steps.highway_detection_1.count_by_flag"
727 },
728 {
729 "type": "JsonField",
730 "name": "highway_detection_1_4",
731 "coordinates_system": "own",
732 "selector": "$steps.highway_detection_1.car_count_triggered"
733 },
734 {
735 "type": "JsonField",
736 "name": "highway_detection_1_5",
737 "coordinates_system": "own",
738 "selector": "$steps.highway_detection_1.average_speed_kph"
739 },
740 {
741 "type": "JsonField",
742 "name": "highway_detection_1_6",
743 "coordinates_system": "own",
744 "selector": "$steps.highway_detection_1.average_speed_triggered"
745 },
746 {
747 "type": "JsonField",
748 "name": "highway_detection_1_7",
749 "coordinates_system": "own",
750 "selector": "$steps.highway_detection_1.lane_average_speeds"
751 },
752 {
753 "type": "JsonField",
754 "name": "highway_detection_1_8",
755 "coordinates_system": "own",
756 "selector": "$steps.highway_detection_1.illegal_event"
757 },
758 {
759 "type": "JsonField",
760 "name": "highway_detection_1_9",
761 "coordinates_system": "own",
762 "selector": "$steps.highway_detection_1.illegal_moving_backward"
763 },
764 {
765 "type": "JsonField",
766 "name": "highway_detection_1_10",
767 "coordinates_system": "own",
768 "selector": "$steps.highway_detection_1.traffic_jam"
769 },
770 {
771 "type": "JsonField",
772 "name": "highway_detection_1_11",
773 "coordinates_system": "own",
774 "selector": "$steps.highway_detection_1.jam_level"
775 },
776 {
777 "type": "JsonField",
778 "name": "highway_detection_1_12",
779 "coordinates_system": "own",
780 "selector": "$steps.highway_detection_1.occupancy"
781 },
782 {
783 "type": "JsonField",
784 "name": "highway_detection_1_13",
785 "coordinates_system": "own",
786 "selector": "$steps.highway_detection_1.illegal_parking"
787 },
788 {
789 "type": "JsonField",
790 "name": "highway_detection_1_14",
791 "coordinates_system": "own",
792 "selector": "$steps.highway_detection_1.traffic_accident"
793 },
794 {
795 "type": "JsonField",
796 "name": "highway_detection_1_15",
797 "coordinates_system": "own",
798 "selector": "$steps.highway_detection_1.violations_detections"
799 },
800 {
801 "type": "JsonField",
802 "name": "highway_detection_1_16",
803 "coordinates_system": "own",
804 "selector": "$steps.highway_detection_1.event_flags"
805 },
806 {
807 "type": "JsonField",
808 "name": "highway_detection_1_17",
809 "coordinates_system": "own",
810 "selector": "$steps.highway_detection_1.event_type"
811 },
812 {
813 "type": "JsonField",
814 "name": "time_in_zone_1_1",
815 "coordinates_system": "own",
816 "selector": "$steps.time_in_zone_1.timed_detections"
817 },
818 {
819 "type": "JsonField",
820 "name": "time_in_zone_1_2",
821 "coordinates_system": "own",
822 "selector": "$steps.time_in_zone_1.disappeared_detections"
823 },
824 {
825 "type": "JsonField",
826 "name": "expression_1_1",
827 "coordinates_system": "own",
828 "selector": "$steps.expression_1.output"
829 },
830 {
831 "type": "JsonField",
832 "name": "highway_visualization_1_1",
833 "coordinates_system": "own",
834 "selector": "$steps.highway_visualization_1.image"
835 },
836 {
837 "type": "JsonField",
838 "name": "highway_visualization_1_2",
839 "coordinates_system": "own",
840 "selector": "$steps.highway_visualization_1.output_image_base64"
841 },
842 {
843 "type": "JsonField",
844 "name": "highway_visualization_1_3",
845 "coordinates_system": "own",
846 "selector": "$steps.highway_visualization_1.image_bytes"
847 },
848 {
849 "type": "JsonField",
850 "name": "highway_visualization_1_4",
851 "coordinates_system": "own",
852 "selector": "$steps.highway_visualization_1.has_violations"
853 },
854 {
855 "type": "JsonField",
856 "name": "highway_visualization_1_5",
857 "coordinates_system": "own",
858 "selector": "$steps.highway_visualization_1.event_summary"
859 },
860 {
861 "type": "JsonField",
862 "name": "event_saver_1_1",
863 "coordinates_system": "own",
864 "selector": "$steps.event_saver_1.error_status"
865 },
866 {
867 "type": "JsonField",
868 "name": "event_saver_1_2",
869 "coordinates_system": "own",
870 "selector": "$steps.event_saver_1.throttling_status"
871 },
872 {
873 "type": "JsonField",
874 "name": "event_saver_1_3",
875 "coordinates_system": "own",
876 "selector": "$steps.event_saver_1.message"
877 },
878 {
879 "type": "JsonField",
880 "name": "event_saver_1_4",
881 "coordinates_system": "own",
882 "selector": "$steps.event_saver_1.image_url"
883 },
884 {
885 "type": "JsonField",
886 "name": "event_saver_1_5",
887 "coordinates_system": "own",
888 "selector": "$steps.event_saver_1.video_url"
889 },
890 {
891 "type": "JsonField",
892 "name": "daoai_world_model_1_1",
893 "coordinates_system": "own",
894 "selector": "$steps.daoai_world_model_1.predictions"
895 },
896 {
897 "type": "JsonField",
898 "name": "Model_ID",
899 "coordinates_system": "own",
900 "selector": "$steps.DayOrNight.Model_ID"
901 }
902 ],
903 "dynamic_blocks_definitions": [
904 {
905 "type": "DynamicBlockDefinition",
906 "manifest": {
907 "type": "ManifestDescription",
908 "description": "Switch Detection Models to Fit Sunlight or Darkness",
909 "block_type": "DayOrNight",
910 "inputs": {},
911 "outputs": {
912 "Model_ID": {
913 "type": "DynamicOutputDefinition",
914 "kind": [
915 "string"
916 ]
917 }
918 }
919 },
920 "code": {
921 "type": "PythonCode",
922 "run_function_code": "from datetime import datetime, time\n\ndef run(self) -> BlockResult:\n # 配置两个模型 ID:17:00 前和 17:00 后\n before_5_id = \"WLpN-BCURwfYmd4vSqXYtQ\"\n after_5_id = \"j581of38O0XluvWUHY1-xw\"\n\n now = datetime.now()\n five_pm = time(23, 5)\n model_id = \"\"\n if now.time() < five_pm:\n model_id = before_5_id\n else:\n model_id = after_5_id\n return {\"Model_ID\": model_id}"
923 }
924 }
925 ]
926 }
927}
车速与行驶轨迹检测
用途:实时检测车辆速度并分析行驶轨迹,用于识别超速、异常减速、逆行、频繁变道等行为,辅助交通安全监管。
- 组成与流程:
目标检测:检测车、卡车、摩托等对象;
目标跟踪:维护稳定的车辆轨迹/ID;
速度估计:通过标定与方向点计算车速;
在区时长:统计在指定车道或区域的停留时间;
违规/轨迹分析:综合速度、轨迹与停留信息识别超速、逆行、异常变道等;
逻辑判断:当违规条件为真时进入可视化与事件保存;
可视化与事件保存:叠加事件标签,保存图像/视频,并可在仪表盘展示。
查看工作流 JSON
1{
2 "name": "车速检测,行驶轨迹检测",
3 "category": "Highway",
4 "notes": {
5 "notes_cn": "实时检测高速路上车辆的速度,用于识别超速、异常减速等行为,辅助交通安全监管。并且分析高速路上车辆的行驶轨迹,用于识别异常变道、逆行、频繁蛇形驾驶等行为,需要用户自行配置车道信息",
6 "notes_en": "Real-time detection of vehicle speed on highways, used to identify speeding, abnormal deceleration, and other behaviors, and to analyze the driving trajectory of vehicles on highways, used to identify abnormal lane changes,逆行, frequent snake driving, etc., need to configure the lane information by yourself."
7 },
8 "definition": {
9 "version": "1.0",
10 "inputs": [
11 {
12 "type": "WorkflowImage",
13 "name": "image"
14 }
15 ],
16 "steps": [
17 {
18 "type": "daoai/highway_tracker@v1",
19 "name": "highway_tracker_1",
20 "comments": null,
21 "image": "$inputs.image",
22 "detections": "$steps.general_detection_model_fast_1.predictions",
23 "track_activation_threshold": 0.5,
24 "lost_track_buffer": 15,
25 "minimum_matching_threshold": 0.3,
26 "minimum_consecutive_frames": 1,
27 "instances_cache_size": 16384
28 },
29 {
30 "type": "daoai/highway_speed@v1",
31 "name": "highway_speed_1",
32 "comments": null,
33 "image": "$inputs.image",
34 "detections": "$steps.highway_tracker_1.already_seen_instances",
35 "calibration_polygon": [
36 [
37 1025.3333333333337,
38 318.6666666666667
39 ],
40 [
41 1628,
42 312
43 ],
44 [
45 1758,
46 728
47 ],
48 [
49 0.3333333333333495,
50 674.3655913978495
51 ]
52 ],
53 "edge_distances": [
54 20,
55 200,
56 20,
57 200
58 ],
59 "direction_points": [
60 [
61 903.0208333333334,
62 893.3333333333334
63 ],
64 [
65 1207.5,
66 596.6666666666667
67 ]
68 ],
69 "output_unit": "kmh",
70 "smoothing_alpha": 0.5
71 },
72 {
73 "type": "core/bounding_box_visualization@v1",
74 "name": "bounding_box_visualization_1",
75 "comments": null,
76 "image": "$inputs.image",
77 "copy_image": true,
78 "predictions": "$steps.highway_tracker_1.tracked_detections",
79 "color_palette": "DEFAULT",
80 "palette_size": 10,
81 "custom_colors": [],
82 "color_axis": "CLASS",
83 "thickness": 2,
84 "roundness": 0
85 },
86 {
87 "type": "core/label_visualization@v1",
88 "name": "label_visualization_1",
89 "comments": null,
90 "image": "$steps.bounding_box_visualization_1.image",
91 "copy_image": true,
92 "predictions": "$steps.highway_speed_1.highway_speed_detections",
93 "color_palette": "DEFAULT",
94 "palette_size": 10,
95 "custom_colors": [],
96 "color_axis": "CLASS",
97 "text": "Speed",
98 "text_position": "TOP_LEFT",
99 "text_color": "WHITE",
100 "text_scale": 1,
101 "text_thickness": 1,
102 "text_padding": 10,
103 "border_radius": 0
104 },
105 {
106 "type": "daoai/highway_detection@v1",
107 "name": "highway_detection_1",
108 "comments": null,
109 "image": "$inputs.image",
110 "model_predictions": "$steps.general_detection_model_fast_1.predictions",
111 "tracked_detections": "$steps.highway_tracker_1.tracked_detections",
112 "velocity_detections": "$steps.highway_speed_1.highway_speed_detections",
113 "timed_detections": "$steps.time_in_zone_1.timed_detections",
114 "lane_zones": [
115 {
116 "lane_id": 1,
117 "name": "1",
118 "zone": [
119 [
120 1529,
121 325
122 ],
123 [
124 1620,
125 319
126 ],
127 [
128 1700,
129 427
130 ],
131 [
132 1729,
133 564
134 ],
135 [
136 1757,
137 826
138 ],
139 [
140 1763,
141 932
142 ],
143 [
144 1355,
145 915
146 ],
147 [
148 1503,
149 573
150 ],
151 [
152 1535,
153 436
154 ],
155 [
156 1523,
157 313
158 ]
159 ]
160 },
161 {
162 "lane_id": 2,
163 "name": "2",
164 "zone": [
165 [
166 1404,
167 321
168 ],
169 [
170 1520,
171 326
172 ],
173 [
174 1529,
175 440
176 ],
177 [
178 1478,
179 645
180 ],
181 [
182 1358,
183 910
184 ],
185 [
186 896,
187 893
188 ],
189 [
190 1081,
191 720
192 ],
193 [
194 1224,
195 566
196 ],
197 [
198 1347,
199 432
200 ],
201 [
202 1401,
203 318
204 ]
205 ]
206 },
207 {
208 "lane_id": 3,
209 "name": "3",
210 "zone": [
211 [
212 1284,
213 312
214 ],
215 [
216 1406,
217 312
218 ],
219 [
220 1355,
221 395
222 ],
223 [
224 1287,
225 497
226 ],
227 [
228 1190,
229 606
230 ],
231 [
232 1030,
233 757
234 ],
235 [
236 888,
237 891
238 ],
239 [
240 426,
241 873
242 ],
243 [
244 654,
245 731
246 ],
247 [
248 776,
249 671
250 ],
251 [
252 948,
253 571
254 ],
255 [
256 1099,
257 472
258 ],
259 [
260 1235,
261 366
262 ],
263 [
264 1275,
265 312
266 ]
267 ]
268 },
269 {
270 "lane_id": 4,
271 "name": "4",
272 "zone": [
273 [
274 1167,
275 309
276 ],
277 [
278 1275,
279 309
280 ],
281 [
282 1181,
283 406
284 ],
285 [
286 1090,
287 466
288 ],
289 [
290 896,
291 603
292 ],
293 [
294 762,
295 677
296 ],
297 [
298 543,
299 791
300 ],
301 [
302 420,
303 882
304 ],
305 [
306 10,
307 856
308 ],
309 [
310 509,
311 634
312 ],
313 [
314 714,
315 534
316 ],
317 [
318 945,
319 440
320 ],
321 [
322 1101,
323 349
324 ],
325 [
326 1167,
327 303
328 ]
329 ]
330 },
331 {
332 "lane_id": 5,
333 "name": "5",
334 "zone": [
335 [
336 1050,
337 306
338 ],
339 [
340 1164,
341 301
342 ],
343 [
344 990,
345 409
346 ],
347 [
348 805,
349 489
350 ],
351 [
352 563,
353 594
354 ],
355 [
356 352,
357 705
358 ],
359 [
360 10,
361 853
362 ],
363 [
364 7,
365 682
366 ],
367 [
368 98,
369 645
370 ],
371 [
372 543,
373 500
374 ],
375 [
376 885,
377 372
378 ],
379 [
380 1042,
381 303
382 ]
383 ]
384 }
385 ],
386 "enable_car_count": false,
387 "car_count_labels_to_count": null,
388 "car_count_flags_to_count": null,
389 "car_count_counting_line": [
390 [
391 0,
392 0
393 ],
394 [
395 100,
396 100
397 ]
398 ],
399 "car_count_pixel_distance": 50,
400 "car_count_triggering_anchor": "CENTER",
401 "car_count_reporting_window_min": 60,
402 "enable_average_speed": false,
403 "avg_speed_entry_line": [
404 [
405 0,
406 0
407 ],
408 [
409 100,
410 0
411 ]
412 ],
413 "avg_speed_exit_line": [
414 [
415 0,
416 100
417 ],
418 [
419 100,
420 100
421 ]
422 ],
423 "avg_speed_lane_ids": null,
424 "avg_speed_reporting_window_min": 30,
425 "avg_speed_max_speed_kph": 180,
426 "avg_speed_labels_to_count": null,
427 "enable_traffic_jam": true,
428 "jam_max_avg_speed_kph": 60,
429 "jam_min_count": 6,
430 "jam_occupancy_threshold": 0.5,
431 "jam_speed_limit_kph": 120,
432 "enable_illegal_events": true,
433 "illegal_forbidden_lanes": [
434 1
435 ],
436 "illegal_forbidden_lane_change_pairs": [
437 [
438 1,
439 2
440 ],
441 [
442 2,
443 3
444 ],
445 [
446 3,
447 4
448 ],
449 [
450 4,
451 5
452 ]
453 ],
454 "illegal_excluded_labels": [],
455 "illegal_max_speed_kph": 144,
456 "illegal_max_lane_changes": 2,
457 "illegal_time_limit_s": 15,
458 "enable_illegal_moving_backward": true,
459 "backward_time_threshold_s": 3,
460 "enable_illegal_parking": false,
461 "parking_lane_ids": null,
462 "parking_time_threshold_s": 20,
463 "parking_excluded_labels": [],
464 "enable_traffic_accident": false,
465 "accident_time_threshold_s": 10,
466 "accident_distance_threshold_px": 20,
467 "accident_triggering_labels": [
468 "emergency_warning_triangle"
469 ]
470 },
471 {
472 "type": "core/time_in_zone@v3",
473 "name": "time_in_zone_1",
474 "comments": null,
475 "image": "$inputs.image",
476 "detections": "$steps.highway_tracker_1.tracked_detections",
477 "zone": [
478 [
479 1025.3333333333337,
480 318.6666666666667
481 ],
482 [
483 1628,
484 312
485 ],
486 [
487 1758,
488 728
489 ],
490 [
491 0.3333333333333495,
492 674.3655913978495
493 ]
494 ],
495 "triggering_anchor": "CENTER",
496 "remove_out_of_zone_detections": true,
497 "reset_out_of_zone_detections": true,
498 "count_out_of_zone_time": false,
499 "count_out_of_image": false,
500 "clear_disappeared_track": false,
501 "clear_disappeared_track_gap_threshold": 8
502 },
503 {
504 "type": "daoai/general_detection_model@v1",
505 "name": "general_detection_model_fast_1",
506 "comments": null,
507 "images": "$inputs.image",
508 "classes": [
509 "car",
510 "truck",
511 "motorcycle"
512 ],
513 "confidence_threshold": null,
514 "label_confidence_thresholds": null,
515 "precision": "fp32",
516 "image_size": "640"
517 },
518 {
519 "type": "core/expression@v1",
520 "name": "expression_1",
521 "comments": null,
522 "data": {
523 "para_1": "$steps.highway_detection_1.illegal_event"
524 },
525 "data_operations": {},
526 "switch": {
527 "type": "CasesDefinition",
528 "default": {
529 "type": "StaticCaseResult",
530 "value": false
531 },
532 "cases": [
533 {
534 "type": "CaseDefinition",
535 "condition": {
536 "type": "StatementGroup",
537 "statements": [
538 {
539 "type": "BinaryStatement",
540 "left_operand": {
541 "type": "DynamicOperand",
542 "operand_name": "para_1",
543 "operations": []
544 },
545 "comparator": {
546 "type": "=="
547 },
548 "right_operand": {
549 "type": "StaticOperand",
550 "value": true
551 }
552 }
553 ]
554 },
555 "result": {
556 "type": "StaticCaseResult",
557 "value": true
558 }
559 }
560 ]
561 },
562 "image": "$inputs.image"
563 },
564 {
565 "type": "core/continue_if@v1",
566 "name": "continue_if_1",
567 "comments": null,
568 "condition_statement": {
569 "type": "StatementGroup",
570 "statements": [
571 {
572 "type": "UnaryStatement",
573 "operand": {
574 "type": "DynamicOperand",
575 "operand_name": "left"
576 },
577 "operator": {
578 "type": "(Boolean) is True"
579 }
580 }
581 ],
582 "uistate": {
583 "leftOperand": "$steps.expression_1.output",
584 "detectionsEvaluationProperty": "value",
585 "selectedFilterType": "not_selected",
586 "isClassFilteringActive": false,
587 "isAttrFilteringActive": false,
588 "isConfidenceFilteringActive": false,
589 "classSetInclusionMode": "include",
590 "classList": [],
591 "attrList": [],
592 "attrSetInclusionMode": "include",
593 "confidenceThreshold": 0.5,
594 "confidenceOperator": ">=",
595 "referenceImage": null,
596 "sizeThreshold": 5,
597 "sizeThresholdOperator": "<=",
598 "zoneOperator": "in",
599 "zonePoints": [],
600 "detectionReferencePoint": "center",
601 "isZoneStatic": true,
602 "dynamicZone": null,
603 "runtimeParameter": null,
604 "parentClassName": "",
605 "confidenceAggregationMode": "max",
606 "confidenceAggregationOperator": ">=",
607 "confidenceAggregationThreshold": 0.5,
608 "comparator": "(Number) ==",
609 "comparisonType": "Statically",
610 "comparisonValue": "0",
611 "detectionsNumberOperator": "(Number) >=",
612 "detectionsNumberThreshold": 1,
613 "extractedImageProperty": "height",
614 "propertyValueOperator": ">=",
615 "referenceValue": 1,
616 "isReferenceValueStatic": true,
617 "nonImageInputOperation": "(Number) ==",
618 "isMultiLabel": false,
619 "multiLabelOperation": "==",
620 "isFilteringEnabled": false
621 }
622 },
623 "evaluation_parameters": {
624 "left": "$steps.expression_1.output"
625 },
626 "next_steps": [
627 "$steps.highway_visualization_1"
628 ],
629 "image": "$inputs.image"
630 },
631 {
632 "type": "daoai/highway_visualization@v1",
633 "name": "highway_visualization_1",
634 "comments": null,
635 "image": "$inputs.image",
636 "copy_image": true,
637 "predictions": "$steps.highway_detection_1.violations_detections",
638 "color_palette": "DEFAULT",
639 "palette_size": 10,
640 "custom_colors": [],
641 "color_axis": "CLASS",
642 "show_event_labels": true,
643 "show_timestamp": true,
644 "show_status_info": true,
645 "bbox_thickness": 4,
646 "roundness": 0,
647 "text_position": "TOP_LEFT",
648 "text_color": "WHITE",
649 "text_scale": 1,
650 "text_thickness": 1,
651 "text_padding": 10,
652 "border_radius": 0
653 },
654 {
655 "type": "daoai/event_saver@v1",
656 "name": "event_saver_1",
657 "comments": null,
658 "event_type": "$steps.highway_detection_1.event_type",
659 "image": "$steps.highway_visualization_1.image",
660 "original_image": "$inputs.image",
661 "save_video": true,
662 "video_length_seconds": 30,
663 "cooldown_seconds": 20,
664 "cooldown_session_key": null,
665 "per_type_cooldown_seconds": 30
666 },
667 {
668 "type": "daoai/dashboard_visualization@v1",
669 "name": "dashboard_visualization_1",
670 "comments": null,
671 "image": "$steps.label_visualization_1.image"
672 }
673 ],
674 "outputs": [
675 {
676 "type": "JsonField",
677 "name": "highway_tracker_1_1",
678 "coordinates_system": "own",
679 "selector": "$steps.highway_tracker_1.tracked_detections"
680 },
681 {
682 "type": "JsonField",
683 "name": "highway_tracker_1_2",
684 "coordinates_system": "own",
685 "selector": "$steps.highway_tracker_1.new_instances"
686 },
687 {
688 "type": "JsonField",
689 "name": "highway_tracker_1_3",
690 "coordinates_system": "own",
691 "selector": "$steps.highway_tracker_1.already_seen_instances"
692 },
693 {
694 "type": "JsonField",
695 "name": "highway_speed_1_1",
696 "coordinates_system": "own",
697 "selector": "$steps.highway_speed_1.highway_speed_detections"
698 },
699 {
700 "type": "JsonField",
701 "name": "bounding_box_visualization_1_1",
702 "coordinates_system": "own",
703 "selector": "$steps.bounding_box_visualization_1.image"
704 },
705 {
706 "type": "JsonField",
707 "name": "label_visualization_1_1",
708 "coordinates_system": "own",
709 "selector": "$steps.label_visualization_1.image"
710 },
711 {
712 "type": "JsonField",
713 "name": "highway_detection_1_1",
714 "coordinates_system": "own",
715 "selector": "$steps.highway_detection_1.count"
716 },
717 {
718 "type": "JsonField",
719 "name": "highway_detection_1_2",
720 "coordinates_system": "own",
721 "selector": "$steps.highway_detection_1.count_by_label"
722 },
723 {
724 "type": "JsonField",
725 "name": "highway_detection_1_3",
726 "coordinates_system": "own",
727 "selector": "$steps.highway_detection_1.count_by_flag"
728 },
729 {
730 "type": "JsonField",
731 "name": "highway_detection_1_4",
732 "coordinates_system": "own",
733 "selector": "$steps.highway_detection_1.car_count_triggered"
734 },
735 {
736 "type": "JsonField",
737 "name": "highway_detection_1_5",
738 "coordinates_system": "own",
739 "selector": "$steps.highway_detection_1.average_speed_kph"
740 },
741 {
742 "type": "JsonField",
743 "name": "highway_detection_1_6",
744 "coordinates_system": "own",
745 "selector": "$steps.highway_detection_1.average_speed_triggered"
746 },
747 {
748 "type": "JsonField",
749 "name": "highway_detection_1_7",
750 "coordinates_system": "own",
751 "selector": "$steps.highway_detection_1.lane_average_speeds"
752 },
753 {
754 "type": "JsonField",
755 "name": "highway_detection_1_8",
756 "coordinates_system": "own",
757 "selector": "$steps.highway_detection_1.illegal_event"
758 },
759 {
760 "type": "JsonField",
761 "name": "highway_detection_1_9",
762 "coordinates_system": "own",
763 "selector": "$steps.highway_detection_1.illegal_moving_backward"
764 },
765 {
766 "type": "JsonField",
767 "name": "highway_detection_1_10",
768 "coordinates_system": "own",
769 "selector": "$steps.highway_detection_1.traffic_jam"
770 },
771 {
772 "type": "JsonField",
773 "name": "highway_detection_1_11",
774 "coordinates_system": "own",
775 "selector": "$steps.highway_detection_1.jam_level"
776 },
777 {
778 "type": "JsonField",
779 "name": "highway_detection_1_12",
780 "coordinates_system": "own",
781 "selector": "$steps.highway_detection_1.occupancy"
782 },
783 {
784 "type": "JsonField",
785 "name": "highway_detection_1_13",
786 "coordinates_system": "own",
787 "selector": "$steps.highway_detection_1.illegal_parking"
788 },
789 {
790 "type": "JsonField",
791 "name": "highway_detection_1_14",
792 "coordinates_system": "own",
793 "selector": "$steps.highway_detection_1.traffic_accident"
794 },
795 {
796 "type": "JsonField",
797 "name": "highway_detection_1_15",
798 "coordinates_system": "own",
799 "selector": "$steps.highway_detection_1.violations_detections"
800 },
801 {
802 "type": "JsonField",
803 "name": "highway_detection_1_16",
804 "coordinates_system": "own",
805 "selector": "$steps.highway_detection_1.event_flags"
806 },
807 {
808 "type": "JsonField",
809 "name": "highway_detection_1_17",
810 "coordinates_system": "own",
811 "selector": "$steps.highway_detection_1.event_type"
812 },
813 {
814 "type": "JsonField",
815 "name": "time_in_zone_1_1",
816 "coordinates_system": "own",
817 "selector": "$steps.time_in_zone_1.timed_detections"
818 },
819 {
820 "type": "JsonField",
821 "name": "time_in_zone_1_2",
822 "coordinates_system": "own",
823 "selector": "$steps.time_in_zone_1.disappeared_detections"
824 },
825 {
826 "type": "JsonField",
827 "name": "general_detection_model_fast_1_1",
828 "coordinates_system": "own",
829 "selector": "$steps.general_detection_model_fast_1.predictions"
830 },
831 {
832 "type": "JsonField",
833 "name": "expression_1_1",
834 "coordinates_system": "own",
835 "selector": "$steps.expression_1.output"
836 },
837 {
838 "type": "JsonField",
839 "name": "highway_visualization_1_1",
840 "coordinates_system": "own",
841 "selector": "$steps.highway_visualization_1.image"
842 },
843 {
844 "type": "JsonField",
845 "name": "highway_visualization_1_2",
846 "coordinates_system": "own",
847 "selector": "$steps.highway_visualization_1.output_image_base64"
848 },
849 {
850 "type": "JsonField",
851 "name": "highway_visualization_1_3",
852 "coordinates_system": "own",
853 "selector": "$steps.highway_visualization_1.image_bytes"
854 },
855 {
856 "type": "JsonField",
857 "name": "highway_visualization_1_4",
858 "coordinates_system": "own",
859 "selector": "$steps.highway_visualization_1.has_violations"
860 },
861 {
862 "type": "JsonField",
863 "name": "highway_visualization_1_5",
864 "coordinates_system": "own",
865 "selector": "$steps.highway_visualization_1.event_summary"
866 },
867 {
868 "type": "JsonField",
869 "name": "event_saver_1_1",
870 "coordinates_system": "own",
871 "selector": "$steps.event_saver_1.error_status"
872 },
873 {
874 "type": "JsonField",
875 "name": "event_saver_1_2",
876 "coordinates_system": "own",
877 "selector": "$steps.event_saver_1.throttling_status"
878 },
879 {
880 "type": "JsonField",
881 "name": "event_saver_1_3",
882 "coordinates_system": "own",
883 "selector": "$steps.event_saver_1.message"
884 },
885 {
886 "type": "JsonField",
887 "name": "event_saver_1_4",
888 "coordinates_system": "own",
889 "selector": "$steps.event_saver_1.image_url"
890 },
891 {
892 "type": "JsonField",
893 "name": "event_saver_1_5",
894 "coordinates_system": "own",
895 "selector": "$steps.event_saver_1.video_url"
896 }
897 ]
898 }
899}
Construction Site 场景
工地热人数统计
用途:统计画面中人员数量,便于了解现场人员密度与热度。
- 组成与流程:
目标检测:检测人员;
检测过滤:仅保留人员且置信度 >= 0.5;
属性提取:计算检测数量用于事件类型或展示;
可视化与事件保存:叠加框与标签,按人数保存事件与视频片段。
查看工作流 JSON
1{
2 "name": "工地热人数统计",
3 "category": "Construction Site",
4 "notes": {
5 "notes_cn": "使用通用目标检测模型检测图片区域中的人员数量。",
6 "notes_en": "Use the general detection model to detect the number of people in the area of the image."
7 },
8 "definition": {
9 "version": "1.0",
10 "inputs": [
11 {
12 "type": "WorkflowImage",
13 "name": "image"
14 }
15 ],
16 "steps": [
17 {
18 "type": "daoai/general_obj_det@v1",
19 "name": "general_object_detection_1",
20 "comments": null,
21 "images": "$inputs.image",
22 "classes": [
23 "person"
24 ],
25 "confidence_threshold": 0.5,
26 "label_confidence_thresholds": null,
27 "max_detections": 100
28 },
29 {
30 "type": "core/detections_filter@v1",
31 "name": "detections_filter_1",
32 "comments": null,
33 "predictions": "$steps.general_object_detection_1.predictions",
34 "operations": [
35 {
36 "type": "DetectionsFilter",
37 "filter_operation": {
38 "type": "StatementGroup",
39 "statements": [
40 {
41 "type": "BinaryStatement",
42 "left_operand": {
43 "type": "DynamicOperand",
44 "operations": [
45 {
46 "type": "ExtractDetectionProperty",
47 "property_name": "class_name"
48 }
49 ]
50 },
51 "comparator": {
52 "type": "in (Sequence)"
53 },
54 "right_operand": {
55 "type": "StaticOperand",
56 "value": [
57 "person"
58 ]
59 }
60 },
61 {
62 "type": "BinaryStatement",
63 "left_operand": {
64 "type": "DynamicOperand",
65 "operations": [
66 {
67 "type": "ExtractDetectionProperty",
68 "property_name": "confidence"
69 }
70 ]
71 },
72 "comparator": {
73 "type": "(Number) >="
74 },
75 "right_operand": {
76 "type": "StaticOperand",
77 "value": 0.5
78 }
79 }
80 ]
81 }
82 }
83 ],
84 "image": "$inputs.image",
85 "uistate": {
86 "operations": {
87 "filterBy": "class_confidence",
88 "parentClassName": "",
89 "objectClassEnabled": true,
90 "objectClassType": "include",
91 "objectClasses": "person",
92 "attributeEnabled": false,
93 "attributeType": "include",
94 "attributes": "",
95 "confidenceEnabled": true,
96 "confidenceOperator": ">=",
97 "confidenceValue": 0.5,
98 "imageInput": "$inputs.image",
99 "detectionSizeOperator": "<=",
100 "detectionSizeValue": 5,
101 "detectionLocation": "in",
102 "detectionReferencePoint": "center",
103 "zoneDefinition": "Define in Editor",
104 "zonePoints": [],
105 "zoneJson": "[]"
106 }
107 }
108 },
109 {
110 "type": "core/property_definition@v1",
111 "name": "property_definition_1",
112 "comments": null,
113 "data": "$steps.detections_filter_1.predictions",
114 "operations": [
115 {
116 "type": "SequenceLength"
117 }
118 ],
119 "image": "$inputs.image"
120 },
121 {
122 "type": "core/bounding_box_visualization@v1",
123 "name": "bounding_box_visualization_1",
124 "comments": null,
125 "image": "$inputs.image",
126 "copy_image": true,
127 "predictions": "$steps.detections_filter_1.predictions",
128 "color_palette": "DEFAULT",
129 "palette_size": 10,
130 "custom_colors": [],
131 "color_axis": "CLASS",
132 "thickness": 2,
133 "roundness": 0
134 },
135 {
136 "type": "core/label_visualization@v1",
137 "name": "label_visualization_1",
138 "comments": null,
139 "image": "$steps.bounding_box_visualization_1.image",
140 "copy_image": true,
141 "predictions": "$steps.detections_filter_1.predictions",
142 "color_palette": "DEFAULT",
143 "palette_size": 10,
144 "custom_colors": [],
145 "color_axis": "CLASS",
146 "text": "Index",
147 "text_position": "TOP_LEFT",
148 "text_color": "WHITE",
149 "text_scale": 1,
150 "text_thickness": 1,
151 "text_padding": 10,
152 "border_radius": 0
153 },
154 {
155 "type": "daoai/event_saver@v1",
156 "name": "event_saver_1",
157 "comments": null,
158 "event_type": "$steps.property_definition_1.output",
159 "image": "$steps.label_visualization_1.image",
160 "original_image": "$inputs.image",
161 "save_video": true,
162 "video_length_seconds": 30,
163 "cooldown_seconds": 20,
164 "cooldown_session_key": null,
165 "per_type_cooldown_seconds": 30
166 }
167 ],
168 "outputs": [
169 {
170 "name": "property_definition_1_1",
171 "type": "JsonField",
172 "selector": "$steps.property_definition_1.output"
173 },
174 {
175 "name": "label_visualization_1",
176 "type": "JsonField",
177 "selector": "$steps.label_visualization_1.image"
178 },
179 {
180 "type": "JsonField",
181 "name": "event_saver_1_1",
182 "coordinates_system": "own",
183 "selector": "$steps.event_saver_1.error_status"
184 },
185 {
186 "type": "JsonField",
187 "name": "event_saver_1_2",
188 "coordinates_system": "own",
189 "selector": "$steps.event_saver_1.throttling_status"
190 },
191 {
192 "type": "JsonField",
193 "name": "event_saver_1_3",
194 "coordinates_system": "own",
195 "selector": "$steps.event_saver_1.message"
196 },
197 {
198 "type": "JsonField",
199 "name": "event_saver_1_4",
200 "coordinates_system": "own",
201 "selector": "$steps.event_saver_1.image_url"
202 },
203 {
204 "type": "JsonField",
205 "name": "event_saver_1_5",
206 "coordinates_system": "own",
207 "selector": "$steps.event_saver_1.video_url"
208 }
209 ]
210 }
211 }
区域占用检测
用途:检测指定区域是否被物体占用(车、卡车、摩托、大件物品等),需在编辑器配置区域坐标。
- 组成与流程:
目标检测:检测目标类别;
区域过滤:在目标区域筛选检测结果;
目标跟踪:维护稳定轨迹与 ID;
条件继续:当区域内存在目标(数量 >= 1)进入可视化与事件保存;
可视化与事件保存:绘制框与标签并保存事件。
查看工作流 JSON
1{
2 "name": "区域占用检测",
3 "category": "Construction Site",
4 "notes": {
5 "notes_cn": "使用通用目标检测模型检测图片指定区域中是否被占用,需要用户自行配置区域坐标。",
6 "notes_en": "Use the general detection model to detect whether the specified area of the image is occupied, need to configure the region coordinates by yourself."
7 },
8 "definition": {
9 "version": "1.0",
10 "inputs": [
11 {
12 "type": "WorkflowImage",
13 "name": "image"
14 }
15 ],
16 "steps": [
17 {
18 "type": "daoai/general_obj_det@v1",
19 "name": "general_object_detection_1",
20 "comments": null,
21 "images": "$inputs.image",
22 "classes": [
23 "car",
24 "truck",
25 "motorcycle",
26 "large item"
27 ],
28 "confidence_threshold": 0.5,
29 "label_confidence_thresholds": null,
30 "max_detections": 100
31 },
32 {
33 "type": "daoai/highway_tracker@v1",
34 "name": "highway_tracker_1",
35 "comments": null,
36 "image": "$inputs.image",
37 "detections": "$steps.detections_filter_1.predictions",
38 "track_activation_threshold": 0.5,
39 "lost_track_buffer": 15,
40 "minimum_matching_threshold": 0.3,
41 "minimum_consecutive_frames": 1,
42 "instances_cache_size": 16384
43 },
44 {
45 "type": "daoai/event_saver@v1",
46 "name": "event_saver_1",
47 "comments": null,
48 "event_type": "Region Occupied",
49 "image": "$steps.label_visualization_1.image",
50 "original_image": "$inputs.image",
51 "save_video": true,
52 "video_length_seconds": 30,
53 "cooldown_seconds": 20,
54 "cooldown_session_key": null,
55 "per_type_cooldown_seconds": 30
56 },
57 {
58 "type": "core/bounding_box_visualization@v1",
59 "name": "bounding_box_visualization_1",
60 "comments": null,
61 "image": "$inputs.image",
62 "copy_image": true,
63 "predictions": "$steps.highway_tracker_1.tracked_detections",
64 "color_palette": "DEFAULT",
65 "palette_size": 10,
66 "custom_colors": [],
67 "color_axis": "CLASS",
68 "thickness": 2,
69 "roundness": 0
70 },
71 {
72 "type": "core/detections_filter@v1",
73 "name": "detections_filter_1",
74 "comments": null,
75 "predictions": "$steps.general_object_detection_1.predictions",
76 "operations": [
77 {
78 "type": "DetectionsFilter",
79 "filter_operation": {
80 "type": "StatementGroup",
81 "statements": []
82 }
83 }
84 ],
85 "image": "$inputs.image",
86 "uistate": {
87 "operations": {
88 "filterBy": "zone",
89 "parentClassName": "",
90 "objectClassEnabled": false,
91 "objectClassType": "include",
92 "objectClasses": "",
93 "attributeEnabled": false,
94 "attributeType": "include",
95 "attributes": "",
96 "confidenceEnabled": false,
97 "confidenceOperator": ">=",
98 "confidenceValue": 0.5,
99 "imageInput": "$inputs.image",
100 "detectionSizeOperator": "<=",
101 "detectionSizeValue": 5,
102 "detectionLocation": "in",
103 "detectionReferencePoint": "center",
104 "zoneDefinition": "Define in Editor",
105 "zonePoints": [],
106 "zoneJson": "[]"
107 }
108 }
109 },
110 {
111 "type": "core/label_visualization@v1",
112 "name": "label_visualization_1",
113 "comments": null,
114 "image": "$steps.bounding_box_visualization_1.image",
115 "copy_image": true,
116 "predictions": "$steps.highway_tracker_1.tracked_detections",
117 "color_palette": "DEFAULT",
118 "palette_size": 10,
119 "custom_colors": [],
120 "color_axis": "CLASS",
121 "text": "Class",
122 "text_position": "TOP_LEFT",
123 "text_color": "WHITE",
124 "text_scale": 1,
125 "text_thickness": 1,
126 "text_padding": 10,
127 "border_radius": 0
128 },
129 {
130 "type": "core/continue_if@v1",
131 "name": "continue_if_1",
132 "comments": null,
133 "condition_statement": {
134 "type": "StatementGroup",
135 "statements": [
136 {
137 "type": "BinaryStatement",
138 "left_operand": {
139 "type": "DynamicOperand",
140 "operand_name": "left",
141 "operations": [
142 {
143 "type": "SequenceLength"
144 }
145 ]
146 },
147 "comparator": {
148 "type": "(Number) >="
149 },
150 "right_operand": {
151 "type": "StaticOperand",
152 "value": 1
153 }
154 }
155 ],
156 "operator": "and",
157 "uistate": {
158 "leftOperand": "$steps.highway_tracker_1.tracked_detections",
159 "detectionsEvaluationProperty": "detection_count",
160 "selectedFilterType": "not_selected",
161 "isClassFilteringActive": false,
162 "isAttrFilteringActive": false,
163 "isConfidenceFilteringActive": false,
164 "classSetInclusionMode": "include",
165 "classList": [],
166 "attrList": [],
167 "attrSetInclusionMode": "include",
168 "confidenceThreshold": 0.5,
169 "confidenceOperator": ">=",
170 "referenceImage": null,
171 "sizeThreshold": 5,
172 "sizeThresholdOperator": "<=",
173 "zoneOperator": "in",
174 "zonePoints": [],
175 "detectionReferencePoint": "center",
176 "isZoneStatic": true,
177 "dynamicZone": null,
178 "runtimeParameter": null,
179 "parentClassName": "",
180 "confidenceAggregationMode": "max",
181 "confidenceAggregationOperator": ">=",
182 "confidenceAggregationThreshold": 0.5,
183 "comparator": "(Number) ==",
184 "comparisonType": "Statically",
185 "comparisonValue": "0",
186 "detectionsNumberOperator": "(Number) >=",
187 "detectionsNumberThreshold": 1,
188 "extractedImageProperty": "height",
189 "propertyValueOperator": ">=",
190 "referenceValue": 1,
191 "isReferenceValueStatic": true,
192 "nonImageInputOperation": "(Number) ==",
193 "isMultiLabel": false,
194 "multiLabelOperation": "==",
195 "isFilteringEnabled": false
196 }
197 },
198 "evaluation_parameters": {
199 "left": "$steps.highway_tracker_1.tracked_detections"
200 },
201 "next_steps": [
202 "$steps.bounding_box_visualization_1"
203 ],
204 "image": "$inputs.image"
205 }
206 ],
207 "outputs": [
208 {
209 "type": "JsonField",
210 "name": "general_object_detection_1_1",
211 "coordinates_system": "own",
212 "selector": "$steps.general_object_detection_1.predictions"
213 },
214 {
215 "type": "JsonField",
216 "name": "highway_tracker_1_1",
217 "coordinates_system": "own",
218 "selector": "$steps.highway_tracker_1.tracked_detections"
219 },
220 {
221 "type": "JsonField",
222 "name": "highway_tracker_1_2",
223 "coordinates_system": "own",
224 "selector": "$steps.highway_tracker_1.new_instances"
225 },
226 {
227 "type": "JsonField",
228 "name": "highway_tracker_1_3",
229 "coordinates_system": "own",
230 "selector": "$steps.highway_tracker_1.already_seen_instances"
231 },
232 {
233 "type": "JsonField",
234 "name": "event_saver_1_1",
235 "coordinates_system": "own",
236 "selector": "$steps.event_saver_1.error_status"
237 },
238 {
239 "type": "JsonField",
240 "name": "event_saver_1_2",
241 "coordinates_system": "own",
242 "selector": "$steps.event_saver_1.throttling_status"
243 },
244 {
245 "type": "JsonField",
246 "name": "event_saver_1_3",
247 "coordinates_system": "own",
248 "selector": "$steps.event_saver_1.message"
249 },
250 {
251 "type": "JsonField",
252 "name": "event_saver_1_4",
253 "coordinates_system": "own",
254 "selector": "$steps.event_saver_1.image_url"
255 },
256 {
257 "type": "JsonField",
258 "name": "event_saver_1_5",
259 "coordinates_system": "own",
260 "selector": "$steps.event_saver_1.video_url"
261 },
262 {
263 "type": "JsonField",
264 "name": "bounding_box_visualization_1_1",
265 "coordinates_system": "own",
266 "selector": "$steps.bounding_box_visualization_1.image"
267 },
268 {
269 "type": "JsonField",
270 "name": "detections_filter_1_1",
271 "coordinates_system": "own",
272 "selector": "$steps.detections_filter_1.predictions"
273 },
274 {
275 "type": "JsonField",
276 "name": "label_visualization_1_1",
277 "coordinates_system": "own",
278 "selector": "$steps.label_visualization_1.image"
279 }
280 ]
281 }
282 }
作业区人员距离检测
用途:检测危险/作业区域是否有人员靠近,辅助安全管控;需在编辑器配置区域坐标。
- 组成与流程:
目标检测:检测人员(staff);
区域过滤:在危险区域筛选检测结果;
条件继续:当区域内存在人员(数量 >= 1)进入可视化;
可视化与事件保存:绘制框与标签并保存事件与视频。
查看工作流 JSON
1{
2 "name": "作业区人员距离检测",
3 "category": "Construction Site",
4 "notes": {
5 "notes_cn": "使用通用目标检测模型检测图片危险区域中是否有人员靠近,需要用户自行配置区域坐标。",
6 "notes_en": "Use the general detection model to detect whether there is a person in the danger area of the image, need to configure the region coordinates by yourself."
7 },
8 "definition": {
9 "version": "1.0",
10 "inputs": [
11 {
12 "type": "WorkflowImage",
13 "name": "image"
14 }
15 ],
16 "steps": [
17 {
18 "type": "daoai/general_obj_det@v1",
19 "name": "general_object_detection_1",
20 "comments": null,
21 "images": "$inputs.image",
22 "classes": [
23 "staff"
24 ],
25 "confidence_threshold": 0.5,
26 "label_confidence_thresholds": null,
27 "max_detections": 100
28 },
29 {
30 "type": "daoai/event_saver@v1",
31 "name": "event_saver_1",
32 "comments": null,
33 "event_type": "Staff Detected in Danger Zone",
34 "image": "$steps.label_visualization_1.image",
35 "original_image": "$inputs.image",
36 "save_video": true,
37 "video_length_seconds": 30,
38 "cooldown_seconds": 20,
39 "cooldown_session_key": null,
40 "per_type_cooldown_seconds": 30
41 },
42 {
43 "type": "core/detections_filter@v1",
44 "name": "detections_filter_1",
45 "comments": null,
46 "predictions": "$steps.general_object_detection_1.predictions",
47 "operations": [
48 {
49 "type": "DetectionsFilter",
50 "filter_operation": {
51 "type": "StatementGroup",
52 "statements": []
53 }
54 }
55 ],
56 "image": "$inputs.image",
57 "uistate": {
58 "operations": {
59 "filterBy": "zone",
60 "parentClassName": "",
61 "objectClassEnabled": false,
62 "objectClassType": "include",
63 "objectClasses": "",
64 "attributeEnabled": false,
65 "attributeType": "include",
66 "attributes": "",
67 "confidenceEnabled": false,
68 "confidenceOperator": ">=",
69 "confidenceValue": 0.5,
70 "imageInput": "$inputs.image",
71 "detectionSizeOperator": "<=",
72 "detectionSizeValue": 5,
73 "detectionLocation": "in",
74 "detectionReferencePoint": "center",
75 "zoneDefinition": "Define in Editor",
76 "zonePoints": [],
77 "zoneJson": "[]"
78 }
79 }
80 },
81 {
82 "type": "core/continue_if@v1",
83 "name": "continue_if_1",
84 "comments": null,
85 "condition_statement": {
86 "type": "StatementGroup",
87 "statements": [
88 {
89 "type": "BinaryStatement",
90 "left_operand": {
91 "type": "DynamicOperand",
92 "operand_name": "left",
93 "operations": [
94 {
95 "type": "SequenceLength"
96 }
97 ]
98 },
99 "comparator": {
100 "type": "(Number) >="
101 },
102 "right_operand": {
103 "type": "StaticOperand",
104 "value": 1
105 }
106 }
107 ],
108 "operator": "and",
109 "uistate": {
110 "leftOperand": "$steps.detections_filter_2.predictions",
111 "detectionsEvaluationProperty": "detection_count",
112 "selectedFilterType": "not_selected",
113 "isClassFilteringActive": true,
114 "isAttrFilteringActive": false,
115 "isConfidenceFilteringActive": true,
116 "classSetInclusionMode": "include",
117 "classList": [
118 "staff"
119 ],
120 "attrList": [],
121 "attrSetInclusionMode": "include",
122 "confidenceThreshold": 0.5,
123 "confidenceOperator": ">=",
124 "referenceImage": null,
125 "sizeThreshold": 5,
126 "sizeThresholdOperator": "<=",
127 "zoneOperator": "in",
128 "zonePoints": [],
129 "detectionReferencePoint": "center",
130 "isZoneStatic": true,
131 "dynamicZone": null,
132 "runtimeParameter": null,
133 "parentClassName": "",
134 "confidenceAggregationMode": "max",
135 "confidenceAggregationOperator": ">=",
136 "confidenceAggregationThreshold": 0.5,
137 "comparator": "(Number) ==",
138 "comparisonType": "Statically",
139 "comparisonValue": "0",
140 "detectionsNumberOperator": "(Number) >=",
141 "detectionsNumberThreshold": 1,
142 "extractedImageProperty": "height",
143 "propertyValueOperator": ">=",
144 "referenceValue": 1,
145 "isReferenceValueStatic": true,
146 "nonImageInputOperation": "(Number) ==",
147 "isMultiLabel": false,
148 "multiLabelOperation": "==",
149 "isFilteringEnabled": false
150 }
151 },
152 "evaluation_parameters": {
153 "left": "$steps.detections_filter_2.predictions"
154 },
155 "next_steps": [
156 "$steps.bounding_box_visualization_1"
157 ],
158 "image": "$inputs.image"
159 },
160 {
161 "type": "core/bounding_box_visualization@v1",
162 "name": "bounding_box_visualization_1",
163 "comments": null,
164 "image": "$inputs.image",
165 "copy_image": true,
166 "predictions": "$steps.detections_filter_2.predictions",
167 "color_palette": "DEFAULT",
168 "palette_size": 10,
169 "custom_colors": [],
170 "color_axis": "CLASS",
171 "thickness": 2,
172 "roundness": 0
173 },
174 {
175 "type": "core/detections_filter@v1",
176 "name": "detections_filter_2",
177 "comments": null,
178 "predictions": "$steps.detections_filter_1.predictions",
179 "operations": [
180 {
181 "type": "DetectionsFilter",
182 "filter_operation": {
183 "type": "StatementGroup",
184 "statements": [
185 {
186 "type": "BinaryStatement",
187 "left_operand": {
188 "type": "DynamicOperand",
189 "operations": [
190 {
191 "type": "ExtractDetectionProperty",
192 "property_name": "class_name"
193 }
194 ]
195 },
196 "comparator": {
197 "type": "in (Sequence)"
198 },
199 "right_operand": {
200 "type": "StaticOperand",
201 "value": [
202 "staff"
203 ]
204 }
205 },
206 {
207 "type": "BinaryStatement",
208 "left_operand": {
209 "type": "DynamicOperand",
210 "operations": [
211 {
212 "type": "ExtractDetectionProperty",
213 "property_name": "confidence"
214 }
215 ]
216 },
217 "comparator": {
218 "type": "(Number) >="
219 },
220 "right_operand": {
221 "type": "StaticOperand",
222 "value": 0.5
223 }
224 }
225 ]
226 }
227 }
228 ],
229 "image": "$inputs.image",
230 "uistate": {
231 "operations": {
232 "filterBy": "class_confidence",
233 "parentClassName": "",
234 "objectClassEnabled": true,
235 "objectClassType": "include",
236 "objectClasses": "staff",
237 "attributeEnabled": false,
238 "attributeType": "include",
239 "attributes": "",
240 "confidenceEnabled": true,
241 "confidenceOperator": ">=",
242 "confidenceValue": 0.5,
243 "imageInput": "$inputs.image",
244 "detectionSizeOperator": "<=",
245 "detectionSizeValue": 5,
246 "detectionLocation": "in",
247 "detectionReferencePoint": "center",
248 "zoneDefinition": "Define in Editor",
249 "zonePoints": [],
250 "zoneJson": "[]"
251 }
252 }
253 },
254 {
255 "type": "core/label_visualization@v1",
256 "name": "label_visualization_1",
257 "comments": null,
258 "image": "$steps.bounding_box_visualization_1.image",
259 "copy_image": true,
260 "predictions": "$steps.detections_filter_2.predictions",
261 "color_palette": "DEFAULT",
262 "palette_size": 10,
263 "custom_colors": [],
264 "color_axis": "CLASS",
265 "text": "Class",
266 "text_position": "TOP_LEFT",
267 "text_color": "WHITE",
268 "text_scale": 1,
269 "text_thickness": 1,
270 "text_padding": 10,
271 "border_radius": 0
272 }
273 ],
274 "outputs": [
275 {
276 "type": "JsonField",
277 "name": "general_object_detection_1_1",
278 "coordinates_system": "own",
279 "selector": "$steps.general_object_detection_1.predictions"
280 },
281 {
282 "type": "JsonField",
283 "name": "event_saver_1_1",
284 "coordinates_system": "own",
285 "selector": "$steps.event_saver_1.error_status"
286 },
287 {
288 "type": "JsonField",
289 "name": "event_saver_1_2",
290 "coordinates_system": "own",
291 "selector": "$steps.event_saver_1.throttling_status"
292 },
293 {
294 "type": "JsonField",
295 "name": "event_saver_1_3",
296 "coordinates_system": "own",
297 "selector": "$steps.event_saver_1.message"
298 },
299 {
300 "type": "JsonField",
301 "name": "event_saver_1_4",
302 "coordinates_system": "own",
303 "selector": "$steps.event_saver_1.image_url"
304 },
305 {
306 "type": "JsonField",
307 "name": "event_saver_1_5",
308 "coordinates_system": "own",
309 "selector": "$steps.event_saver_1.video_url"
310 },
311 {
312 "type": "JsonField",
313 "name": "detections_filter_1_1",
314 "coordinates_system": "own",
315 "selector": "$steps.detections_filter_1.predictions"
316 },
317 {
318 "type": "JsonField",
319 "name": "bounding_box_visualization_1_1",
320 "coordinates_system": "own",
321 "selector": "$steps.bounding_box_visualization_1.image"
322 },
323 {
324 "type": "JsonField",
325 "name": "detections_filter_2_1",
326 "coordinates_system": "own",
327 "selector": "$steps.detections_filter_2.predictions"
328 },
329 {
330 "type": "JsonField",
331 "name": "label_visualization_1_1",
332 "coordinates_system": "own",
333 "selector": "$steps.label_visualization_1.image"
334 }
335 ]
336 }
337 }
灭火器存在检测
用途:检测特定区域是否存在灭火器;可用于发现灭火器缺失或被挪走。
- 组成与流程:
目标检测:检测灭火器;
目标跟踪与可视化:绘制框与标签;
越界/在区时长:统计灭火器离开区域的时间并聚合;
条件继续:当离区时长达到阈值(示例 3s)进入事件保存;
事件保存与仪表盘:保存图片/视频并在仪表盘展示。
查看工作流 JSON
1{
2 "name": "灭火器存在检测",
3 "category": "Construction Site",
4 "notes": {
5 "notes_cn": "使用通用目标检测模型检测图片特定区域中是否存在灭火器,需要用户自行配置区域坐标。",
6 "notes_en": "Use the general detection model to detect whether there is a fire extinguisher in the specific area of the image, need to configure the region coordinates by yourself."
7 },
8 "definition": {
9 "version": "1.0",
10 "inputs": [
11 {
12 "type": "WorkflowImage",
13 "name": "image"
14 }
15 ],
16 "steps": [
17 {
18 "type": "core/bounding_box_visualization@v1",
19 "name": "bounding_box_visualization_1",
20 "comments": null,
21 "image": "$inputs.image",
22 "copy_image": true,
23 "predictions": "$steps.highway_tracker_1.tracked_detections",
24 "color_palette": "DEFAULT",
25 "palette_size": 10,
26 "custom_colors": [],
27 "color_axis": "CLASS",
28 "thickness": 2,
29 "roundness": 0
30 },
31 {
32 "type": "daoai/general_obj_det@v1",
33 "name": "general_object_detection_1",
34 "comments": null,
35 "images": "$inputs.image",
36 "classes": [
37 "fire extinguisher"
38 ],
39 "confidence_threshold": 0.5,
40 "label_confidence_thresholds": null,
41 "max_detections": 100
42 },
43 {
44 "type": "core/label_visualization@v1",
45 "name": "label_visualization_1",
46 "comments": null,
47 "image": "$steps.bounding_box_visualization_1.image",
48 "copy_image": true,
49 "predictions": "$steps.highway_tracker_1.tracked_detections",
50 "color_palette": "DEFAULT",
51 "palette_size": 10,
52 "custom_colors": [],
53 "color_axis": "CLASS",
54 "text": "Class",
55 "text_position": "TOP_LEFT",
56 "text_color": "WHITE",
57 "text_scale": 1,
58 "text_thickness": 1,
59 "text_padding": 10,
60 "border_radius": 0
61 },
62 {
63 "type": "daoai/time_out_zone@v1",
64 "name": "time_out_of_zone_1",
65 "comments": null,
66 "image": "$inputs.image",
67 "detections": "$steps.highway_tracker_1.tracked_detections",
68 "zone": [],
69 "triggering_anchor": "CENTER",
70 "remove_in_zone_detections": true
71 },
72 {
73 "type": "core/property_definition@v1",
74 "name": "property_definition_1",
75 "comments": null,
76 "data": "$steps.time_out_of_zone_1.timed_detections",
77 "operations": [
78 {
79 "type": "DetectionsPropertyExtract",
80 "property_name": "time_out_of_zone"
81 },
82 {
83 "type": "NumericSequenceAggregate",
84 "function": "max"
85 }
86 ],
87 "image": "$inputs.image"
88 },
89 {
90 "type": "core/continue_if@v1",
91 "name": "continue_if_1",
92 "comments": null,
93 "condition_statement": {
94 "type": "StatementGroup",
95 "statements": [
96 {
97 "type": "BinaryStatement",
98 "left_operand": {
99 "type": "DynamicOperand",
100 "operand_name": "left"
101 },
102 "comparator": {
103 "type": "(Number) >="
104 },
105 "right_operand": {
106 "type": "StaticOperand",
107 "value": 3
108 }
109 }
110 ],
111 "operator": "and",
112 "uistate": {
113 "leftOperand": "$steps.property_definition_1.output",
114 "detectionsEvaluationProperty": "value",
115 "selectedFilterType": "not_selected",
116 "isClassFilteringActive": false,
117 "isAttrFilteringActive": false,
118 "isConfidenceFilteringActive": false,
119 "classSetInclusionMode": "include",
120 "classList": [],
121 "attrList": [],
122 "attrSetInclusionMode": "include",
123 "confidenceThreshold": 0.5,
124 "confidenceOperator": ">=",
125 "referenceImage": null,
126 "sizeThreshold": 5,
127 "sizeThresholdOperator": "<=",
128 "zoneOperator": "in",
129 "zonePoints": [],
130 "detectionReferencePoint": "center",
131 "isZoneStatic": true,
132 "dynamicZone": null,
133 "runtimeParameter": null,
134 "parentClassName": "",
135 "confidenceAggregationMode": "max",
136 "confidenceAggregationOperator": ">=",
137 "confidenceAggregationThreshold": 0.5,
138 "comparator": "(Number) ==",
139 "comparisonType": "Statically",
140 "comparisonValue": "0",
141 "detectionsNumberOperator": "(Number) >=",
142 "detectionsNumberThreshold": 1,
143 "extractedImageProperty": "height",
144 "propertyValueOperator": ">=",
145 "referenceValue": 1,
146 "isReferenceValueStatic": true,
147 "nonImageInputOperation": "(Number) ==",
148 "isMultiLabel": false,
149 "multiLabelOperation": "==",
150 "isFilteringEnabled": false
151 }
152 },
153 "evaluation_parameters": {
154 "left": "$steps.property_definition_1.output"
155 },
156 "next_steps": [
157 "$steps.event_saver_1"
158 ],
159 "image": "$inputs.image"
160 },
161 {
162 "type": "daoai/event_saver@v1",
163 "name": "event_saver_1",
164 "comments": null,
165 "event_type": "Fire Extinguisher Lost",
166 "image": "$steps.label_visualization_1.image",
167 "original_image": "$inputs.image",
168 "save_video": true,
169 "video_length_seconds": 30,
170 "cooldown_seconds": 20,
171 "cooldown_session_key": null,
172 "per_type_cooldown_seconds": 30
173 },
174 {
175 "type": "daoai/dashboard_visualization@v1",
176 "name": "dashboard_visualization_1",
177 "comments": null,
178 "image": "$steps.label_visualization_1.image"
179 },
180 {
181 "type": "daoai/highway_tracker@v1",
182 "name": "highway_tracker_1",
183 "comments": null,
184 "image": "$inputs.image",
185 "detections": "$steps.general_object_detection_1.predictions",
186 "track_activation_threshold": 0.25,
187 "lost_track_buffer": 15,
188 "minimum_matching_threshold": 0.7,
189 "minimum_consecutive_frames": 1,
190 "instances_cache_size": 16384
191 }
192 ],
193 "outputs": [
194 {
195 "type": "JsonField",
196 "name": "bounding_box_visualization_1_1",
197 "coordinates_system": "own",
198 "selector": "$steps.bounding_box_visualization_1.image"
199 },
200 {
201 "type": "JsonField",
202 "name": "general_object_detection_1_1",
203 "coordinates_system": "own",
204 "selector": "$steps.general_object_detection_1.predictions"
205 },
206 {
207 "type": "JsonField",
208 "name": "label_visualization_1_1",
209 "coordinates_system": "own",
210 "selector": "$steps.label_visualization_1.image"
211 },
212 {
213 "type": "JsonField",
214 "name": "time_out_of_zone_1_1",
215 "coordinates_system": "own",
216 "selector": "$steps.time_out_of_zone_1.timed_detections"
217 },
218 {
219 "type": "JsonField",
220 "name": "property_definition_1_1",
221 "coordinates_system": "own",
222 "selector": "$steps.property_definition_1.output"
223 },
224 {
225 "type": "JsonField",
226 "name": "event_saver_1_1",
227 "coordinates_system": "own",
228 "selector": "$steps.event_saver_1.error_status"
229 },
230 {
231 "type": "JsonField",
232 "name": "event_saver_1_2",
233 "coordinates_system": "own",
234 "selector": "$steps.event_saver_1.throttling_status"
235 },
236 {
237 "type": "JsonField",
238 "name": "event_saver_1_3",
239 "coordinates_system": "own",
240 "selector": "$steps.event_saver_1.message"
241 },
242 {
243 "type": "JsonField",
244 "name": "event_saver_1_4",
245 "coordinates_system": "own",
246 "selector": "$steps.event_saver_1.image_url"
247 },
248 {
249 "type": "JsonField",
250 "name": "event_saver_1_5",
251 "coordinates_system": "own",
252 "selector": "$steps.event_saver_1.video_url"
253 },
254 {
255 "type": "JsonField",
256 "name": "highway_tracker_1_1",
257 "coordinates_system": "own",
258 "selector": "$steps.highway_tracker_1.tracked_detections"
259 },
260 {
261 "type": "JsonField",
262 "name": "highway_tracker_1_2",
263 "coordinates_system": "own",
264 "selector": "$steps.highway_tracker_1.new_instances"
265 },
266 {
267 "type": "JsonField",
268 "name": "highway_tracker_1_3",
269 "coordinates_system": "own",
270 "selector": "$steps.highway_tracker_1.already_seen_instances"
271 }
272 ]
273 }
274 }
通用
发送HTTP消息
用途:当检测到目标(示例:人员)时,触发自定义 Python 生成消息并通过 Webhook 推送到外部系统。
- 组成与流程:
目标检测:检测人员;
条件继续:当检测数量 >= 1 时,进入后续步骤;
自定义模块:生成文本消息;
查看工作流 JSON
1{
2 "name": "外部消息触发",
3 "category": "Any Scene",
4 "notes": {
5 "notes_cn": "使用 custom python 和 webhook sink 将检测结果实时推送至外部系统,实现平台联动与事件通知,需要用户自行配置 url。",
6 "notes_en": "Use custom python and webhook sink to push the detection results to the external system in real time, achieving platform linkage and event notification, need to configure the url by yourself."
7 },
8 "definition":{
9 "version": "1.0",
10 "inputs": [
11 {
12 "type": "WorkflowImage",
13 "name": "image"
14 }
15 ],
16 "steps": [
17 {
18 "type": "daoai/general_detection_model@v1",
19 "name": "general_detection_model_fast_1",
20 "comments": null,
21 "images": "$inputs.image",
22 "classes": [
23 "person"
24 ],
25 "confidence_threshold": null,
26 "label_confidence_thresholds": null,
27 "precision": "fp32",
28 "image_size": "640"
29 },
30 {
31 "type": "core/continue_if@v1",
32 "name": "continue_if_1",
33 "comments": null,
34 "condition_statement": {
35 "type": "StatementGroup",
36 "statements": [
37 {
38 "type": "BinaryStatement",
39 "left_operand": {
40 "type": "DynamicOperand",
41 "operand_name": "left",
42 "operations": [
43 {
44 "type": "SequenceLength"
45 }
46 ]
47 },
48 "comparator": {
49 "type": "(Number) >="
50 },
51 "right_operand": {
52 "type": "StaticOperand",
53 "value": 1
54 }
55 }
56 ],
57 "operator": "and",
58 "uistate": {
59 "leftOperand": "$steps.general_detection_model_fast_1.predictions",
60 "detectionsEvaluationProperty": "detection_count",
61 "selectedFilterType": "not_selected",
62 "isClassFilteringActive": false,
63 "isAttrFilteringActive": false,
64 "isConfidenceFilteringActive": false,
65 "classSetInclusionMode": "include",
66 "classList": [],
67 "attrList": [],
68 "attrSetInclusionMode": "include",
69 "confidenceThreshold": 0.5,
70 "confidenceOperator": ">=",
71 "referenceImage": null,
72 "sizeThreshold": 5,
73 "sizeThresholdOperator": "<=",
74 "zoneOperator": "in",
75 "zonePoints": [],
76 "detectionReferencePoint": "center",
77 "isZoneStatic": true,
78 "dynamicZone": null,
79 "runtimeParameter": null,
80 "parentClassName": "",
81 "confidenceAggregationMode": "max",
82 "confidenceAggregationOperator": ">=",
83 "confidenceAggregationThreshold": 0.5,
84 "comparator": "(Number) ==",
85 "comparisonType": "Statically",
86 "comparisonValue": "0",
87 "detectionsNumberOperator": "(Number) >=",
88 "detectionsNumberThreshold": 1,
89 "extractedImageProperty": "height",
90 "propertyValueOperator": ">=",
91 "referenceValue": 1,
92 "isReferenceValueStatic": true,
93 "nonImageInputOperation": "(Number) ==",
94 "isMultiLabel": false,
95 "multiLabelOperation": "==",
96 "isFilteringEnabled": false
97 }
98 },
99 "evaluation_parameters": {
100 "left": "$steps.general_detection_model_fast_1.predictions"
101 },
102 "next_steps": [
103 "$steps.Warning",
104 "$steps.webhook_sink_1"
105 ],
106 "image": "$inputs.image"
107 },
108 {
109 "type": "Warning",
110 "name": "Warning",
111 "img": "$inputs.image"
112 },
113 {
114 "type": "core/webhook_sink@v1",
115 "name": "webhook_sink_1",
116 "comments": null,
117 "url": "",
118 "method": "POST",
119 "headers": {
120 "Content-Type": "application/json; charset=utf-8"
121 },
122 "json_payload": {
123 "text": "$steps.Warning.msg"
124 },
125 "json_payload_operations": {},
126 "request_timeout": 2,
127 "fire_and_forget": true,
128 "disable_sink": false,
129 "cooldown_seconds": 5,
130 "image": "$inputs.image"
131 }
132 ],
133 "outputs": [
134 {
135 "type": "JsonField",
136 "name": "general_detection_model_fast_1_1",
137 "coordinates_system": "own",
138 "selector": "$steps.general_detection_model_fast_1.predictions"
139 },
140 {
141 "type": "JsonField",
142 "name": "msg",
143 "coordinates_system": "own",
144 "selector": "$steps.Warning.msg"
145 },
146 {
147 "type": "JsonField",
148 "name": "webhook_sink_1_1",
149 "coordinates_system": "own",
150 "selector": "$steps.webhook_sink_1.error_status"
151 },
152 {
153 "type": "JsonField",
154 "name": "webhook_sink_1_2",
155 "coordinates_system": "own",
156 "selector": "$steps.webhook_sink_1.throttling_status"
157 },
158 {
159 "type": "JsonField",
160 "name": "webhook_sink_1_3",
161 "coordinates_system": "own",
162 "selector": "$steps.webhook_sink_1.message"
163 }
164 ],
165 "dynamic_blocks_definitions": [
166 {
167 "type": "DynamicBlockDefinition",
168 "manifest": {
169 "type": "ManifestDescription",
170 "description": "",
171 "block_type": "Warning",
172 "inputs": {
173 "img": {
174 "type": "DynamicInputDefinition",
175 "selector_types": [
176 "input_image",
177 "step_output_image"
178 ],
179 "selector_data_kind": {
180 "input_image": [
181 "image"
182 ],
183 "step_output_image": [
184 "image"
185 ]
186 }
187 }
188 },
189 "outputs": {
190 "msg": {
191 "type": "DynamicOutputDefinition",
192 "kind": [
193 "string"
194 ]
195 }
196 }
197 },
198 "code": {
199 "type": "PythonCode",
200 "run_function_code": "def run(self, img) -> BlockResult:\n # Todo: write your code here\n return {\"msg\": \"Pedestrian Detected\"}"
201 }
202 }
203 ]
204 }
205}
数据采集与标注
用途:检测目标并将统计结果通过 HTTP 协议发送到外部服务。 组成与流程:
目标检测:检测目标类别(car)。
自定义模块:发送 HTTP 请求,载荷包含 "number_of_cars_detected" 统计结果;
可视化:绘制检测框用于结果展示;
查看工作流 JSON
1{
2 "version": "1.0",
3 "inputs": [
4 {
5 "type": "WorkflowImage",
6 "name": "image"
7 }
8 ],
9 "steps": [
10 {
11 "type": "daoai/general_obj_det@v1",
12 "name": "general_object_detection_1",
13 "comments": null,
14 "images": "$inputs.image",
15 "classes": [
16 "car"
17 ],
18 "confidence_threshold": null,
19 "label_confidence_thresholds": null,
20 "max_detections": 100
21 },
22 {
23 "type": "Send_Http_Request",
24 "name": "Send Http Request",
25 "input_url": "http://206.12.6.247:9000",
26 "prediction": "$steps.general_object_detection_1.predictions"
27 },
28 {
29 "type": "core/bounding_box_visualization@v1",
30 "name": "bounding_box_visualization_1",
31 "comments": null,
32 "image": "$inputs.image",
33 "copy_image": true,
34 "predictions": "$steps.general_object_detection_1.predictions",
35 "color_palette": "DEFAULT",
36 "palette_size": 10,
37 "custom_colors": [],
38 "color_axis": "CLASS",
39 "thickness": 2,
40 "roundness": 0
41 }
42 ],
43 "outputs": [
44 {
45 "type": "JsonField",
46 "name": "general_object_detection_1_1",
47 "coordinates_system": "own",
48 "selector": "$steps.general_object_detection_1.predictions"
49 },
50 {
51 "type": "JsonField",
52 "name": "status_code",
53 "coordinates_system": "own",
54 "selector": "$steps.Send Http Request.status_code"
55 },
56 {
57 "type": "JsonField",
58 "name": "message",
59 "coordinates_system": "own",
60 "selector": "$steps.Send Http Request.message"
61 },
62 {
63 "type": "JsonField",
64 "name": "bounding_box_visualization_1_1",
65 "coordinates_system": "own",
66 "selector": "$steps.bounding_box_visualization_1.image"
67 }
68 ],
69 "dynamic_blocks_definitions": [
70 {
71 "type": "DynamicBlockDefinition",
72 "manifest": {
73 "type": "ManifestDescription",
74 "description": "sends http request to 3rd party service",
75 "block_type": "Send_Http_Request",
76 "inputs": {
77 "input_url": {
78 "type": "DynamicInputDefinition",
79 "selector_types": [
80 "input_parameter",
81 "step_output"
82 ],
83 "selector_data_kind": {
84 "input_parameter": [
85 "string"
86 ],
87 "step_output": [
88 "string"
89 ]
90 },
91 "value_types": [
92 "string"
93 ]
94 },
95 "prediction": {
96 "type": "DynamicInputDefinition",
97 "selector_types": [
98 "input_parameter",
99 "step_output"
100 ],
101 "selector_data_kind": {
102 "input_parameter": [
103 "object_detection_prediction"
104 ],
105 "step_output": [
106 "object_detection_prediction"
107 ]
108 }
109 }
110 },
111 "outputs": {
112 "status_code": {
113 "type": "DynamicOutputDefinition",
114 "kind": [
115 "integer"
116 ]
117 },
118 "message": {
119 "type": "DynamicOutputDefinition",
120 "kind": [
121 "string"
122 ]
123 }
124 }
125 },
126 "code": {
127 "type": "PythonCode",
128 "run_function_code": "import requests\nimport numpy as np\n\ndef run(self, input_url, prediction) -> BlockResult:\n url = input_url\n\n car_number = int(np.sum(prediction.data['class_name'] == \"car\"))\n payload = {\n \"number_of_cars_detected\": car_number\n }\n\n try:\n response = requests.post(\n url=url,\n json=payload,\n timeout=5\n )\n\n return {\n \"status_code\": response.status_code,\n \"message\": response.text\n }\n\n except Exception as e:\n return {\n \"status_code\": -1,\n \"message\": str(e)\n }\n"
129 }
130 }
131 ]
132}
多模型逻辑检测
用途:并行/串行运行多模型,通过与/或逻辑组合实现复杂条件判定和结果融合(需替换具体模型 UID)。
- 组成与流程:
检测模型 A:初始目标检测;
条件筛选 + 动态裁剪:对指定目标生成裁剪区域;
分类模型 B/C:对裁剪图进行分类;
类别替换与融合:将检测与分类结果融合,替换类别并组合为最终输出;
可视化:叠加框与标签用于展示。
查看工作流 JSON
1{
2 "name": "多模型逻辑检测",
3 "category": "Uncertain",
4 "notes": {
5 "notes_cn": "支持多模型并行执行或串行执行,通过与 / 或逻辑组合,实现复杂条件判断与多层级结果输出,需要用户自行替换模型。",
6 "notes_en": "Support parallel execution or serial execution of multiple models, through AND / OR logic combinations, to achieve complex condition judgment and multi-level result output, need to configure the model by yourself."
7 },
8 "definition": {
9 "version": "1.0",
10 "inputs": [
11 {
12 "type": "WorkflowImage",
13 "name": "image"
14 }
15 ],
16 "steps": [
17 {
18 "type": "daoai/daoai_world_model@v1",
19 "name": "daoai_world_model_1",
20 "comments": null,
21 "images": "$inputs.image",
22 "model_type": "detection",
23 "model_uid": "CcaHeNg6gLrjg1rFqtA_EA",
24 "confidence_threshold": null,
25 "label_confidence_thresholds": null
26 },
27 {
28 "type": "core/detections_filter@v1",
29 "name": "detections_filter_1",
30 "comments": null,
31 "predictions": "$steps.general_object_detection_1.predictions",
32 "operations": [
33 {
34 "type": "DetectionsFilter",
35 "filter_operation": {
36 "type": "StatementGroup",
37 "statements": [
38 {
39 "type": "BinaryStatement",
40 "left_operand": {
41 "type": "DynamicOperand",
42 "operations": [
43 {
44 "type": "ExtractDetectionProperty",
45 "property_name": "class_name"
46 }
47 ]
48 },
49 "comparator": {
50 "type": "in (Sequence)"
51 },
52 "right_operand": {
53 "type": "StaticOperand",
54 "value": [
55 "car"
56 ]
57 }
58 }
59 ]
60 }
61 }
62 ],
63 "image": "$inputs.image",
64 "uistate": {
65 "operations": {
66 "filterBy": "class_confidence",
67 "parentClassName": "",
68 "objectClassEnabled": true,
69 "objectClassType": "include",
70 "objectClasses": "car",
71 "attributeEnabled": false,
72 "attributeType": "include",
73 "attributes": "",
74 "confidenceEnabled": false,
75 "confidenceOperator": ">=",
76 "confidenceValue": 0.5,
77 "imageInput": "$inputs.image",
78 "detectionSizeOperator": "<=",
79 "detectionSizeValue": 5,
80 "detectionLocation": "in",
81 "detectionReferencePoint": "center",
82 "zoneDefinition": "Define in Editor",
83 "zonePoints": [],
84 "zoneJson": "[]"
85 }
86 }
87 },
88 {
89 "type": "core/continue_if@v1",
90 "name": "continue_if_1",
91 "comments": null,
92 "condition_statement": {
93 "type": "StatementGroup",
94 "statements": [
95 {
96 "type": "BinaryStatement",
97 "left_operand": {
98 "type": "DynamicOperand",
99 "operand_name": "left",
100 "operations": [
101 {
102 "type": "SequenceLength"
103 }
104 ]
105 },
106 "comparator": {
107 "type": "(Number) >="
108 },
109 "right_operand": {
110 "type": "StaticOperand",
111 "value": 1
112 }
113 }
114 ],
115 "operator": "and",
116 "uistate": {
117 "leftOperand": "$steps.detections_filter_1.predictions",
118 "detectionsEvaluationProperty": "detection_count",
119 "selectedFilterType": "not_selected",
120 "isClassFilteringActive": false,
121 "isAttrFilteringActive": false,
122 "isConfidenceFilteringActive": false,
123 "classSetInclusionMode": "include",
124 "classList": [],
125 "attrList": [],
126 "attrSetInclusionMode": "include",
127 "confidenceThreshold": 0.5,
128 "confidenceOperator": ">=",
129 "referenceImage": null,
130 "sizeThreshold": 5,
131 "sizeThresholdOperator": "<=",
132 "zoneOperator": "in",
133 "zonePoints": [],
134 "detectionReferencePoint": "center",
135 "isZoneStatic": true,
136 "dynamicZone": null,
137 "runtimeParameter": null,
138 "parentClassName": "",
139 "confidenceAggregationMode": "max",
140 "confidenceAggregationOperator": ">=",
141 "confidenceAggregationThreshold": 0.5,
142 "comparator": "(Number) ==",
143 "comparisonType": "Statically",
144 "comparisonValue": "0",
145 "detectionsNumberOperator": "(Number) >=",
146 "detectionsNumberThreshold": 1,
147 "extractedImageProperty": "height",
148 "propertyValueOperator": ">=",
149 "referenceValue": 1,
150 "isReferenceValueStatic": true,
151 "nonImageInputOperation": "(Number) ==",
152 "isMultiLabel": false,
153 "multiLabelOperation": "==",
154 "isFilteringEnabled": false
155 }
156 },
157 "evaluation_parameters": {
158 "left": "$steps.detections_filter_1.predictions"
159 },
160 "next_steps": [
161 "$steps.dynamic_crop_1"
162 ],
163 "image": "$inputs.image"
164 },
165 {
166 "type": "core/dynamic_crop@v1",
167 "name": "dynamic_crop_1",
168 "comments": null,
169 "images": "$inputs.image",
170 "predictions": "$steps.detections_filter_1.predictions",
171 "mask_opacity": 0,
172 "background_color": [
173 0,
174 0,
175 0
176 ],
177 "image": "$inputs.image"
178 },
179 {
180 "type": "daoai/daoai_world_model@v1",
181 "name": "daoai_world_model_2",
182 "comments": null,
183 "images": "$steps.dynamic_crop_1.crops",
184 "model_type": "classification",
185 "model_uid": "1P70R27Ubofnbh0D0sHWxA",
186 "confidence_threshold": null,
187 "label_confidence_thresholds": null,
188 "image": "$inputs.image"
189 },
190 {
191 "type": "core/detections_filter@v1",
192 "name": "detections_filter_2",
193 "comments": null,
194 "predictions": "$steps.general_object_detection_1.predictions",
195 "operations": [
196 {
197 "type": "DetectionsFilter",
198 "filter_operation": {
199 "type": "StatementGroup",
200 "statements": [
201 {
202 "type": "BinaryStatement",
203 "left_operand": {
204 "type": "DynamicOperand",
205 "operations": [
206 {
207 "type": "ExtractDetectionProperty",
208 "property_name": "class_name"
209 }
210 ]
211 },
212 "comparator": {
213 "type": "in (Sequence)"
214 },
215 "right_operand": {
216 "type": "StaticOperand",
217 "value": [
218 "people"
219 ]
220 }
221 }
222 ]
223 }
224 }
225 ],
226 "image": "$inputs.image",
227 "uistate": {
228 "operations": {
229 "filterBy": "class_confidence",
230 "parentClassName": "",
231 "objectClassEnabled": true,
232 "objectClassType": "include",
233 "objectClasses": "people",
234 "attributeEnabled": false,
235 "attributeType": "include",
236 "attributes": "",
237 "confidenceEnabled": false,
238 "confidenceOperator": ">=",
239 "confidenceValue": 0.5,
240 "imageInput": "$inputs.image",
241 "detectionSizeOperator": "<=",
242 "detectionSizeValue": 5,
243 "detectionLocation": "in",
244 "detectionReferencePoint": "center",
245 "zoneDefinition": "Define in Editor",
246 "zonePoints": [],
247 "zoneJson": "[]"
248 }
249 }
250 },
251 {
252 "type": "core/continue_if@v1",
253 "name": "continue_if_2",
254 "comments": null,
255 "condition_statement": {
256 "type": "StatementGroup",
257 "statements": [
258 {
259 "type": "BinaryStatement",
260 "left_operand": {
261 "type": "DynamicOperand",
262 "operand_name": "left",
263 "operations": [
264 {
265 "type": "SequenceLength"
266 }
267 ]
268 },
269 "comparator": {
270 "type": "(Number) >="
271 },
272 "right_operand": {
273 "type": "StaticOperand",
274 "value": 1
275 }
276 }
277 ],
278 "operator": "and",
279 "uistate": {
280 "leftOperand": "$steps.detections_filter_2.predictions",
281 "detectionsEvaluationProperty": "detection_count",
282 "selectedFilterType": "not_selected",
283 "isClassFilteringActive": false,
284 "isAttrFilteringActive": false,
285 "isConfidenceFilteringActive": false,
286 "classSetInclusionMode": "include",
287 "classList": [],
288 "attrList": [],
289 "attrSetInclusionMode": "include",
290 "confidenceThreshold": 0.5,
291 "confidenceOperator": ">=",
292 "referenceImage": null,
293 "sizeThreshold": 5,
294 "sizeThresholdOperator": "<=",
295 "zoneOperator": "in",
296 "zonePoints": [],
297 "detectionReferencePoint": "center",
298 "isZoneStatic": true,
299 "dynamicZone": null,
300 "runtimeParameter": null,
301 "parentClassName": "",
302 "confidenceAggregationMode": "max",
303 "confidenceAggregationOperator": ">=",
304 "confidenceAggregationThreshold": 0.5,
305 "comparator": "(Number) ==",
306 "comparisonType": "Statically",
307 "comparisonValue": "0",
308 "detectionsNumberOperator": "(Number) >=",
309 "detectionsNumberThreshold": 1,
310 "extractedImageProperty": "height",
311 "propertyValueOperator": ">=",
312 "referenceValue": 1,
313 "isReferenceValueStatic": true,
314 "nonImageInputOperation": "(Number) ==",
315 "isMultiLabel": false,
316 "multiLabelOperation": "==",
317 "isFilteringEnabled": false
318 }
319 },
320 "evaluation_parameters": {
321 "left": "$steps.detections_filter_2.predictions"
322 },
323 "next_steps": [
324 "$steps.dynamic_crop_2"
325 ],
326 "image": "$inputs.image"
327 },
328 {
329 "type": "core/dynamic_crop@v1",
330 "name": "dynamic_crop_2",
331 "comments": null,
332 "images": "$inputs.image",
333 "predictions": "$steps.detections_filter_2.predictions",
334 "mask_opacity": 0,
335 "background_color": [
336 0,
337 0,
338 0
339 ],
340 "image": "$inputs.image"
341 },
342 {
343 "type": "daoai/daoai_world_model@v1",
344 "name": "daoai_world_model_3",
345 "comments": null,
346 "images": "$steps.dynamic_crop_2.crops",
347 "model_type": "classification",
348 "model_uid": "1P70R27Ubofnbh0D0sHWxA",
349 "confidence_threshold": null,
350 "label_confidence_thresholds": null,
351 "image": "$inputs.image"
352 },
353 {
354 "type": "core/detections_classes_replacement@v1",
355 "name": "detections_classes_replacement_1",
356 "comments": null,
357 "object_detection_predictions": "$steps.general_object_detection_1.predictions",
358 "classification_predictions": "$steps.daoai_world_model_2.predictions",
359 "fallback_class_name": "unknown",
360 "fallback_class_id": null,
361 "image": "$inputs.image"
362 },
363 {
364 "type": "core/detections_classes_replacement@v1",
365 "name": "detections_classes_replacement_2",
366 "comments": null,
367 "object_detection_predictions": "$steps.general_object_detection_1.predictions",
368 "classification_predictions": "$steps.daoai_world_model_3.predictions",
369 "fallback_class_name": null,
370 "fallback_class_id": null,
371 "image": "$inputs.image"
372 },
373 {
374 "type": "core/detections_combine@v1",
375 "name": "detections_combine_1",
376 "comments": null,
377 "prediction_one": "$steps.detections_combine_2.predictions",
378 "prediction_two": "$steps.detections_classes_replacement_2.predictions",
379 "image": "$inputs.image"
380 },
381 {
382 "type": "core/bounding_box_visualization@v1",
383 "name": "bounding_box_visualization_1",
384 "comments": null,
385 "image": "$inputs.image",
386 "copy_image": true,
387 "predictions": "$steps.detections_combine_1.predictions",
388 "color_palette": "DEFAULT",
389 "palette_size": 10,
390 "custom_colors": [],
391 "color_axis": "CLASS",
392 "thickness": 2,
393 "roundness": 0
394 },
395 {
396 "type": "core/label_visualization@v1",
397 "name": "label_visualization_1",
398 "comments": null,
399 "image": "$steps.bounding_box_visualization_1.image",
400 "copy_image": true,
401 "predictions": "$steps.detections_combine_1.predictions",
402 "color_palette": "DEFAULT",
403 "palette_size": 10,
404 "custom_colors": [],
405 "color_axis": "CLASS",
406 "text": "Class",
407 "text_position": "TOP_LEFT",
408 "text_color": "WHITE",
409 "text_scale": 1,
410 "text_thickness": 1,
411 "text_padding": 10,
412 "border_radius": 0
413 },
414 {
415 "type": "daoai/general_obj_det@v1",
416 "name": "general_object_detection_1",
417 "comments": null,
418 "images": "$inputs.image",
419 "classes": [
420 "car",
421 "people"
422 ],
423 "confidence_threshold": 0.25,
424 "label_confidence_thresholds": null,
425 "max_detections": 100,
426 "image": "$inputs.image"
427 },
428 {
429 "type": "core/detections_combine@v1",
430 "name": "detections_combine_2",
431 "comments": null,
432 "prediction_one": "$steps.detections_classes_replacement_1.predictions",
433 "prediction_two": "$steps.daoai_world_model_1.predictions",
434 "image": "$inputs.image"
435 }
436 ],
437 "outputs": [
438 {
439 "type": "JsonField",
440 "name": "daoai_world_model_1_1",
441 "coordinates_system": "own",
442 "selector": "$steps.daoai_world_model_1.predictions"
443 },
444 {
445 "type": "JsonField",
446 "name": "detections_filter_1_1",
447 "coordinates_system": "own",
448 "selector": "$steps.detections_filter_1.predictions"
449 },
450 {
451 "type": "JsonField",
452 "name": "dynamic_crop_1_1",
453 "coordinates_system": "own",
454 "selector": "$steps.dynamic_crop_1.crops"
455 },
456 {
457 "type": "JsonField",
458 "name": "dynamic_crop_1_2",
459 "coordinates_system": "own",
460 "selector": "$steps.dynamic_crop_1.predictions"
461 },
462 {
463 "type": "JsonField",
464 "name": "daoai_world_model_2_1",
465 "coordinates_system": "own",
466 "selector": "$steps.daoai_world_model_2.predictions"
467 },
468 {
469 "type": "JsonField",
470 "name": "detections_filter_2_1",
471 "coordinates_system": "own",
472 "selector": "$steps.detections_filter_2.predictions"
473 },
474 {
475 "type": "JsonField",
476 "name": "dynamic_crop_2_1",
477 "coordinates_system": "own",
478 "selector": "$steps.dynamic_crop_2.crops"
479 },
480 {
481 "type": "JsonField",
482 "name": "dynamic_crop_2_2",
483 "coordinates_system": "own",
484 "selector": "$steps.dynamic_crop_2.predictions"
485 },
486 {
487 "type": "JsonField",
488 "name": "daoai_world_model_3_1",
489 "coordinates_system": "own",
490 "selector": "$steps.daoai_world_model_3.predictions"
491 },
492 {
493 "type": "JsonField",
494 "name": "detections_classes_replacement_1_1",
495 "coordinates_system": "own",
496 "selector": "$steps.detections_classes_replacement_1.predictions"
497 },
498 {
499 "type": "JsonField",
500 "name": "detections_classes_replacement_2_1",
501 "coordinates_system": "own",
502 "selector": "$steps.detections_classes_replacement_2.predictions"
503 },
504 {
505 "type": "JsonField",
506 "name": "detections_combine_1_1",
507 "coordinates_system": "own",
508 "selector": "$steps.detections_combine_1.predictions"
509 },
510 {
511 "type": "JsonField",
512 "name": "bounding_box_visualization_1_1",
513 "coordinates_system": "own",
514 "selector": "$steps.bounding_box_visualization_1.image"
515 },
516 {
517 "type": "JsonField",
518 "name": "label_visualization_1_1",
519 "coordinates_system": "own",
520 "selector": "$steps.label_visualization_1.image"
521 },
522 {
523 "type": "JsonField",
524 "name": "general_object_detection_1_1",
525 "coordinates_system": "own",
526 "selector": "$steps.general_object_detection_1.predictions"
527 },
528 {
529 "type": "JsonField",
530 "name": "detections_combine_2_1",
531 "coordinates_system": "own",
532 "selector": "$steps.detections_combine_2.predictions"
533 }
534 ]
535 }
536}