CV / Face Landmarks

Face Landmarks Lite

Face Landmarks Lite locates 468 3D facial landmarks per face. Start a prebuilt Docker image with one command and run inference through the REST API on Hailo-8 and Hailo-10H. The guide covers device setup and troubleshooting. On Hailo-8, a YuNet CPU detector supplies the face ROI; the Hailo HEF performs the landmark inference.

78 downloads
Size
3.0 MB
Memory
4GB+
Inference Engine
HailoRT
Image input size
192x192

Start right away with Seeed Products

Platform
Size
  1. Install the Hailo driver and runtime

    On Raspberry Pi OS, install the package for your accelerator from the Raspberry Pi OS repository. Check that the installed HailoRT version matches the library path in the Docker command.

    bash
    sudo apt update
    sudo apt install hailo-all
    sudo reboot

    On other systems, install the vendor’s Hailo driver and matching HailoRT runtime for your accelerator, OS, and kernel. Manual Hailo installation guide

    After reboot, confirm that the accelerator is detected and the device node is available. Raspberry Pi AI setup guide

    bash
    hailortcli fw-control identify
    ls /dev/hailo0
  2. Install Docker

    bash
    bash <(curl -fsSL https://get.docker.com)
  3. Run the Docker command

    bash
    sudo docker run --rm \
      --name pi5-hailo8-face-landmarks \
      --privileged \
      --net=host \
      -e PYTHONUNBUFFERED=1 \
      --device /dev/hailo0:/dev/hailo0 \
      -v /usr/lib/libhailort.so.4.23.0:/usr/lib/libhailort.so.4.23.0:ro \
      -v /usr/lib/libhailort.so:/usr/lib/libhailort.so:ro \
      ghcr.io/seeed-projects/recomputer-hailo8-cv/face_landmarks_lite:latest \
      python web_detection.py --model_path model/face_landmarks_lite.hef \
      --yunet_model model/face_detection_yunet_2023mar.onnx \
      --video_path video/test.mp4

Deploy on hardware you already have

Platform
Size

Hailo-8

  1. Install the Hailo driver and runtime

    On Raspberry Pi OS, install the package for your accelerator from the Raspberry Pi OS repository. Check that the installed HailoRT version matches the library path in the Docker command.

    bash
    sudo apt update
    sudo apt install hailo-all
    sudo reboot

    On other systems, install the vendor’s Hailo driver and matching HailoRT runtime for your accelerator, OS, and kernel. Manual Hailo installation guide

    After reboot, confirm that the accelerator is detected and the device node is available. Raspberry Pi AI setup guide

    bash
    hailortcli fw-control identify
    ls /dev/hailo0
  2. Install Docker

    bash
    bash <(curl -fsSL https://get.docker.com)
  3. Run the Docker command

    bash
    sudo docker run --rm \
      --name pi5-hailo8-face-landmarks \
      --privileged \
      --net=host \
      -e PYTHONUNBUFFERED=1 \
      --device /dev/hailo0:/dev/hailo0 \
      -v /usr/lib/libhailort.so.4.23.0:/usr/lib/libhailort.so.4.23.0:ro \
      -v /usr/lib/libhailort.so:/usr/lib/libhailort.so:ro \
      ghcr.io/seeed-projects/recomputer-hailo8-cv/face_landmarks_lite:latest \
      python web_detection.py --model_path model/face_landmarks_lite.hef \
      --yunet_model model/face_detection_yunet_2023mar.onnx \
      --video_path video/test.mp4

Check that it’s running

Open the address below in a browser. Replace <board-ip> with your board’s IP address.

http://<board-ip>:8000

If you see the detection stream with boxes around objects, you’re all set.

Benchmark Performance

Face Landmarks Lite reported inference throughput (FPS) on CM5 + Hailo-8, CM5 + Hailo-10H.
  • Face Landmarks Lite · reComputer R Series (CM5 + Hailo-8)
    Batch 1 FPS
    359.69
  • Face Landmarks Lite · reComputer R Series (CM5 + Hailo-10H)
    Batch 1 FPS
    975.17

RESTful API

API endpoints

MethodPathPurpose
GET/Web preview UI
POST/api/models/face_landmarks_lite/predict468 keypoints (JSON)
GET/api/video_feedMJPEG preview stream

Test the API

Replace <board-ip> with your board’s IP address. Save an image as test.jpg in your current directory and send it to the prediction endpoint.

bash
curl -X POST "http://<board-ip>:8000/api/models/face_landmarks_lite/predict" \
  -F "file=@test.jpg"

Develop with the API

Install requests with python -m pip install requests. In the example, replace <board-ip> with your board’s IP address and use an image named test.jpg.

python
import requests

with open("test.jpg", "rb") as image:
    response = requests.post(
        "http://<board-ip>:8000/api/models/face_landmarks_lite/predict",
        files={"file": image},
        timeout=30,
    )
response.raise_for_status()
print(response.json())

Frequently Asked Questions (FAQ)

Why do some sizes disappear when I switch platforms?

The size picker shows the variants with a deployment command for your selected platform. Switch platforms in the quick start to see the sizes available for each one.

What should I check if the accelerator is unavailable?

Check that the host OS, drivers, and runtime match the selected platform’s guide. For Hailo, verify that the host detects the accelerator and that the installed HailoRT version matches the deployment instructions.

Where do I find the inference endpoint?

Select your platform and open the RESTful API section for the endpoint and input format.

More FAQs