android-deployment
Routes Android TFLite asset, Gradle, classifier, GPU delegate, and mobile YOLOv4 deployment workflows for tensorflow-yolov4-tflite.
- License 许可
- MIT
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- android-deployment
- license
- MIT
- metadata
- { "disco-role": "operating" }
- description
- Routes Android TFLite asset, Gradle, classifier, GPU delegate, and mobile YOLOv4 deployment workflows for tensorflow-yolov4-tflite.
- disable-model-invocation
- true
02 资源文件 3
- 参考文档references/android-app.md3.1 KB
- 参考文档references/troubleshooting.md3.0 KB
- 脚本scripts/check_android_assets.py3.0 KB
03 SKILL.md 正文
Android Deployment
Use this sub-skill when the user wants to run or adapt the repository's Android
TFLite demo, replace the .tflite asset, update labels, reason about the
YoloV4Classifier constants, or troubleshoot Gradle/TFLite delegate issues.
Before Android work
- Produce and validate a TFLite model through ../model-conversion/SKILL.md before replacing Android assets.
- Verify the model with Python TFLite inference before debugging Android UI or camera code.
- Read references/android-app.md for Gradle, asset, classifier, and delegate facts distilled from the app source.
- Use scripts/check_android_assets.py to check model/label asset names and class-count consistency in a target app.
Main routes
- Replace the bundled model: confirm the asset filename expected by
MainActivityandDetectorActivity, copy the validated.tfliteinto the app assets directory of the user's target checkout, then run the asset checker. - Update labels/classes: replace
coco.txtor change the Java constants so the classifier reads the intended label file; class order must match the TFLite model output. - Choose delegates: inspect
YoloV4Classifierconstants for GPU/NNAPI; GPU delegate is enabled by source default, NNAPI is disabled. - Build/run the app: verify Android SDK/Gradle compatibility and be aware that the source Gradle file applies a model-download task that fetches a default MobileNet zip unless changed.
Asset checker examples
python sub-skills/android-deployment/scripts/check_android_assets.py \
--android-root android \
--model yolov4-416-fp32.tflite \
--labels coco.txt \
--expected-classes 80
Use --assets-dir instead of --android-root if the user has copied the app
layout into another project.
Handoff to other sub-skills
- If the
.tflitemodel is missing or mismatched, return to ../model-conversion/SKILL.md. - If Android detections disagree with Python results, compare against ../inference-evaluation/SKILL.md using the same input image, model file, class labels, input size, and thresholds.
- If class IDs are out of range, use ../training-data/SKILL.md to validate the class file and data/model class count.
Stop conditions
Stop before installing Android SDKs, downloading Gradle dependencies, running a camera app on a device, or replacing production mobile assets unless the user approves the target project and overwrite policy.
04 同仓库更多 Skills
passnet-triton-opt
Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.
passnet-solve
END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.
passnet-skill
PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.
passnet-pattern-fusion
Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.
passnet-orchestrate
Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.
passnet-feedback
Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).