Skip to content

Volume 4: Pipeline Orchestration

Estimated time: 35–50 minutes Goal: Understand the internal structure of scenario tasks, learn to modify existing pipelines, and build new scenario tasks from scratch using built-in capabilities Prerequisites: Completed Volume 2: Scenario Configuration and Volume 3: VLM / DINO Guide; familiar with video sources, service assignment, live preview, and alarm records No extra environment needed: This tutorial only uses built-in capabilities — no Docker or model conversion involved

In the first three volumes, you learned two things:

  1. How to configure common detection scenarios using built-in CV algorithms.
  2. How to define new detection rules using VLM / DINO.

But up to this point, you've mainly been "using pre-built capabilities."

This tutorial takes you one level deeper: understanding how those capabilities are organized, and learning to orchestrate them yourself.

Three progressive chapters:

  • Chapter 1: Read and understand existing scenario task internals
  • Chapter 2: Modify an existing scenario task
  • Chapter 3: Build a new scenario task from scratch

Note

This tutorial covers "how to organize capabilities." The next tutorial, Volume 5: Model Porting, covers "how to bring in new third-party model capabilities."

Learning Path

plain
Read and understand existing scenario tasks

Make small modifications to existing tasks

Build new scenario tasks by referencing existing structure

After completing this tutorial, you'll be able to:

  • Understand what a scenario task does internally
  • Judge where a given node belongs in the pipeline
  • Independently add, remove, and reconfigure nodes
  • Build new business logic using built-in capabilities

Chapter 1: Understanding Scenario Task Pipelines

In the Scenario Configuration Guide, you primarily worked on the "Service Assignment" page — selecting algorithms, drawing regions, and tuning parameters. Behind the scenes, each of these operations maps to a scenario task pipeline.

Each scenario task is essentially a processing chain:

plain
Input → Inference → Logic → Output

This chapter is read-only — no modifications.

1.1 Open the "No Hard Hat" Scenario Task

  1. Navigate to Scenario Tasks.

  1. Find No Hard Hat.

  1. Click Pipeline Orchestration.

You'll see a complete node chain — this is the internal structure of the "No Hard Hat" scenario.

1.2 Common Node Types

Input Nodes

NodePurposeNotes
Video DecodeDecodes a video stream into individual framesStarting point for nearly every scenario task

Inference Nodes

NodePurposeNotes
Object DetectionLocates targets in the framee.g., pedestrian detection, hard hat detection
Object ClassificationRe-classifies detected targetse.g., determining hard hat status
TrackingAssigns stable IDs to targetsMaintains identity across frames
Vision Language ModelPerforms state judgment on imagese.g., "Is the door open or closed?"
Detection Vision ModelDetects targets from text promptse.g., "garbage bin," "fire cabinet"

Logic Nodes

NodePurposeNotes
Category FilterKeeps only specified classesDrops irrelevant detection results
Size FilterFilters targets that are too small or largeEliminates noise from distant small objects
Region JudgmentChecks if a target is inside a defined regionCorresponds to the detection regions drawn in Volume 2
Line CrossingChecks if a target crosses a defined lineUsed for pedestrian flow counting
Sensitivity CalculationRequires multiple consecutive hits before triggeringReduces single-frame false positives

Output Nodes

NodePurposeNotes
Event ReportingGenerates alarm eventsVisible in the alarm records

Tip

You don't need to memorize every node. A more efficient approach: find the closest built-in scenario task and modify it.

1.3 How Data Flows Between Nodes

Looking at the "No Hard Hat" pipeline, data flows roughly like this:

plain
Video Decode
  ↓ Output: individual frames
Object Detection (pedestrian detection)
  ↓ Output: bounding boxes + classes + confidence
Object Tracking
  ↓ Output: bounding boxes + classes + confidence + track sequence
Category Filter
  ↓ Output: only the target class retained
Object Classification (hard hat classification)
  ↓ Output: hard hat status for each person
Sensitivity Calculation
  ↓ Output: triggers alarm only after consecutive hits
Event Reporting
  ↓ Output: structured alarm event
Video Visualization Overlay
  ↓ Output: bounding boxes, labels, and alerts on the live feed

Once you understand this flow, most scenario tasks become readable:

  • Each node consumes the output of the previous node.
  • Each node does exactly one thing.
  • Node order directly affects the final result.

1.4 Principles for Node Ordering

When orchestrating pipelines, follow these guidelines:

  1. Filter invalid results as early as possible. For example, targets that are too small should be filtered before they reach classification or complex logic nodes.
  2. Generate targets first, then apply rules. Region judgment, line crossing, and sensitivity all require upstream detection results.
  3. If you want results visible in the live preview, you typically need a visualization overlay node. Event reporting alone will generate alarm records, but won't show bounding boxes on screen.

Chapter 2: Modifying an Existing Scenario Task

Let's make a practical improvement to the "No Hard Hat" pipeline we examined earlier.

Scenario Description

In the hard hat detection scenario from Volume 2, distant and very small pedestrians sometimes get detected. But these targets have too few pixels for reliable classification, leading to false positives. The fix: add a Size Filter node to the pipeline, so the system automatically ignores targets that are too small.

