/ti-edgeai-skills:ti-edgeai-import-modelfrom ti-edgeai-skills
Get a trained neural network that exports to a static-shape ONNX (a classifier, a segmentation model, or a detector with a TIDL meta-architecture such as YOLOX/SSD/YOLOv5-style) running on a TI Edge AI board's C7x/MMA accelerator (TDA4VM, AM68A, AM69A, AM67A, AM62A): preflight the ONNX, fold input normalisation, compile and int8-calibrate with edgeai-tidl-tools in Docker (tools tag matched to the board SDK), verify offload and accuracy in host emulation, check board-vs-host outputs, package model/ artifacts/ param.yaml dataset.yaml, deploy to /opt/model_zoo and smoke-test with edgeai-gst-apps. Use this skill whenever the user wants to deploy, convert, compile, quantize, port or "put my model on" a TI Jacinto/AM6xA board, mentions TIDL compilation, artifacts, tidl_net.bin, meta_arch_type, a prototxt, calibration images, int8 accuracy loss on the TI device, or asks why a compiled model fails on the board - for any architecture within those contracts, and even if they only say "deploy to the TI device".
Ships in ti-edgeai-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
When this skill is active, read the reference named in each phase before running it. Scope: a model whose ONNX export has static input shapes and mostly supported operators, in one of three task contracts
(below). Out of scope: dynamic shapes (export fixed ones), operators TIDL cannot run (they fall back to ARM or block offload),
models with several inputs or non-image inputs (not tested), and TFLite/TVM flows. The three task types share one flow and differ
only in the compile options and param.yaml:
| Task | Compile extras | Output the board app expects | Run end to end |
|---|---|---|---|
| detection with a TIDL meta-architecture (YOLOX/YOLOv5/7 type 6, SSD 3, YOLOv3 4, RetinaNet 5, YOLOv8 8) | --meta <prototxt> --meta-arch-type N | dets [N,5] + labels [N] | YOLOX type 6 (TDA4VM) |
| classification | none | one score vector | float-input CNN with folded mean/scale (TDA4VM) |
| segmentation | none | class-index mask (uint8 if the net ends in ArgMax) | no (param.yaml template from the TI zoo only) |
Read ti-edgeai-dev first if new to the platform; it holds the rules this flow depends on (tools release compatible with the board SDK, gst-apps
SOC key, [H, W] order, no-padding resize). SoC-dependent values (tools SOC, --target-device, quantization): ti-edgeai-dev/references/platforms.md. Report evidence at each gate: a phase is done when its check passed, not when the
command returned.
Write model_manifest.py init once (task, input policy, channel order, classes, meta-architecture, SoC and tools tag) and pass
--manifest to compile, evaluators, board_host_check.py and package_model.py; contradicting flags are an error and packaging
seals file hashes (references/model-manifest.md). Flags still work without a manifest.
| # | Phase | Script / reference | Gate |
|---|---|---|---|
| 0 | Pre-flight: board SDK -> tools tag, tools container | references/compile-tidl.md | tag chosen from the compatibility table; image exists |
| 1 | Get a TIDL-friendly ONNX | check_onnx_for_tidl.py, add_input_preprocessing.py, references/export-onnx-for-tidl.md | no ERRORs; input uint8 (normalisation folded); ONNX matches the framework model |
| 2 | Compile + calibrate | compile_tidl.py (in container) | Subgraph Compiled Successfully; subgraph count and offload as expected |
| 3 | Verify artifacts + accuracy | check_artifacts_version.py, eval_onnx_det.py / eval_classification.py | stamp OK; int8 within tolerance of float |
| 4 | Package | package_model.py | param.yaml matches the task contract |
| 5 | Deploy + smoke test + numerics | deploy_to_board.sh, board_host_check.py | app exit 0, Offloaded Nodes N/N, board == host outputs |
| 6 | Accuracy / speed loop | references/quantization-accuracy.md, ti-edgeai-profile-pipeline | only if a gate fails |
ssh root@<board-ip> 'env | grep -i -E "EDGEAI|SDK"', then your SoC's column in
ti-edgeai-dev/references/sdk-versions.md / TI's compatibility table (example: TDA4VM on SDK 11.0 -> 11_00_06_00).docker build -f scripts/Dockerfile.tidl-tools --build-arg TIDL_TAG=<tag> --build-arg SOC=<tools soc> -t ti-tidl-tools:<tag>-<soc> scripts/.
run_in_container.sh finds it through TIDL_TAG / TOOLS_SOC (defaults: 11_00_06_00, am68pa).python scripts/check_onnx_for_tidl.py model.onnx # static shapes? unsupported ops? mid-graph Cast? SiLU?
onnxsim). Read WARNINGs: ops listed there run on ARM.(x-mean)*scale), fold it in:
python3 scripts/add_input_preprocessing.py in.onnx out.onnx --mean ... --scale ... (container; TI's own helper). Models that
already start with a uint8 -> Cast, or need no normalisation, skip this.scripts/export_yolox_tidl_det.py
does this for YOLOX (worked adapter: references/export-yolox-det.md); other families: references/other-model-families.md.cd work # holds the ONNX (+ prototxt); mounted at the same path in the container
export WORKDIR=$PWD
<skill>/scripts/run_in_container.sh "python3 -m onnxsim model.onnx model_sim.onnx && python3 \$SCRIPTS/compile_tidl.py \
--model model_sim.onnx --artifacts artifacts --calib <train_images_dir> --task <detection|classification|segmentation> \
[--meta model.prototxt --meta-arch-type 6] <preprocess flags> --frames 50"
Preprocess flags must mirror deployment: --hw H W (plain resize; detection/segmentation default) or --resize S --crop C
(classification), --channels bgr|rgb (what the model expects). Calibration images: training distribution only, >= 50 for
accuracy_level 1. The compile writes into a staging folder and only replaces --artifacts on success; an existing folder is kept
as artifacts.previous-<time> and a failed compile leaves it untouched. Run detached and poll calib i / N. Options, failure modes: references/compile-tidl.md.
python scripts/check_artifacts_version.py artifacts/subgraph_0_tidl_net.bin --board root@<board-ip> # stamp
# accuracy in host emulation (container). Float reference first, then int8; same preprocess flags as compile:
python3 $SCRIPTS/eval_onnx_det.py --model model_sim.onnx --data-dir <coco_dir> --split val --hw H W [--tidl-artifacts artifacts --tidl-tools $TIDL_TOOLS_PATH]
python3 $SCRIPTS/eval_classification.py --model model_sim.onnx --images <val_dir> <preprocess flags> --tidl-artifacts artifacts --reference-onnx model_sim.onnx
Compare int8 against float on held-out data (and a separate test set when you have one). Typical int8 loss (measured on TDA4VM): small for
classifiers, a few AP points for detectors; if unacceptable go to Phase 6. eval_classification.py also works unlabelled:
top-1 agreement and cosine similarity vs float are a label-free measure of quantization damage for any classifier.
python scripts/package_model.py --onnx model_sim.onnx --artifacts artifacts --out-dir pkg --name ONR-<TASK>-<nnnn>-<desc> \
--task <task> [--prototxt model.prototxt] (--hw H W | --resize S --crop C) --channels <bgr|rgb> --classes a b c \
[--target-device <name>]
BOARD=root@<board-ip> GST_SOC=<key> scripts/deploy_to_board.sh pkg/<name> <finite-input-config.yaml> # config from ti-edgeai-generate-config
deploy_to_board.sh never deletes: an existing model/config is refused unless REPLACE=1, which moves it to a .backup- folder; its
exit status is the application's (finite input must exit 0; live input needs LIVE=1). package_model.py refuses dynamic input
dimensions, takes detection outputs from the compile metadata, and prints node coverage (a single subgraph is not proof of full
offload; the board log's Offloaded Nodes N/N is).
Keep three gates separate; each answers a different question and none implies the others:
scripts/board_host_check.py dump on host and on board, then compare): identical input tensors, same
image list, same outputs/shapes/dtypes, finite values, default tolerance 0 (exact). TI states host emulation should bit-match the
device; bit-identical outputs were observed for a detector and a classifier on TDA4VM. If it differs, use debug_level 3 traces.deploy_to_board.sh + a config from ti-edgeai-generate-config): the gst preprocessing
(tiovxmultiscaler, tiovxdlpreproc) differs from OpenCV, so do not expect bit-exact results versus gate 1 (TI cautions about this).
Look at an output frame (detector) or the printed classes (classifier).In this order, re-running Phases 2-3 and recording each result: more/better calibration frames and accuracy_level 1 ->
16-bit for the first/last convs -> mixed_precision_factor -> all 16-bit -> QAT retraining; on SoCs with asymmetric support also try
--quant-scale-type 4 (not available on TDA4VM). For speed: smaller input,
then ti-edgeai-profile-pipeline.
Model <name> task <task> input <shape/dtype> SoC <S> tools tag <X> board SDK <Y>
Float metric <...> int8 host-emu metric <...> held-out int8 <...>
Offload: <n> subgraph(s), Offloaded Nodes N/N | version stamp OK | board==host max|diff| <v> on <k> images
Board model time (bench_tidl.py): <ms> Run: <list> Not run: <list>
Say exactly what was and was not run.
scripts/: check_onnx_for_tidl.py, add_input_preprocessing.py, compile_tidl.py, tidl_preprocess.py (shared preprocessing),
eval_onnx_det.py, eval_classification.py, check_artifacts_version.py, package_model.py, deploy_to_board.sh,
board_host_check.py, model_manifest.py, staged_output.py, export_yolox_tidl_det.py (YOLOX adapter), run_in_container.sh, Dockerfile.tidl-tools.
references/: export-onnx-for-tidl.md, export-yolox-det.md, compile-tidl.md, quantization-accuracy.md,
package-and-deploy.md, other-model-families.md, model-manifest.md.
agents/openai.yaml (opens in a new tab)evals/evals.json (opens in a new tab)references/compile-tidl.md (opens in a new tab)references/export-onnx-for-tidl.md (opens in a new tab)references/export-yolox-det.md (opens in a new tab)references/model-manifest.md (opens in a new tab)references/other-model-families.md (opens in a new tab)references/package-and-deploy.md (opens in a new tab)references/quantization-accuracy.md (opens in a new tab)scripts/Dockerfile.tidl-tools (opens in a new tab)scripts/add_input_preprocessing.py (opens in a new tab)scripts/board_host_check.py (opens in a new tab)scripts/check_artifacts_version.py (opens in a new tab)scripts/check_onnx_for_tidl.py (opens in a new tab)scripts/compile_tidl.py (opens in a new tab)scripts/deploy_to_board.sh (opens in a new tab)scripts/eval_classification.py (opens in a new tab)scripts/eval_onnx_det.py (opens in a new tab)scripts/export_yolox_tidl_det.py (opens in a new tab)scripts/model_manifest.py (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub saeedahmadicp/ti-edgeai-skills --plugin ti-edgeai-skills5 skills in this plugin
/ti-edgeai-devTexas Instruments Edge AI SDK development for Jacinto 7 / AM6xA processors with a C7x DSP + MMA deep-learning accelerator (TDA4VM, AM68A, AM69A, AM67A, AM62A): TIDL model compilation with edgeai-tidl-tools, the on-board runtime (ONNX Runtime with the TIDL execution provider), edgeai-gst-apps configs and tiovx* GStreamer plugins, model folders and param.yaml, tools-to-SDK version matching, and troubleshooting. Use this skill whenever the user mentions TIDL, C7x, MMA, TDA4VM, J721E, AM68A, AM69A, AM67A, AM62A, edgeai-tidl-tools, edgeai-gst-apps, /opt/model_zoo, tiovxmultiscaler, "TI edge NPU/accelerator", or asks how to run, deploy, debug or speed up a neural network on a TI Jacinto/Sitara board - even if they never say "skill". Start here, then hand off to ti-edgeai-import-model, ti-edgeai-generate-config, ti-edgeai-profile-pipeline or ti-edgeai-train-model.
/ti-edgeai-generate-configBuild, validate and run edgeai-gst-apps YAML configs (inputs, models, outputs, flows) on TI Edge AI boards with a C7x/MMA accelerator (TDA4VM, AM68A, AM69A, AM67A, AM62A): video file, image sequence, USB webcam, CSI camera, RTSP or test-pattern input; one or several models; display with FPS overlay, saved video/images, network stream or fakesink; mosaic layouts. Use this skill whenever the user wants to "run my model on the TI board", show live results on a display, use a webcam or camera with the TI demo app, record annotated video, stream detections, write an app_config / edgeai-gst-apps yaml, or asks how the TI GStreamer pipeline (tiovxmultiscaler, tiovxdlpreproc, kmssink) is assembled - even if they never say "config".
/ti-edgeai-profile-pipelineMeasure and improve inference speed on TI Edge AI boards with a C7x/MMA accelerator (TDA4VM, AM68A, AM69A, AM67A, AM62A): model-only latency, per-layer C7x cycle hotspots, per-element GStreamer latency and FPS of the edgeai-gst-apps pipeline, system load, and the levers that trade accuracy for speed (input size, 16-bit layers, frame rate, output size). Use this skill whenever the user asks how fast a model runs on the TI board, wants FPS, latency, "why is it slow", per-layer timings, which stage is the bottleneck, whether the pipeline can keep 30 fps, or how much a precision/size change costs - even if they only say "benchmark it on the TI device".
/ti-edgeai-train-modelPlan and run training/fine-tuning so a vision model (detector, classifier, segmenter) deploys well on TI Edge AI processors with a C7x/MMA accelerator (TDA4VM, AM68A, AM69A, AM67A, AM62A): pick a TIDL-friendly architecture and input size, choose TI's toolchain (edgeai-modelmaker, edgeai-yolox, edgeai-mmdetection, edgeai-torchvision, plain PyTorch), build datasets and leakage-safe splits, train with quantization-friendly settings, and evaluate with the same preprocessing the board uses before handing the checkpoint to ti-edgeai-import-model. Use this skill whenever the user wants to train, fine-tune, label, split or evaluate a model "for the TI board / edge NPU / C7x", asks which architecture or input size to use, why their detector scores near zero, how to make a model quantization-friendly, or how to prepare labels so the model is learnable - even before any deployment question comes up.