custom-training-and-data
Prepare ImageAI 3.x custom training datasets, conversion helpers, trainer calls, and artifact handoff guidance.
- License 许可
- MIT
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- custom-training-and-data
- license
- MIT
- metadata
- { "disco-role": "operating" }
- description
- Prepare ImageAI 3.x custom training datasets, conversion helpers, trainer calls, and artifact handoff guidance.
- disable-model-invocation
- true
02 资源文件 5
- 参考文档references/data-formats.md4.8 KB
- 参考文档references/training-workflows.md8.0 KB
- 参考文档references/troubleshooting.md8.2 KB
- 脚本scripts/pascal_voc_to_yolo.py13.7 KB
- 脚本scripts/validate_imageai_dataset.py13.2 KB
03 SKILL.md 正文
Custom Training and Data
Use this operating sub-skill when the task is to prepare data or start custom ImageAI 3.x training for either:
- custom image classification with
ClassificationModelTrainer; or - custom YOLOv3 / TinyYOLOv3 object detection with
DetectionModelTrainer.
Do not use this sub-skill to run inference with the produced artifacts. After
training, route classification inference to the classification-workflows
sub-skill, custom image detection to object-detection-workflows, and custom
video detection to video-detection-workflows.
Route by user intent
| User intent | Use this file first | Then use |
|---|---|---|
| Check whether a classification dataset is trainable | references/data-formats.md and scripts/validate_imageai_dataset.py --task classification |
references/troubleshooting.md for failures |
| Check whether a YOLO detection dataset is trainable | references/data-formats.md and scripts/validate_imageai_dataset.py --task detection |
references/training-workflows.md for trainer setup |
| Convert Pascal VOC XML detection data to ImageAI 3.x YOLO txt layout | scripts/pascal_voc_to_yolo.py |
Validate the generated output before training |
| Train custom classification | references/training-workflows.md | Route generated .pt + classes JSON to classification-workflows |
| Train custom detection | references/training-workflows.md | Route generated .pt + detection config JSON to object-detection-workflows or video-detection-workflows |
| Resolve stale ImageAI 2.x / TensorFlow-era parameters | references/troubleshooting.md | Use current PyTorch 3.x signatures only |
Current ImageAI 3.x constraints
- ImageAI 3.x uses the PyTorch backend for the active package path.
.h5TensorFlow-era pretrained or custom models are not accepted by the current trainer/inference extension checks; use.ptor.pthweights.- Stale parameters such as
enhance_data,num_objectsfor classification training,loadModel(num_objects=...), speed modes, and standalone detectionevaluateModel()belong to older TensorFlow-era docs and must not be passed to the current PyTorch APIs. pycocotoolsis not part of the current custom YOLO training path covered by this sub-skill.
Bundled helpers
Run helpers from this sub-skill directory or pass absolute dataset paths from outside. The helper scripts do not import ImageAI and do not start model training.
python scripts/validate_imageai_dataset.py --task classification --dataset-dir path/to/dataset --strict
python scripts/validate_imageai_dataset.py --task detection --dataset-dir path/to/dataset --strict
python scripts/pascal_voc_to_yolo.py --dataset-dir path/to/voc-dataset --output-dir path/to/yolo-dataset
The converter writes classes.txt; use that class order as
object_names_array for DetectionModelTrainer.setTrainConfig(...).
Verification boundary
Safe checks for this sub-skill are dataset validation, Pascal VOC conversion on tiny fixtures, import/signature checks, and artifact-name reasoning. Full custom training is compute- and asset-dependent; do not claim it was cheaply verified unless a real dataset, release/pretrained weights if needed, and a bounded GPU or CPU training run were actually supplied and executed.
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).