2.1 Add a Category Filter Node

Continuing from Section 1.1, add a size filter between Object Detection and Object Tracking.

  1. Click the add button between Object Detection and Object Tracking.

  1. Click Add Component.

Components are organized into two categories:

  • Algorithm Actions: Model-related components (object detection, feature extraction, etc.)
  • Business Processing: Workflow components (video decode, event reporting, etc.)
  1. Select the Category Filter component.

The Category Filter node is inserted at the expected position.

Why here?

The goal of size filtering is to eliminate invalid targets as early as possible. Waiting until after tracking, classification, or downstream rule processing wastes compute and increases false positives.

  1. Configure the business logic

    Click the Category Filter component to expand its configuration panel.

The Category Filter component has these settings:

  • Target Label: Select which labels to keep.
  • Enable Minimum Size: Toggle minimum size filtering on/off.

Set the target label to Pedestrian — only pedestrian results pass through; all other labels are dropped.

Enable Minimum Size — detection results below this threshold will be discarded.

The default minimum size is 60×60 pixels. You can customize this value.

2.2 Configure Key Parameters

Minimum size filtering principle: When set to 60, any detection target with an area smaller than 60×60 pixels will be filtered out.

Click Parameter Configuration to open the parameter settings page.

Set Minimum Pedestrian Size to 40, meaning the minimum target area is 40×40 pixels.

Tuning advice

Start by setting the minimum size to 100 to see if it's too aggressive. Then gradually decrease to 40–60 to find the optimal balance for your scenario.

2.4 Save and Verify

  1. Click Save.

  1. Go to Video SourcesService Assignment and find the No Hard Hat channel.

  1. Start the No Hard Hat service.

  1. Go to Live Preview to observe the changes.

Select the Construction Site North Channel and enter full screen.

Algorithm overlay visualization:

Results analysis:

  • Distant, excessively small pedestrians (red box highlighted) are now noticeably fewer.
  • Nearby, clearly visible targets still detect and classify normally.
  • False positive count has decreased.

You've completed your first scenario task modification. This pattern will come up repeatedly:

plain
Open existing scenario task → Add/remove nodes → Configure parameters → Save → Verify

Chapter 3: Building a New Scenario Task from Scratch

Chapters 1 and 2 covered "reading" and "modifying." This chapter tackles "building."

We'll still follow the "reference existing structure" method rather than starting from a completely blank slate.

Scenario Description

Create a new Zone Intrusion Detection scenario task:

  • Detect people in the frame
  • Determine whether they've entered a specified zone
  • Trigger an alarm after consecutive detections
  • Display bounding boxes and labels in the live preview

Two advantages of this example:

  • Uses only built-in capabilities — low barrier to entry
  • Covers the complete loop: detection + zone rules + alarm + visualization

3.1 Create a New Algorithm

  1. Navigate to Scenario Tasks.

  1. Click New Task.

  1. Fill in the basic information:
FieldValue
Task NameZone Intrusion Detection
Data Source TypeVideo Analysis
Task TypeDetection/Analysis

Click OK to save.

3.2 Build the Pipeline

Preparation

Click Pipeline Orchestration to enter the blank orchestration page.

An empty pipeline contains only the Start and End nodes.

The plus button between nodes is used to add components.

Click the plus button to see the operation options. Add Component inserts algorithm components.

Click Add Component to open the component panel. For detailed component information, see Appendix A: Node Quick Reference.

Add nodes in the following order:

plain
Video Decode → Object Detection → Object Tracking → Region Judgment → Sensitivity Calculation → Event Reporting

Step 1: Add Video Decode

The Video Decode node is the starting point for every scenario task. It converts a video stream into individual frames.

Business logic configuration: Click Video Decode to view configuration options. Video decode has no configurable parameters, so the panel is empty.

Step 2: Add Object Detection

Decoded frames are fed into the object detection model, which outputs target positions and class information.

Business logic configuration:

  • Base Model: PedestrianDetection (Pedestrian Detection Model)
  • Select Label: Pedestrian
  • Custom Frame Rate: Enabled

Step 3: Add Object Tracking

Track detected targets across frames so the same person maintains a consistent identity, providing stable IDs for downstream business logic.

Business logic configuration:

  • Label Filter: PedestrianDetection — track this label
  • State Judgment: Motion state
  • Deformation Judgment: Not required

Step 4: Add Region Judgment

Draw a zone that defines the intrusion boundary — entering this zone triggers an alarm event.

Business logic configuration:

  • Region Alarm Statistic Mode: Count limit (for absence/gathering detection)
  • Input Region Type: Primary region

Step 5: Add Sensitivity Calculation

Single-frame alarms have high false positive rates. Sensitivity calculation requires multiple consecutive frame hits before triggering, significantly reducing noise.

Business logic configuration:

Step 6: Add Event Reporting

Generated alarm events are reported to the system for statistical analysis and real-time push notifications.

Business logic configuration:

  • Target tracking: With target tracking
  • Video clip for trigger events: Enabled
  • Video clip for scheduled events: Disabled
  • Large model review: Disabled

