---
title: "AI Camera Viewer"
description: "Builds clean on nativesim/native/64 against the full ` /  surfaces (both ship today; Ethos-U dispatch runs through alpinferenceopen(...) the same as any other backend). Still missing: a real Vela-compiled persondetect.tflite` model and AEN HiL bench validation."
source: https://docs.alplab.ai/sdk/examples/ai-camera-viewer
---

# `ai-camera-viewer`

:::warning[`[UNTESTED]` on hardware — v0.9 paper-correct]
Builds clean on `native_sim/native/64` against the full `<alp/camera.h>` / `<alp/inference.h>` surfaces (both ship today; Ethos-U dispatch runs through `alp_inference_open(...)` the same as any other backend). Still missing: a real Vela-compiled `person_detect.tflite` model and AEN HiL bench validation.
:::

Headline edge-AI demo: an E1M-AEN module captures camera frames, runs a person-detect model on the on-die Ethos-U NPU, and renders the preview + bounding boxes on a 240×240 LVGL region of the panel's 240×320 ST7789 display.

Source: [`examples/camera-vision/ai-camera-viewer/`](https://github.com/alplabai/alp-sdk/tree/main/examples/camera-vision/ai-camera-viewer).

## Pipeline

```
OV5640 → <alp/camera.h> → <alp/inference.h> → post-process → LVGL
(SCCB+MIPI)   RGB565 frame     person-detect          bbox list +
                               (uint8 quantised)      per-frame latency
```

## What is still a placeholder

- No model is checked in — a Vela-compiled `person_detect.tflite` is still required.
- The camera returns `ALP_ERR_NOSUPPORT` on `native_sim`; there is no emul controller for it.
- The bounding-box decode post-process is not implemented yet.

## Display bring-up

The viewer opens its panel via [`alp_display_open()`](https://docs.alplab.ai/sdk/api/display) and binds LVGL with [`alp_gui_lvgl_attach()`](https://docs.alplab.ai/sdk/api/gui) before starting the inference thread, with `CONFIG_LV_Z_AUTO_INIT=n` in `prj.conf`. See [`lvgl-widgets-demo`](https://docs.alplab.ai/sdk/examples/lvgl-widgets-demo) for the reference sequence.

## `board.yaml`

```yaml
libraries:
  - name: lvgl
    cores: [m55_hp]
  - name: tflite-micro
    cores: [m55_hp]

som:
  sku: E1M-AEN801

preset: e1m-evk

pins:
  - { e1m: E1M_I2C0, macro: EVK_I2C_BUS_SENSORS, doc: "Shared sensor + IO-expander + INA236 bus" }
  - { e1m: E1M_SPI1, macro: EVK_SPI_BUS_ARDUINO, doc: "Arduino UNO header SPI" }

cores:
  a32_cluster:
    os: "off"
  m55_hp:
    app: ./src
    inference:
      default_arena_kib: 256
    peripherals:
      - i2c                  # Camera SCCB.
      - spi                  # Display.
      - gpio                 # Camera ancillaries + display D/C#.

chips:
  - ov5640                   # 5 MP camera.
  - st7789                   # 240x320 TFT.

diagnostics:
  log_level: info
```

The inference backend is driven by the SoM preset's `capabilities:` block, not by `board.yaml` — `arena_kib` is the only knob. Swapping `som.sku` compares E4 / E6 / E8 dispatch without touching the app source.

## See also

- [`<alp/camera.h>`](https://docs.alplab.ai/sdk/api/camera) · [`<alp/inference.h>`](https://docs.alplab.ai/sdk/api/inference) · [`<alp/display.h>`](https://docs.alplab.ai/sdk/api/display) · [`<alp/gui.h>`](https://docs.alplab.ai/sdk/api/gui)
- [`ai-object-detection-realtime`](https://docs.alplab.ai/sdk/examples/ai-object-detection-realtime) — DEEPX variant on V2N-M1
- [Examples overview](https://docs.alplab.ai/sdk/examples/overview)
