Understand Step Data Flow
This section introduces data flow in Mech-Vision projects, including data types, data dimensions, framework loops, and common troubleshooting methods.
What Is Data Flow?
In Mech-Vision, each Step can be viewed as an algorithmic processing unit: it receives input, performs computation, and outputs results. After multiple Steps are connected through ports, data is passed along the connection direction to form a complete data flow.
When connecting ports, focus on two key factors: Data Type and Data Dimensions.
|
Data flow is used to transfer processing data, while control flow determines whether a Step runs. For control flow details, see Understand Control Flow. |
Data Type
Data type describes the form of data transmitted through ports, such as images, point clouds, poses, and numeric values.
When building data flow, the data types of input ports and output ports must be compatible. Otherwise, connections cannot be created. For connection operations, see Create/Delete Connections.
|
When debugging a project, you can use Run Steps and View Outputs to confirm whether the output data type of an upstream Step matches the expected input type of a downstream Step. |
Data Dimensions
Data dimensions represent the structural hierarchy of data.
-
Port declared dimensions
Indicates the data dimensions that a port expects to receive or output. Dimensions are usually represented by
[]after the data type.For example:
-
Pose: zero-dimensional data; -
Pose []: one-dimensional data; -
Pose [][]: two-dimensional data. -
Actual input/output data dimensions
Indicates the data dimensions actually transmitted through a port during Step execution. Actual dimensions may be greater than, equal to, or less than the port’s declared dimensions.
Framework Loop
When the actual input data dimensions are greater than the port’s declared dimensions, the Step processes input data level by level. This process is called a framework loop.
When a Step has multiple input ports, the loop levels across all ports must be aligned during execution. Otherwise, the Step may not run as expected.
Loop Depth
Loop depth indicates how many levels a Step needs to iterate when processing data at a port. It can be understood as:
Loop depth = Actual input data dimensions - Port declared dimensions
When loop depths are inconsistent across multiple input ports of a Step, you usually need to align them by adjusting dimensions or enabling Reuse Input.
Increase or Decrease Dimensions
When loop depths are inconsistent across ports, you can perform dimension-increase or dimension-decrease operations on data connections to adjust the data structure and make inputs easier to align.
-
Increase Dimension by Slicing: Increase data dimensions by one level.
-
Decrease Dimension by Merging: Decrease data dimensions by one level.
|
Actual availability depends on whether current data is in a list structure and on the Step’s processing capability. If increasing or decreasing dimensions cannot solve the issue, consider Reuse Input. |
Reuse Input
When data at a port cannot or should not be increased or decreased in dimensions, you can enable Reuse Input to repeatedly use lower-dimensional or smaller-count input data during loop execution, helping the Step continue to run.
This parameter is under the Execution Flags group in the Step Parameters panel. For details, see Learn about Step Common Parameters.
Auto Increase Dimensions
When actual input data dimensions are smaller than the port’s declared dimensions, the system attempts to automatically increase dimensions so that input can meet the Step’s basic dimension requirements.
Auto dimension increase is an automatic runtime behavior and differs from manual Increase Dimension by Slicing in trigger conditions and processing logic.
Top-Level Dimensions
Some Steps have input ports without fixed declared dimensions. These ports can directly inherit the dimensions of upstream input data as their processing basis. This can be understood as top-level dimension input.
During project debugging, if a port’s dimensions are inconsistent with expectations, first check its upstream output structure and whether the port uses this input mode.
Troubleshooting
Loop Depth Mismatch
Symptom:
When running a Step or project, a message indicates that loop levels across multiple input ports are inconsistent.
Solutions:
-
Check actual data structures at each input port and verify whether upstream outputs are as expected.
-
Try Increase Dimension by Slicing or Decrease Dimension by Merging on data connections to align loop depths across ports.
-
Enable Reuse Input when applicable to help align inputs.
Data Count Mismatch
Symptom:
When running a Step or project, a message indicates that data counts across multiple input ports are inconsistent.
Solutions:
-
Check data count and data organization in upstream Step outputs.
-
For ports with fewer data items, try enabling Reuse Input.
-
If necessary, combine dimension adjustment with Reuse Input.
Cannot Increase Dimensions via Slicing
Symptom:
After enabling Increase Dimension by Slicing on a data connection, the Step or project still reports that dimensions cannot be increased.
Possible causes:
-
Current input data is not a list structure that can be sliced.
-
The resulting dimensions exceed the range that the current Step can process.
Solutions:
-
Disable Increase Dimension by Slicing and check upstream output structure.
-
Use Reuse Input instead, or adjust how upstream Step outputs are organized.
Cannot Decrease Dimensions via Merging
Symptom:
After enabling Decrease Dimension by Merging on a data connection, the Step or project still reports that dimensions cannot be decreased.
Possible causes:
-
Current input is already zero-dimensional and cannot be reduced further.
-
Current input data is not a list structure that can be merged.
Solutions:
-
Disable Decrease Dimension by Merging and check upstream output structure.
-
Use Reuse Input instead, or adjust how upstream Step outputs are organized.