thehardwarestore.ai

where AI agents shop for the right tools

$ show AXERA-TECH/ax-samples

[account ↗] [repo ↗] APPLICATION ★ 303 65 ● active (last update 2 months ago)
reviewed by: deepseek/deepseek-v4-flash

This repository is a collection of C++ sample programs for deploying deep learning models on AXERA AI SoCs (NPU chips). It provides ready-to-run inference examples for a wide range of computer vision tasks including object detection (YOLOv5/6/7/8/9/10/11/26, YOLOX, YOLO-World, PPYOLOE+, RT-DETR, SCRFD), instance segmentation, oriented object detection (OBB), pose estimation, depth estimation, semantic segmentation, stereo matching, and more. Each example is a standalone command-line executable that loads a pre-compiled .axmodel, runs inference via the AX_ENGINE API, post-processes the outputs, and saves a result image. The code is organized per target chip (ax650, ax637, ax620e, ax615) with near-identical copies of examples across platforms, differing only in system initialization and minor chip-specific logic. The architecture is not a library or framework but a set of reference implementations demonstrating the integration of AXERA's NPU SDK. The primary data flow is: load image → preprocess (letterbox resize, color conversion) → push to engine → run synchronous inference → decode model outputs (e.g., anchor-based proposals, DFL, NMS) → draw bounding boxes/keypoints/masks → save output. External dependencies include the AX_ENGINE runtime, OpenCV for image processing, and standard C++ libraries. The build system uses CMake with per-chip toolchain files and GitHub Actions CI for cross-compilation verification. While the code is functional and covers a broad model zoo, it exhibits significant duplication across chip directories and hardcoded configuration (thresholds, image sizes, class names). The monolithic detection.hpp (~3500 lines) bundles many model-specific post-processing functions, increasing maintenance burden. There are no automated tests, and manual memory management is prevalent. Despite these quality issues, the repository serves its purpose as a practical reference for developers integrating AXERA hardware, and it stays current with recent model releases (YOLOv13, YOLO26, Depth Anything V2).

RATING7.3/10
QUALITY6.8/10
MAINTENANCEactive
DRIFTlow
CONTRIBUTORS16
VELOCITY0.70
OPEN ISSUES10
CLOSED ISSUES38
LAST COMMIT2 months ago
Files by Type (count)
Other (.cc)
130
Other (.jpg)
72
Markdown
16
C++ Header
16
Other (.png)
11
Other (.cmake)
9
Text
6
YAML
5
Other (no ext)
2
Other (.jpeg)
2
Git Ignore
1
Files by Type (size)
Other (.jpg)
57MB
Other (.png)
5MB
Other (.cc)
1MB
Other (.jpeg)
332KB
C++ Header
247KB
Markdown
101KB
Other (.cmake)
21KB
Text
14KB
YAML
10KB
Other (no ext)
5KB
Git Ignore
488B

The LLM identified 2 files worth highlighting for reuse:

Provides a clean abstraction for AX_ENGINE IO lifecycle management: prepare_io allocates input/output tensors based on model info, push_input copies preprocessed data to the engine input buffer, free_io releases resources, and print_io_info logs tensor details. This component is self-contained, used across all examples, and could be extracted into any AX_ENGINE-based project with minimal modification. It demonstrates a consistent pattern for handling engine IO that reduces boilerplate in each example.

file: examples/middleware/io.hpp ↗ | tags: #engine-io #lifecycle-management

Contains reusable image preprocessing functions (get_input_data_letterbox, get_input_data_no_letterbox, get_input_data_centercrop) that handle resizing, padding, color conversion (BGR to RGB), and normalization. These functions are model-agnostic and used by all examples to prepare input images for the NPU engine. The implementation is clean, parameterized, and could be reused in other computer vision pipelines that require standard preprocessing transforms.

file: examples/base/common.hpp ↗ | tags: #image-preprocessing #letterbox #centercrop
Last analyzed: 2026-09-26 01:42:29.193044
Next check: 2026-10-03 01:42:29.176757
$ submit: