deep-person-reid
Route Torchreid deep-person-reid workflows for person re-identification training, evaluation, feature extraction, metrics, visualization, and model export.
- License 许可
- MIT
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- deep-person-reid
- license
- MIT
- metadata
- { "disco-role": "operating" }
- description
- Route Torchreid deep-person-reid workflows for person re-identification training, evaluation, feature extraction, metrics, visualization, and model export.
- disable-model-invocation
- true
02 资源文件 5
- 参考文档references/package-overview.md3.9 KB
- 参考文档references/repo-provenance.md2.3 KB
- 参考文档references/repo-routing-metadata.json344 B
- 参考文档references/troubleshooting.md4.0 KB
- 脚本scripts/check_torchreid_env.py5.1 KB
03 SKILL.md 正文
deep-person-reid / Torchreid
Use this repo skill when a task involves Torchreid (torchreid) or Kaiyang Zhou's deep-person-reid package for person re-identification (ReID). It is an operating graph for package use, not a maintainer-development guide.
Use this skill for
- Training or evaluating image/video ReID models such as OSNet, OSNet-AIN, ResNet, MLFN, HACNN, PCB, or MobileNet variants.
- Building Torchreid data managers, custom datasets, samplers, losses, optimizers, schedulers, and
Engine.run(...)plans. - Extracting embeddings with
FeatureExtractor, computing query/gallery distances, CMC/mAP, re-ranking, model complexity, ranked-result visualization, or activation maps. - Exporting core Torchreid checkpoints toward ONNX, OpenVINO, or TFLite-style artifacts with explicit optional-dependency checks.
- Diagnosing install/import, dataset-layout, config, optional-backend, checkpoint, or export failures.
Do not use this skill for
- General person ReID literature surveys with no Torchreid/deep-person-reid implementation need.
- DML, OSNet-AIN NAS, or PA-100K attribute-recognition project-local scripts unless a future extension bundles those projects; they are recorded as long-tail gaps rather than runtime routes here.
- Claims that CUDA, OpenVINO, TensorFlow, TFLite, or large-dataset training was verified unless the current task runs those checks.
Install
From a fresh clone of the package, install the runtime dependencies and the local package itself:
python -m pip install -U pip
python -m pip install -r requirements.txt
python -m pip install -e .
If editable installation fails because build-time NumPy/Cython visibility is missing, install the needed build prerequisites first and retry with --no-build-isolation, then use references/troubleshooting.md for the exact recovery steps.
Run the quick verification check after install:
python scripts/check_torchreid_env.py --model-name osnet_x0_25
First checks
-
Confirm the package is installed in the task environment:
import torchreid print(torchreid.__version__) -
Confirm PyTorch/torchvision match the intended backend. CPU is enough for API inspection and small smoke tests; CUDA is optional but practical for real training/evaluation.
-
Read references/repo-provenance.md before deciding whether this skill is current for a particular checkout.
-
For package/module coverage and backend status, read references/package-overview.md.
-
For cross-cutting failures, start with references/troubleshooting.md.
-
To run a quick non-training package check, use scripts/check_torchreid_env.py.
Route map
Training, evaluation, data, and configs
Use sub-skills/training-evaluation/SKILL.md when the request names training, testing, data managers, datasets, config files, CLI-style command generation, split-log parsing, or dataset mean/std.
Typical triggers: ImageDataManager, VideoDataManager, Engine.run, scripts/main.py-style workflow, test.evaluate True, visrank, Market1501/DukeMTMC/MSMT/CUHK03/MARS layouts, RandomIdentitySampler, train.lr_scheduler, checkpoint resume/fine-tune.
Feature extraction, models, metrics, and visualization
Use sub-skills/feature-extraction/SKILL.md when the request names embeddings, FeatureExtractor, model keys, checkpoint loading, distance matrices, CMC/mAP, re-ranking, model complexity, ranked-result visualizations, or activation maps.
Typical triggers: compare query/gallery images, compute cosine/euclidean distances, load local weights without downloads, evaluate_rank, re_ranking, compute_model_complexity, return_featuremaps=True.
Model export and deployment artifacts
Use sub-skills/model-export/SKILL.md when the request asks to export a trained core Torchreid checkpoint to ONNX, OpenVINO, or TFLite-style outputs.
Typical triggers: --include onnx, OpenVINO Model Optimizer, openvino2tensorflow, dynamic axes, opset choice, model-name inference, optional export dependency failures.
Root operating rules
- Prefer local checkpoint paths and explicit model names. Avoid automatic pretrained downloads unless the user approves network access.
- Treat datasets as user-provided unless a specific dataset class has an automated download path and the user approves network access.
- Use bundled helper scripts for command planning and smoke checks; do not tell future agents to run source-repo scripts from an unavailable checkout.
- Keep CPU verification separate from CUDA claims. CPU import/model/feature checks do not prove multi-GPU training throughput.
- Use export extras only for requested export formats; the core skill does not install ONNX/OpenVINO/TensorFlow by default.
- If a task requires the excluded
projects/workflows, either report the long-tail gap or extend the repo skill by bundling those project sources and verification cases first.
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).