Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

meta-hailo-apps

Yocto meta layer for building Hailo C++ inference applications on Astrial (NXP i.MX8MP) with the Hailo-8 AI accelerator. Based on the System Electronics scarthgap BSP branch.

Applications included

App Binary Description
object_detection object_detection Generic object detection
instance_segmentation instance_segmentation Instance segmentation with masks
classification classifier Image classification
semantic_segmentation semantic_segmentation Per-pixel scene segmentation
pose_estimation pose_estimation Human pose estimation
oriented_object_detection oriented_obj_det Object detection with rotation angles
depth_estimation_mono mono_depth_estimation Monocular depth estimation
depth_estimation_stereo stereo_depth_estimation Stereo depth estimation
onnxrt_hailo_pipeline onnxrt_hailo_pipeline Hailo inference + ONNX Runtime postprocessing

Option 1: Default Setup (Fresh Build)

This is the standard way to include meta-hailo-apps when setting up a new build from scratch using the Astrial manifest.

Before running the build, add the majedabu remote and meta-hailo-apps project to your local manifest at .repo/local_manifests/astrial-6.6.52.xml:

<remote fetch="https://github.com/majedabu" name="majedabu"/>
<project name="meta-hailo-apps" remote="majedabu" revision="main" path="sources-extra/meta-hailo-apps"/>

Then sync and add the layer to bblayers.conf before starting the full image build:

repo sync sources-extra/meta-hailo-apps
echo 'BBLAYERS += "${BSPDIR}/sources-extra/meta-hailo-apps"' >> build/conf/bblayers.conf
bitbake system-astrial-image

Option 2: Adding to an Existing Build

If you already have a built Astrial image and want to add meta-hailo-apps without rebuilding from scratch, follow these steps.

1. Update the Local Manifest

Add the majedabu remote and meta-hailo-apps project to .repo/local_manifests/astrial-6.6.52.xml:

<remote fetch="https://github.com/majedabu" name="majedabu"/>
<project name="meta-hailo-apps" remote="majedabu" revision="main" path="sources-extra/meta-hailo-apps"/>

2. Sync the New Layer

cd /home/hailo/imx-yocto-bsp
repo sync sources-extra/meta-hailo-apps

3. Add Remote (first time only)

cd sources-extra/meta-hailo-apps
git remote add origin https://github.com/majedabu/meta-hailo-apps.git
cd /home/hailo/imx-yocto-bsp

4. Add the Layer to bblayers.conf

echo 'BBLAYERS += "${BSPDIR}/sources-extra/meta-hailo-apps"' \
    >> build/conf/bblayers.conf

5. Build hailo-cpp-apps

source astrial-setup-env build
bitbake hailo-cpp-apps

6. Rebuild the Image

All other packages are cached in sstate so this is fast:

bitbake system-astrial-image

Output image:

build/tmp/deploy/images/astrial-8gb-imx8mp/system-astrial-image-astrial-8gb-imx8mp.rootfs.wic.zst

Installed Apps

After flashing, apps are installed at /root/hailo-apps/:

/root/hailo-apps/
├── object_detection/object_detection
├── instance_segmentation/instance_segmentation
├── classification/classifier
├── semantic_segmentation/semantic_segmentation
├── pose_estimation/pose_estimation
├── oriented_object_detection/oriented_obj_det
├── depth_estimation_mono/mono_depth_estimation
├── depth_estimation_stereo/stereo_depth_estimation
│   ├── left.jpg
│   └── right.jpg
└── onnxrt_hailo_pipeline/
    ├── onnxrt_hailo_pipeline
    └── yolov8m-seg_post.onnx

Running the Apps

USB Camera

./object_detection/object_detection -i usb

CSI Camera (Astrial/IMX8 only)

The apps support -i csi for the IMX219 CSI camera on Astrial. The ISP daemon must be running before launching any app with CSI input:

# Start the ISP daemon first
cd /opt/imx8-isp/bin && ./run.sh -lm -c dual_imx219_1080p60 &

# Then run any app with CSI input
./object_detection/object_detection -i csi
./classification/classifier -i csi

Video File

./object_detection/object_detection -i /path/to/video.mp4

Stereo Depth (sample images included)

cd /root/hailo-apps/depth_estimation_stereo
./stereo_depth_estimation -i left.jpg

Layer dependencies

  • meta-oe (openembedded-layer)
  • meta-hailo-imx — provides libhailort, xtl, xtensor
  • meta-imx — provides opencv, onnxruntime

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages