Skip to content
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,15 @@ build/
dist/
.vscode/
coco-*/
dota-*/
imagenet-1k*/
tmp/
DOTAv1/
val2017/
.omc
.bak
test_bash_script
venv*

# Byte-compiled / optimized / DLL files
__pycache__/
Expand Down
8 changes: 8 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,12 @@ Markdown guides, example scripts, or both.
- `compilation/`: Tutorials and helper scripts for qbcompiler workflows
- `runtime/`: Tutorials and helper scripts for qbruntime workflows
- `assets/`: Shared images used by the docs
- `compilation/oriented_bounding_boxes/`: `YOLO11m-obb` compilation tutorial for DOTAv1-style OBB models
- `runtime/python/oriented_bounding_boxes/`: Self-contained MXQ runtime tutorial for OBB inference and visualization
- `compilation/*/README.md`, `runtime/*/README.md`: English task-specific guides
- `compilation/*/README.KR.md`, `runtime/*/README.KR.md`: Korean counterparts when available
- `compilation/*/*.py`, `runtime/*/*.py`: Standalone example scripts used by the guides
- `runtime/python/*/{postprocess,visualize,utils}.py`: Local helper modules that intentionally stay close to each tutorial
- `*/**/requirements.txt`: Per-tutorial dependency hints for heavier examples such as LLM, STT,
and VLM flows

Expand All @@ -31,6 +34,8 @@ Markdown guides, example scripts, or both.
describes.
- Prefer small, explicit scripts over shared abstractions unless the repo already has a local
utility module for that example.
- For runtime vision tutorials, prefer local preprocessing, postprocessing, dataset-label, and
visualization helpers when that keeps the example easier to follow end to end.
- Assume users follow the docs step by step on Linux or in Docker, often with Mobilint NPU access.

## Documentation Rules
Expand Down Expand Up @@ -92,6 +97,9 @@ Markdown guides, example scripts, or both.
downloads, or external packages, document that explicitly in the README.
- Keep preprocessing, postprocessing, and model-loading logic close to the example unless there is
already a local helper module such as `imagenet.py`, `coco.py`, `utils.py`, or `visualize.py`.
- For OBB examples, keep the row format and dataset assumptions explicit in code and docs, for
example `cx, cy, w, h, conf, cls, angle` with DOTAv1 labels when the tutorial is tied to
`YOLO11m-obb`.

### Dependency Awareness

Expand Down
92 changes: 92 additions & 0 deletions SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
---
description: Reusable repository skill for making aligned documentation and example-script changes in the Mobilint SDK tutorial repo.
paths:
- "**"
---

# Mobilint SDK Tutorial Skill

## When to Use This Skill

Use this skill for changes anywhere in this repository, especially when the task involves:

- Tutorial docs under `README.md`, `README.KR.md`, `compilation/`, or `runtime/`
- Standalone example scripts that accompany a specific tutorial
- Keeping script arguments, filenames, and README commands synchronized
- Updating bilingual documentation where English and Korean versions coexist
- Validation planning for workflows that depend on `qbcompiler`, `qbruntime`, Docker, NPU devices,
gated datasets, or large model downloads

## Purpose

Use this repo as a documentation-first tutorial workspace. Changes should keep example scripts,
README commands, and expected artifacts synchronized within each tutorial directory.

## First Reads

Start with the smallest set of files that anchor the task:

- `README.md` and `README.KR.md` for the top-level product framing
- The nearest `compilation/<task>/README.md` or `runtime/<task>/README.md`
- The adjacent script files used by that tutorial
- `pyproject.toml` for Python version and Ruff settings
- `git status --short` before editing so you do not overwrite unrelated user work

If the touched tutorial has a Korean counterpart, open `README.KR.md` early so structure changes
can stay aligned.

## Current Repo State

- The repo contains paired compilation and runtime tutorials under `compilation/` and `runtime/`.
- Many tutorials have both `README.md` and `README.KR.md`; when both exist, keep them aligned.
- Runtime Python tutorials commonly use small local helper modules such as `utils.py`,
`postprocess.py`, `visualize.py`, and dataset label files like `coco.py` or `dota.py`.
- `compilation/oriented_bounding_boxes/` contains the `YOLO11m-obb` compilation flow that produces
`yolo11m-obb.mxq`.
- `runtime/python/oriented_bounding_boxes/` is a self-contained OBB runtime tutorial that expects
`../../../compilation/oriented_bounding_boxes/yolo11m-obb.mxq`, uses `1024x1024` letterbox
preprocessing, keeps runtime input as `uint8`, decodes DOTA OBB rows as
`cx, cy, w, h, conf, cls, angle`, and renders rotated polygons.

## Repo Map

