算法艺术创作
algorithmic-art
通过代码和可调参数创作生成艺术与交互式视觉效果。
visualization-and-demo【设计与创意】Render T-Rex2 detections, filter results, and operate the optional Gradio visual-prompt demo workflow.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Use this sub-skill when a task already has T-Rex2 detection results or asks about the optional local Gradio demo. It covers drawing boxes/points, filtering by score, JSON detection schemas, and UI prompt-mode constraints.
trex.visualize.scores, labels, and boxes before saving an annotated image.gradio-image-prompter.torch/Gradio dependency repair. Start from the root skill and root troubleshooting reference.trex.visualize expects a target dictionary with boxes, scores, and labels of equal length.scores to NumPy or torch scalars before drawing; the renderer calls score.item(), so plain Python float scores can fail.[x1, y1, x2, y2], not normalized center-width-height boxes.render_detections.py; it reads either top-level detections or raw scores/labels/boxes.TRex2APIWrapper.postprocess, convert them to NumPy arrays or use render_detections.py, which does the conversion.From the generated t-rex skill directory:
python sub-skills/visualization-and-demo/scripts/render_detections.py \
--image images/target.jpg \
--detections-json outputs/detections.json \
--output-image outputs/annotated.jpg \
--box-threshold 0.3 \
--draw-score
Use --demo-fixture for a no-input smoke check that creates a tiny synthetic image and renders one box to the requested output path.