The complete Zone Intrusion Detection pipeline is now configured. Next, we'll set the detailed control parameters for each node.

3.4 Configure Key Parameters

In the previous section, the pipeline was built using default parameter values. To achieve high accuracy and low false positive rates, fine-grained parameter tuning is essential.

Click Parameter Configuration to switch to the parameters page.

Object Detection Node

ParameterRecommended ValueNotes
Confidence Threshold0.5Adjustable up or down as needed
Confidence Offset0Adjusts confidence boundary
Detection ModeBottomDefines which point of the bounding box determines zone entry. "Bottom" uses foot position — most appropriate for intrusion detection. Can also be set to center or top

Tracking Algorithm

ParameterRecommended ValueNotes
Track History Frames10Track must persist for N frames before it's considered valid
Static Threshold80If tracking overlap exceeds 80%, the target is considered stationary
Track Radius2.3Track targets within 2.3m; beyond this, the target is considered lost

Region Alarm Judgment

ParameterRecommended ValueNotes
Target Count in Region0Triggers alarm when target count exceeds (or falls below) this number
Target Count Limit TypeAlarm when above target countAlarm condition — used for target presence, gathering, etc.
Detection Time
Detection Time Unit

Sensitivity Calculation Node

ParameterRecommended ValueNotes
Sensitivity Hit Count3Triggers after 3 consecutive hits
Sensitivity Total Count10Evaluated within a 10-frame window

Event Reporting Node

ParameterRecommended ValueNotes
Alarm Interval3Minimum seconds between re-alarms for the same target
Alarm Count1Max repeated alarms per target — prevents excessive records
Static Object DedupEnabledStationary objects can trigger many repeated alarms — enabling dedup prevents this
Static Overlap Ratio0.2Overlap threshold for considering a target stationary
Static Dedup Duration6Maximum dedup window (hours)
Panoramic Trajectory OverlayDisabledOptional trajectory visualization

3.5 Assign to a Video Channel and Test

  1. Create a video channel.

    Click Video Sources to enter the channel page.

Create a new channel and upload a video.

  1. Open Service Assignment.

  1. Select the Zone Intrusion Detection task you just created.

  1. Draw the detection region.

Click Add Region.

Adjust the region to the desired position.

  1. Configure the runtime strategy.

Set play count to 0 for looping playback.

  1. Save and start the service.

3.6 Verify Results

Go to Live Preview and Alarm Records to check the output.

  1. Click Live Preview to enter the display page.

  1. Select the Street Corner Camera channel.

  1. Enable visualization overlay.

  1. Alarm notification popup.

Results analysis:

  • When a person enters the defined zone, bounding boxes and labels appear on the live feed.
  • Alarms trigger only after consecutive hits — not on a single frame.
  • Alarm records show the corresponding events.
  1. Alarm records.

You've now completed your first scenario task built from scratch.

Appendix

A. Node Quick Reference

WARNING

Coming soon.

B. Node Parameter Quick Reference

Node TypeCommon ParametersDefault / RecommendedNotes
Video DecodeDecode methodHardware decodeUsually no changes needed
Object DetectionModel / confidence threshold0.5Results below threshold are dropped
Object TrackingMax lost frames30How long before releasing an ID
Size FilterMin width / min height00 means no filtering
Region JudgmentJudgment methodBottom center pointDetermines if target is in region
SensitivityHit threshold / window size3 / 10Multi-frame accumulation before trigger
Event ReportingAlarm type / alarm interval60 secRe-alarm interval for the same target

C. Common Pipeline Troubleshooting

ProblemPossible CauseSolution
Service won't start after savingNodes not properly connectedCheck that all nodes are linked end-to-end
No bounding boxes in live previewMissing visualization overlay nodeAdd a visualization overlay at the end
Boxes visible but no alarmsEvent reporting node missing or sensitivity threshold not metCheck the reporting node and threshold settings
Too many alarmsMissing sensitivity node or threshold too lowRaise the sensitivity threshold
Too many false positivesNo size filter or detection region too broadTighten the filter and shrink the region

D. Common Pipeline Templates

Detection-Only Pipeline

plain
Video Decode → Object Detection → Object Tracking → Event Reporting → Video Visualization Overlay

Good for: Pure object detection, foreign object detection, vehicle detection, etc.

Detection + Rule Pipeline

plain
Video Decode → Object Detection → Object Tracking → Region/Line Judgment → Sensitivity → Event Reporting → Video Visualization Overlay

Good for: Zone intrusion, perimeter detection, pedestrian flow counting, etc.

Detection + Classification Pipeline

plain
Video Decode → Object Detection → Object Tracking → Category Filter → Object Classification → Sensitivity → Event Reporting → Video Visualization Overlay

Good for: Hard hat, work uniform, smoking, phone usage detection, etc.

What's Next

If you've mastered this tutorial's content, the next step is:

  • Volume 5: Model Porting

Which addresses another critical question: How to port third-party models to the device and integrate them into your own scenario tasks.

Released under the Apache 2.0 License.