Rockchip · AI & Linux Hub

AI inference

Why a Rockchip NPU can report 30 FPS and still show stale frames

Throughput describes how many frames are processed per second, and end-to-end latency describes how old a frame is.

The Rockchip visual program, which continuously outputs 30 FPS, is entirely possible to display the scene hundreds of milliseconds ago. Alarms or human-computer interaction items should be counted from the time of collection to the time the results are displayed or the message is sent.

Post a timestamp to the same frame

Record collection, enqueuing, inference start, inference end and output time. Use the same monotonic clock and pass the frame number. When the camera has its own clock, the clock domain needs to be specified, otherwise the timestamps of the two devices cannot be directly subtracted.

Estimating backlog using queue depth

Taking a uniform input of 30 frames per second as an example, a backlog of 9 frames corresponds to an input time span of approximately 300 milliseconds. If the model execution only takes more than ten milliseconds but the result is still half a beat slower, first check the queue length and frame loss strategy of decoding, display or network transmission.

Choose according to task definition

Real-time preview can take the latest frame first. Tasks that require frame-by-frame storage should design capacity, disk placement, and backpressure. Only by recording the high-percent delay, number of frames processed, and number of discarded frames can we judge whether “faster picture” sacrifices the integrity required by the business.

The delay that can be separated from the four timestamps

time period Description
Collect to join the team Driver delivery and preprocessing
Join the team to start inference Scheduling waiting or backlog
Reasoning from start to completion Model operation
Complete to output Post-processing and display or transmission

Board documentation and references

ArmSoM Sige7

Products and development resources

Check the hardware revision, carrier, image and interfaces in the product documentation. An article association is not evidence that a configuration has been tested.

Explore this topic → · Learning paths →