算法艺术创作
algorithmic-art
通过代码和可调参数创作生成艺术与交互式视觉效果。
t-rex【设计与创意】Use the T-Rex2 cloud API wrapper for visual-prompt object detection, embeddings, visualization, and the optional Gradio demo.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Use this skill when a task asks for T-Rex2, T-Rex visual prompts, DeepDataSpace T-Rex API calls, generic object detection from text/visual prompts, reusable visual embeddings, detection rendering, or the optional Gradio demo.
T-Rex2 in this repository is a Python cloud API wrapper, not a local model checkpoint or training framework. Live detections require a DeepDataSpace API token and network access; local GPU/accelerator hardware is not required for the selected workflows.
Confirm that the task really needs T-Rex2's visual prompt cloud API or renderer.
Install the package in the user's working environment. For a source checkout or source archive, use a clean Python environment, install runtime dependencies such as requests, Pillow, numpy, pydantic==2.10.6, and gradio==4.44.1, then install the package. If source metadata build fails on torch, read references/troubleshooting.md; this is a setup-time packaging quirk, not a local GPU requirement.
If package availability is uncertain, run the bundled offline smoke check from this skill directory:
python scripts/check_trex_install.py --json
For live cloud calls, confirm the user can provide a token through --token or T_REX_API_TOKEN; do not log or persist secrets.
Before refreshing this skill against a checkout, read references/repo-provenance.md.
| User task | Read |
|---|---|
Build or validate prompt JSON, call TRex2APIWrapper, run interactive/generic visual prompt detection, create visual embeddings, or run embedding inference | sub-skills/cloud-api-workflows/SKILL.md |
Draw boxes or points, filter detections by score, fix detection JSON, operate/debug the optional Gradio demo, or handle score.item visualization errors | sub-skills/visualization-and-demo/SKILL.md |
Install/import failures, setup-time torch failures, Gradio dependency compatibility, token/network boundary, or backend questions | references/troubleshooting.md |
| Check source commit, package version, evidence paths, or staleness | references/repo-provenance.md |
from trex import TRex2APIWrapper, visualize.trex==1.0; source trex/version.py contains v1.0.pydantic==2.10.6 and gradio==4.44.1.requests, Pillow, and numpy; ensure they are available even when not named in the package requirement file.setup.py imports torch.utils.cpp_extension during source installation. This is a setup-time packaging quirk, not evidence of local GPU inference.gradio-image-prompter and may need huggingface_hub<1.0 with Gradio 4.44.1.--dry-run on cloud sub-skill scripts to validate prompt images and JSON without any network call.[x1, y1, x2, y2] pixel coordinates and reuse category_id for the same object class across references.TRex2APIWrapper.embedding_inference, not as model checkpoints.scores, labels, and boxes to NumPy arrays before calling trex.visualize directly.