model-inference
Construct, inspect, and troubleshoot SSD300 model inference internals for the ssd.pytorch repository.
- License 许可
- MIT
- 最近更新
- 2026-10-08
- Stars
- ★ 11
- Forks
- 3
01 前言 Front Matter
- name
- model-inference
- license
- MIT
- metadata
- { "disco-role": "operating" }
- description
- Construct, inspect, and troubleshoot SSD300 model inference internals for the ssd.pytorch repository.
- disable-model-invocation
- true
02 资源文件 3
- 参考文档references/inference-workflow.md5.4 KB
- 参考文档references/model-api.md6.6 KB
- 参考文档references/troubleshooting.md5.4 KB
03 SKILL.md 正文
model-inference
Use this sub-skill when a task needs to construct or inspect the SSD300 model, its prior boxes, multibox heads, detection decode/NMS path, single-image inference preprocessing, or pretrained weight compatibility.
When to use
- Build or inspect
build_ssd(phase, size=300, num_classes=21). - Explain the VGG base, extra layers, L2 normalization, localization heads, confidence heads, prior boxes, decode, and NMS contracts.
- Diagnose model construction, state-dict loading, class-count/head mismatches, tensor shape/device issues, or the legacy
Detectincompatibility on modern PyTorch. - Plan safe single-image inference preprocessing and postprocessing without overclaiming that test-phase inference works unchanged on modern PyTorch.
Route elsewhere
- Dataset roots, VOC/COCO layout, annotation transforms, augmentation, dataloaders, and training commands:
../data-training/SKILL.md. eval.py,test.py, notebook demo, webcam demo, VOC result files, and runnable evaluation/demo command workflows:../evaluation-demos/SKILL.md.
Start here
- Read
references/model-api.mdfor signatures, model components, config facts, tensor shapes, and output contracts. - Read
references/inference-workflow.mdbefore loading weights or performing single-image inference; it includes the safe construction path and the modern PyTorch detection-layer decision point. - Read
references/troubleshooting.mdwhen imports, phases, state dicts, devices, or test-phase forward passes fail. - Use the bundled scripts for focused, low-cost checks:
python scripts/inspect_model_shapes.py --num-classes 21
python scripts/inspect_model_shapes.py --num-classes 21 --phase train --run-forward
python scripts/check_box_utils.py
The scripts assume they are run from a checkout or environment where the repository source modules are importable. They do not download data or weights.
Do not overclaim
build_ssd('train', 300, 21)constructs and train-phase zero forward has been observed to return(loc, conf, priors)with shapes(1, 8732, 4),(1, 8732, 21),(8732, 4)under a modern Torch runtime, aside from aVariable(..., volatile=True)warning.build_ssd('test', ...)constructs the legacy detection module, but a forward pass can fail on modern PyTorch becauseDetectsubclassestorch.autograd.Functionwith an old-style instanceforward. PatchDetector use a legacy-compatible PyTorch before claiming end-to-end inference/eval works.- Importing
ssdordatamay fail before model construction if the COCO label-map default path is absent; see troubleshooting for safe remedies.
04 同仓库更多 Skills
obsidian-clipper-template-creator
Guide for creating templates for the Obsidian Web Clipper. Use when you want to create a new clipping template, understand available variables, or format clipped content.
obsidian-clipper-template-creator
Guide for creating templates for the Obsidian Web Clipper. Use when you want to create a new clipping template, understand available variables, or format clipped content.
python-api
Programmatic Object-Detection-Metrics API guidance for BoundingBox, BoundingBoxes, Evaluator, enums, coordinate conversion, AP/mAP semantics, and source-style import diagnostics.
file-evaluation
Folder-based PASCAL VOC AP/mAP evaluation from ground-truth and detection text files.
object-detection-metrics
Guides legacy Object-Detection-Metrics PASCAL VOC AP/mAP evaluation from detection text folders and direct Python API classes.
nx-workspace-patterns
Configure and optimize Nx monorepo workspaces. Use when setting up Nx, configuring project boundaries, optimizing build caching, or implementing affected commands.