visionstyle

Object-detection styling for Python

Boxes that
look authored.

visionstyle turns raw model output into a deliberate visual language. One typed Style describes boxes, labels, fills, glow, glass, grain and tracking trails — tuned live in the Studio, saved as YAML, rendered with one call.

Get started
  • 12built-in presets
  • 1typed Style
  • 3.10+Python
  • MITlicence
live preview · night.jpg · yolo11n.pt
A rainy Manhattan street at night annotated with the cinematic preset: rounded amber frames, pill labels and glow around pedestrians, a bus and cars. The same scene annotated with the neon preset: glowing cyan and lime outlines.
vs.annotate(frame, dets, style="cinematic") drag to compare

01 / The idea

Technical sight, turned into a visual language.

Most pipelines stop at a rectangle. visionstyle starts there — then gives you a complete, composable system for shape, label, colour, motion, texture and tracking, all described by one object.

Describe

One typed Style

Box, stroke, fill, line, label, effects and trail live in a single Pydantic model. Every choice is inspectable, portable, and saves as plain YAML.

Tune

By eye, in the Studio

Your image, your model, live controls. The preview is rendered by the Python package itself, so what you see is exactly what annotate() produces.

Track

Let it move

Keep one Annotator per stream and trails, marching dashes, hue cycles and pulses carry across frames — on video or a live webcam.

Render

Any resolution

Sizes are reference pixels at ~1080p and scale automatically, so one style looks identical on a webcam frame and a 4K deliverable.

02 / Presets

Twelve starting points. Every one is YAML.

Pick a mood, then make it yours. Each preset is a plain file you can copy, edit and load by name — vs.Style.preset("hud").

preset / cinematic street.jpg · 01 / 12
A neon-lit street at night with taxis and pedestrians, rendered with the cinematic preset.

Amber / teal rounded frames, pill labels, soft glow, filmic grade

style = vs.Style.preset("cinematic")

03 / Configure

Every parameter. One Style.

Start from a preset, a YAML path, or nothing at all. Every option is a typed attribute, so your editor autocompletes it and Pydantic validates it.

# detections: boxes in pixels, everything else optional
dets = vs.Detections(
    xyxy=[[590, 650, 720, 1040], [1060, 660, 1520, 1000]],
    class_name=["person", "car"],
    confidence=[0.93, 0.88],
    track_id=[14, 31],
)
# or: vs.Detections.from_ultralytics(model.predict(frame)[0])

style = vs.Style.preset("cinematic")
style.label.components = ["track_id", "text"]
style.trail.enabled = True

annotator = vs.Annotator(style)   # one per stream
out = annotator.annotate(frame, dets)

style.save_preset("my-look")      # ~/.visionstyle/presets/my-look.yaml
Box
rectangleroundedcornersreticlenonedouble linecenter mark
Stroke
thicknessopacitypaletteconfidence rampany hex / rgb / name
Fill
solidgradient · 5 directionshatchopacity
Line
soliddasheddottedsegmentsperimeter gradientmarchhue_cyclepulse
Label
textconfidencetrack_idcustom template9 anchors × in / outvertical tagsInter · JetBrains Mono · your .ttfsolidpillglassunderline
Effects
glowshadowfrosted glassspotlightvignettefilm graincolour grade
Tracking
trail lengthfeet / center / topsoliddotteddashedribbonfade & tapersmoothingpoints
Global
paletteper-class overridesconfidence thresholdscale = autofps

04 / The Studio

The preview is the hero,
not a widget.

Design a style visually, on your own image and model, and save it as a preset the package loads by name. Nothing is faked: the canvas is rendered by the same Python engine you ship.

  • Sources

    Upload an image or use the bundled samples; bring a .pt / .onnx model or start with yolo11n.pt.

  • Controls

    Every section of the Style is a live control. Toggle objects, isolate one, play line animations, preview trails on a still.

  • Export

    YAML with only changed values or everything, a clean Python snippet, or Save as preset straight into your presets directory.

shell
pip install "visionstyle[studio,yolo]"
visionstyle studio   # → http://127.0.0.1:8420
Studio documentation
visionstyle studio — 127.0.0.1:8420server live

05 / Install

A few lines
from beautiful.

Core depends on NumPy, OpenCV-headless, Pillow, Pydantic and PyYAML. Add extras for Ultralytics models or the Studio.

  1. 1Install the package

    shell
    pip install visionstyle

    The latest release from PyPI. Python 3.10 – 3.13.

  2. 2Style your first frame

    python
    import cv2
    import visionstyle as vs
    from ultralytics import YOLO
    
    frame = cv2.imread("street.jpg")
    result = YOLO("yolo11n.pt")(frame)[0]
    
    dets = vs.Detections.from_ultralytics(result)
    cv2.imwrite("out.jpg", vs.annotate(frame, dets, style="cinematic"))

    Needs the [yolo] extra. No model handy? visionstyle render sample -s neon -o out.jpg renders a bundled photo with its shipped detections.

The visionstyle Studio at full size.