utilities
Guides Autodistill image loading, visualization, model comparison, video splitting, and Roboflow utility boundaries.
- License 许可
- Apache-2.0
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- utilities
- license
- Apache 2.0
- metadata
- { "disco-role": "operating" }
- description
- Guides Autodistill image loading, visualization, model comparison, video splitting, and Roboflow utility boundaries.
- disable-model-invocation
- true
02 资源文件 4
- 参考文档references/image-loading-and-visualization.md2.2 KB
- 参考文档references/troubleshooting.md2.3 KB
- 参考文档references/utility-reference.md2.9 KB
- 脚本scripts/check_image_loading.py3.1 KB
03 SKILL.md 正文
Autodistill Utilities
Use this sub-skill when a task asks about image loading/conversion, plotting detections, comparing model predictions, splitting video frames, understanding split_data side effects, or Roboflow synchronization helper boundaries.
For main auto-labeling workflows and dataset layout, use dataset labeling. For CLI model selection, use CLI and model registry. For custom model interface design, use ontologies and model interfaces.
Quick Route
- Image input conversion: read image loading and visualization for
load_imageaccepted inputs/outputs and headless plotting guidance. - Utility function signatures and side effects: read utility reference for
load_image,split_data,split_video_frames,sync_with_roboflow,plot, andcompare. - Utility failures: read troubleshooting for invalid paths, unsupported return formats, URL/network failures, OpenCV/Pillow issues, headless display, Roboflow credentials, and directory mutation.
- Safe local image-loading check: run scripts/check_image_loading.py. It creates its own local fixture by default and does not need network.
Common Pattern
from autodistill.helpers import load_image
cv2_image = load_image("image.jpg", return_format="cv2")
pil_image = load_image(cv2_image, return_format="PIL")
np_image = load_image(pil_image, return_format="numpy")
Use load_image when a plugin expects a specific image object format but your workflow has a path, PIL image, or NumPy/OpenCV array.
Headless Visualization Pattern
from autodistill.utils import plot
annotated = plot(image=image, detections=detections, classes=classes, raw=True)
# Save or inspect annotated instead of relying on an interactive display.
plot(..., raw=False) uses supervision.plot_image, which may not be suitable for headless runs.
Safety Notes
load_imagecan fetch HTTP URLs; avoid that branch unless network use is approved.sync_with_roboflowlogs into Roboflow, downloads images, labels them, and uploads annotations; treat it as credentialed and externally mutating.split_datamutates a dataset output directory by moving files and converting.png/.jpegto.jpginside that output layout.
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).