- `compilation/README.md`: Compiler setup, Docker workflow, and qbcompiler installation guidance
- `runtime/README.md`: Runtime setup, driver/library installation, and NPU assumptions
- `compilation/*`: Model-specific compilation walkthroughs
- `runtime/python/*`: Python runtime walkthroughs
- `runtime/cpp/*`: C++ runtime walkthroughs where present
- `assets/`: Shared diagrams and logo assets
- Per-directory helper modules such as `imagenet.py`, `coco.py`, `dota.py`, `postprocess.py`,
`utils.py`, and `visualize.py`: Local helpers for one tutorial family

## Working Rules

- Treat each tutorial as self-contained unless there is already a local shared helper in that area.
- When you change script defaults or CLI flags, update the README in the same directory immediately.
- Prefer concrete filenames and copy-pasteable commands.
- Keep bilingual tutorial structure synchronized even when the prose is not a literal translation.
- Prefer direct, readable scripts that mirror the tutorial text instead of introducing shared
library-style abstractions.
- Keep README sections ordered around user workflow: prerequisites, preparation, execution, output.
- Reflect external constraints explicitly when examples depend on Mobilint proprietary wheels,
Mobilint NPU devices, Docker images, Hugging Face authentication, or large downloads.
- For hardware-dependent examples, do static validation when full execution is not available and
state that limit clearly.

## Validation Defaults

For touched Python tutorial files, prefer:

```bash
ruff check path/to/file.py
ruff format path/to/file.py
python -m py_compile path/to/file.py
```

For a small tutorial directory with several edited scripts:

```bash
python -m compileall path/to/tutorial_dir
```

For touched docs, verify that links, paths, commands, and default filenames match the local scripts.
134 changes: 0 additions & 134 deletions SKILLS.md

This file was deleted.

13 changes: 13 additions & 0 deletions compilation/face_detection/README.KR.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ python model_compile.py --onnx-path ./yolov12m-face.onnx --calib-data-path ./wid
```

이 예제는 `prepare_model.py`의 출력 파일명과 맞추기 위해 경로를 명시적으로 전달합니다.
ARIES 튜토리얼 스크립트는 내부적으로 `target_device="aries2"`로 컴파일하므로, 이 명령은 기본적으로 ARIES2를 대상으로 합니다.

**수행 작업:**

Expand All @@ -143,4 +144,16 @@ python model_compile.py --onnx-path ./yolov12m-face.onnx --calib-data-path ./wid
- `yolov12m-face.mxq`
- `yolov12m-face.mblt`

### REGULUS

REGULUS는 `inference_scheme="single"`만 지원합니다. `model_compile_regulus.py`를 `--target-device`와 함께 사용하세요.

> **참고**: face detection 은 **regulus2 에서만** 지원됩니다. `yolo-face` 프로젝트가 YOLOv8 기반 face weight 를 제공하지 않고 regulus1 은 YOLOv9 이하만 지원하므로, YOLOv12 face 모델은 regulus1 을 대상으로 할 수 없습니다.

```bash
python model_compile_regulus.py --onnx-path ./yolov12m-face.onnx --calib-data-path ./widerface-selected --save-path ./yolov12m-face.mxq --target-device regulus2
```

현재 디렉토리에 `yolov12m-face.mxq` (및 중간 산출물 `yolov12m-face.mblt`) 가 생성됩니다.

명령이 끝나면 [../../runtime/python/face_detection/README.KR.md](../../runtime/python/face_detection/README.KR.md)에서 컴파일된 모델로 추론을 실행할 수 있습니다.
13 changes: 13 additions & 0 deletions compilation/face_detection/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ python model_compile.py --onnx-path ./yolov12m-face.onnx --calib-data-path ./wid
```

This example passes the paths explicitly so the command matches the output from `prepare_model.py`.
The ARIES tutorial script now compiles with `target_device="aries2"` internally, so this command targets ARIES2 by default.

**What this does:**

Expand All @@ -143,4 +144,16 @@ This example passes the paths explicitly so the command matches the output from
- `yolov12m-face.mxq`
- `yolov12m-face.mblt`

### REGULUS

REGULUS only supports `inference_scheme="single"`. Use `model_compile_regulus.py` with `--target-device`.

> **Note**: Face detection is supported on **regulus2 only**. The `yolo-face` project does not ship a YOLOv8-based face weight, and regulus1 supports only YOLOv9 and earlier, so the YOLOv12 face model cannot target regulus1.

```bash
python model_compile_regulus.py --onnx-path ./yolov12m-face.onnx --calib-data-path ./widerface-selected --save-path ./yolov12m-face.mxq --target-device regulus2
```

This produces `yolov12m-face.mxq` (and the intermediate `yolov12m-face.mblt`) in the current directory.

After the command finishes, continue to [../../runtime/python/face_detection/README.md](../../runtime/python/face_detection/README.md) to run inference with the compiled model.
1 change: 1 addition & 0 deletions compilation/face_detection/model_compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
)
mxq_compile(
model=args.onnx_path,
target_device="aries2",
calib_data_path=args.calib_data_path,
save_subgraph_type=2, # save mblt file before quantization
output_subgraph_path=args.onnx_path.replace(".onnx", ".mblt"),
Expand Down
Loading
Loading