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_image accepted 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, and compare.
- 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_image can fetch HTTP URLs; avoid that branch unless network use is approved.
sync_with_roboflow logs into Roboflow, downloads images, labels them, and uploads annotations; treat it as credentialed and externally mutating.
split_data mutates a dataset output directory by moving files and converting .png/.jpeg to .jpg inside that output layout.
1---2name: utilities-23description: "Guides Autodistill image loading, visualization, model comparison,4 video splitting, and Roboflow utility boundaries."5disable-model-invocation: true6metadata:7 source: https://skillmd.com/skills/vectorspacelab/utilities-28 disco-role: operating9license: Apache 2.010---1112# Autodistill Utilities1314Use 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.1516For main auto-labeling workflows and dataset layout, use [dataset labeling](../dataset-labeling/SKILL.md). For CLI model selection, use [CLI and model registry](../cli-and-model-registry/SKILL.md). For custom model interface design, use [ontologies and model interfaces](../ontologies-and-model-interfaces/SKILL.md).1718## Quick Route1920- **Image input conversion:** read [image loading and visualization](references/image-loading-and-visualization.md) for `load_image` accepted inputs/outputs and headless plotting guidance.21- **Utility function signatures and side effects:** read [utility reference](references/utility-reference.md) for `load_image`, `split_data`, `split_video_frames`, `sync_with_roboflow`, `plot`, and `compare`.22- **Utility failures:** read [troubleshooting](references/troubleshooting.md) for invalid paths, unsupported return formats, URL/network failures, OpenCV/Pillow issues, headless display, Roboflow credentials, and directory mutation.23- **Safe local image-loading check:** run [scripts/check_image_loading.py](scripts/check_image_loading.py). It creates its own local fixture by default and does not need network.2425## Common Pattern2627```python28from autodistill.helpers import load_image2930cv2_image = load_image("image.jpg", return_format="cv2")31pil_image = load_image(cv2_image, return_format="PIL")32np_image = load_image(pil_image, return_format="numpy")33```3435Use `load_image` when a plugin expects a specific image object format but your workflow has a path, PIL image, or NumPy/OpenCV array.3637## Headless Visualization Pattern3839```python40from autodistill.utils import plot4142annotated = plot(image=image, detections=detections, classes=classes, raw=True)43# Save or inspect annotated instead of relying on an interactive display.44```4546`plot(..., raw=False)` uses `supervision.plot_image`, which may not be suitable for headless runs.4748## Safety Notes4950- `load_image` can fetch HTTP URLs; avoid that branch unless network use is approved.51- `sync_with_roboflow` logs into Roboflow, downloads images, labels them, and uploads annotations; treat it as credentialed and externally mutating.52- `split_data` mutates a dataset output directory by moving files and converting `.png`/`.jpeg` to `.jpg` inside that output layout.