Run Demos

This topic describes running Tappas and NpuDetectorLib demos.

System Configuration

Before running demos, apply the following configurations.

Table 1. Configurations Before Demo
Configuration Item Details
Set CPU performance mode Run the following command as root to disable CPU frequency scaling for consistent inference performance.
$ su -
$ echo performance > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
Enable HailoRT Monitor

Optional

Enable HailoRT monitor to monitor real-time NPU utilization, active models, and FPS output.
  1. Start the monitor in a separate terminal.
    $ hailortcli monitor
  2. In the terminal where you will run demos, enable monitoring.
    $ export HAILO_MONITOR=1
    When running a demo, HailoRT detects the HAILO_MONITOR variable and displays real-time NPU statistics.
Wayland Display Compatibility

Applicable to Tappas demos only.

The Tappas demos use xvimagesink or ximagesink as the GStreamer video sink by default. However, Debian on VisionFive 2/VisionFive 2 Lite uses the Wayland display protocol. Before running Tappas demos, modify the startup scripts to use the Wayland-compatible sink.

In each demo's startup script (.sh file), replace the video-sink element:
- video-sink = "xvimagesink"
+ video-sink = "waylandsink"
Note: If you skip this configuration, the demos fail with a display sink error.

Run Tapps Demos

Tappas provides pre-built GStreamer pipelines for common AI vision tasks. The demos are located under /home/user/tappas/apps/h8/gstreamer/vf2/.

Table 2. Demo Cases
Demo Case Command
Instance Segmentation
$ cd /home/user/tappas/apps/h8/gstreamer/vf2/instance_segmentation/
$ ./instance_segmentation.sh -i /dev/video4
Object Detection
$ cd /home/user/tappas/apps/h8/gstreamer/vf2/instance_segmentation/
$ ./instance_segmentation.sh -i /dev/ video4-- video4

The -network flag selects the YOLOv5 model for detection.

Network Cascading (Object Detection + Pose Estimation)
$ cd /home/user/tappas/apps/h8/gstreamer/vf2/cascading_networks/
./object_detection_and_pose_estimation.sh -i /dev/video4
Note: If you encounter a TAPPAS-WORKSPACE error, set the environment variable:
export TAPPAS-WORKSPACE=path_to-tappas/tappas/
where path_to-tapps is the actual Tappas source directory path.

Run NpuDetectorLib Demo

NpuDetectorLib is a lightweight C++ inference library for running HEF models on the Hailo NPU.

To run the NpuDetectorLib demo:
  1. Download and compile NpuDetectorLib.
    $ tar -xvf NpuDetectorLib.tar
    $ cd NpuDetectorLib
    $ cmake -H. -Bbuild -DSHOW_LABEL=ON -DBUILD_TESTER=ON
    $ cmake --build build
  2. Download the YOLOv8 model.
    wget -O models/yolov8s_nms.hef \
        https://hailo-model-zoo.s3.eu-west-2.amazonaws.com/ModelZoo/Compiled/v2.13.0/hailo8l/yolov8s.hef
  3. Run the object detection demo.
    ./build/tests/TestExecutable -i /dev/video4 -m models/yolov8s_nms.json -a yolov8_nms