원클릭으로
deepdetect-pytorch-worker
Use when porting external PyTorch object detection models in DeepDetect through the external PyTorch worker backend.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Use when porting external PyTorch object detection models in DeepDetect through the external PyTorch worker backend.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
| name | deepdetect-pytorch-worker |
| description | Use when porting external PyTorch object detection models in DeepDetect through the external PyTorch worker backend. |
Use this guide when an LLM agent needs to port, import, adapt, or test an
external PyTorch object detection model in DeepDetect through the external
PyTorch worker backend, the external-pytorch-detector CLI profile,
mllib.entrypoint or service_mllib.entrypoint, connector tensor pull,
generated extern/pytorch_workers/<model_slug>/ adapters, or generic detection
worker hooks.
Read the local implementation before editing. Start with the PyTorch worker
backend docs, the external worker README, the CLI profile code, and the current
detection worker base. Use rg for:
DetectionTrainingWorkerBaseexternal-pytorch-detectorservice_mllibmllib.entrypointconnector_tensor_pulltest_predictionsInspect the target upstream repository before designing the adapter. Identify its package requirements, model factory, YAML or config system, training loss path, postprocessor, checkpoint format, device handling, distributed assumptions, download or pretrained defaults, and label and box conventions.
Verify whether a needed extension point already exists. If a core change is required, make it generic for external detection workers rather than naming the target model.
Keep committed DeepDetect changes reusable:
external-pytorch-detector profile.<target>-detector model profile.mllib.entrypoint or service_mllib.entrypoint.DeepDetectWorker.configure, train,
and predict.extern/pytorch_workers/<model_slug>/
unless the user explicitly asks to commit model-specific code.AGENTS.md as operational CLI and monitoring guidance, not the place
for a long model-porting workflow.Target-specific adapter directories are local workspaces by default. The core repository should not import them unless the user selects them in YAML or API parameters.
Create this layout for a generated external worker:
extern/pytorch_workers/<model_slug>/
worker.py
config.yaml
manifest.json
README.md
notes.md # optional
The manifest should record upstream repository URL, local checkout path, commit or tag when known, license, dependencies, entrypoint, class name, expected config path, checkpoint compatibility, and generation notes.
The README is required. It should include a quickstart with the concrete train and inference CLI commands for the adapter, required upstream checkout/config settings, checkpoint expectations, key environment variables, and any model-specific label or bbox conversion notes.
Prefer subclassing the existing detection training base for object detectors. Implement only the target-specific pieces:
Make conversions explicit. DeepDetect detection data normally uses pixel xyxy
boxes and one-based foreground labels, with class 0 reserved for background.
Many DETR-style models expect normalized cxcywh boxes and zero-based labels.
Convert labels and boxes in both directions and keep the mapping visible in code.
When useful, preserve or synthesize generic target metadata: orig_size, size,
area, and iscrowd. Keep existing boxes, labels, and image_id behavior
compatible with torchvision-style detection workers.
Raise typed worker errors:
Commit DeepDetect core edits only when they help more than one external detector. Examples of acceptable generic work:
deepdetect module.service_mllib.entrypoint, service_mllib.class, and
target-specific YAML values through normal training flows.Do not commit a target adapter, target config, or target dependency workaround as a DeepDetect core change unless the user explicitly requests it.
For committed generic backend work, add focused tests for the reusable behavior:
external-pytorch-detector config pass-through.For generated target adapters, add local tests with fake upstream modules when
possible. Gate real-upstream tests behind an environment variable such as
<MODEL>_REPO.
Run Python tests from the repository with the local package on PYTHONPATH, for
example:
PYTHONPATH=bindings/python python3 -m pytest bindings/python/tests/test_pytorch_worker_runtime.py bindings/python/tests/test_cli.py
For manual CLI smoke tests, use the source CLI or project wrapper and select the external detector profile:
PYTHONPATH=bindings/python python3 -m deepdetect.cli.main train external-pytorch-detector \
--config extern/pytorch_workers/<model_slug>/config.yaml \
--train-data train.txt \
--test-data test.txt \
--repository runs/<model_slug>-smoke \
--nclasses 2 \
--iterations 10 \
--test-interval 5 \
--batch-size 1 \
--terminal verbose \
--output-format jsonl
Add --gpu --gpuid <id> when CUDA is required. Add --visdom --visdom-results
when visual monitoring is needed, and inspect sink_warning, run.json,
metrics.jsonl, and saved files under REPOSITORY/visdom-results/.
If upstream import fails, install or document the missing dependency and improve the adapter's dependency error message. If upstream code assumes distributed training, prefer adapter-local single-process setup or disable the upstream path that calls distributed APIs before the process group exists.
If evaluation fails after training begins, inspect device placement, cached CPU tensors, postprocessor size arguments, label offsets, and box units. Prediction conversion bugs often appear first during test intervals or visual result generation.
If metrics look plausible but rendered visual results are wrong, inspect the saved image and JSON pairs before changing training settings. Check test-set ordering, sample indices, coordinate sizes, confidence thresholds, class ids, and whether the backend shuffled evaluation data.