Skip to content
Back to skills

Inference Visualization

ASecurity

"Run Detectron2 inference, inspect model outputs, and visualize

  • 247 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 8, 2026
devopsgo

Works with

  • cli

Security analysis

A100/100

Pro scans all 6 files and shows the line behind each finding

Scanned September 8, 2026

npx -y skills add VectorSpaceLab/AREX-Skill --skill inference-visualization --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Inference Visualization?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Inference Visualization
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vectorspacelab-inference-visualization/badge)](https://www.skillsdirectory.com/skills/vectorspacelab-inference-visualization)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: inference-visualization
description: "Run Detectron2 inference, inspect model outputs, and visualize
  predictions safely without depending on the source demo script."
disable-model-invocation: true
metadata:
  disco-role: operating
license: Apache 2.0
---

# Detectron2 Inference & Visualization

Use this sub-skill when a task asks to run Detectron2 inference, call `DefaultPredictor`, call a built model directly, inspect `Instances`/`Boxes`/masks, visualize predictions, plan demo-style image/video/webcam commands, or validate COCO-style prediction JSON before drawing it.

## Fast Routing

- For simple single-image inference, read [references/inference-workflows.md](references/inference-workflows.md#defaultpredictor-single-image-inference) and use `DefaultPredictor(cfg)` only when weights are local or downloads are intentional.
- For batch/direct model calls, read [references/inference-workflows.md](references/inference-workflows.md#direct-model-inference) and use `build_model(cfg)`, `DetectionCheckpointer(model).load(...)`, `model.eval()`, and `model([input_dict])[0]`.
- For output parsing, field checks, JSON conversion, and visualization requirements, read [references/structures-and-outputs.md](references/structures-and-outputs.md).
- For broken demo imports, OpenCV issues, CPU/CUDA mismatches, empty predictions, metadata labels, or output side effects, read [references/troubleshooting.md](references/troubleshooting.md).
- Build a safe demo-style command without executing it through [scripts/demo_command_builder.py](scripts/demo_command_builder.py).
- Validate COCO-style prediction JSON without drawing or importing Detectron2 through [scripts/visualize_json_schema_check.py](scripts/visualize_json_schema_check.py).

## Safe Defaults

- Set inference device before model or predictor construction: Yacs configs use `cfg.MODEL.DEVICE = "cpu"` or the CLI override `MODEL.DEVICE cpu`.
- Do not instantiate `DefaultPredictor` during no-download validation if `cfg.MODEL.WEIGHTS` points to a URL or `detectron2://` URI; it loads weights during construction.
- Treat OpenCV images as BGR, but pass RGB images to `Visualizer`; convert with `image_rgb = image_bgr[:, :, ::-1]`.
- Move predictions to CPU before visualization: `instances = outputs["instances"].to("cpu")`.
- Check `instances.has("pred_boxes")`, `instances.has("scores")`, and metadata class names before assuming labels or boxes exist.

## Boundaries

This sub-skill owns inference calls, model input/output formats, `Instances`, `Boxes`, `BoxMode`, `BitMasks`, `PolygonMasks`, `ImageList`, `Visualizer`, `ColorMode`, demo-style flags, confidence thresholds, CPU overrides, and prediction JSON sanity checks.

Route model-zoo config/checkpoint selection to `../configuration-model-zoo/`. Route dataset registration, catalog metadata, and dataset dict validation to `../data-datasets/`. Route training, evaluation loops, evaluators, and metrics to `../training-evaluation/`. Route TorchScript, tracing, Caffe2, and deployment packaging to `../deployment-export/`.

Files in this skill

  • SKILL.md3 KB
  • references/inference-workflows.md6.1 KB
  • references/structures-and-outputs.md6.6 KB
  • references/troubleshooting.md5.7 KB
  • scripts/demo_command_builder.py5.8 KB
  • scripts/visualize_json_schema_check.py10.1 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.