Skip to content

Latest commit

 

History

History
1042 lines (922 loc) · 109 KB

preprocessing.md

File metadata and controls

1042 lines (922 loc) · 109 KB

Pre-processing

Use a pre-processing recipe to resize exported images or create augmented variants of training images. Save the recipe on the project, then select it by name when exporting a release. This applies the recipe to the export files and preserves the release manifest.

from visionset.kernel.domain import AugmentOp, AugmentStep, RecipeSpec, ResizeStep, ResizeStrategy
from visionset.kernel.services import PreprocessingRecipeService, ReleaseService
from visionset.preprocessing.registry import drivers

spec = RecipeSpec(
    target="yolo11",
    steps=(
        ResizeStep(strategy=ResizeStrategy.LETTERBOX, width=640, height=640),
        AugmentStep(op=AugmentOp.HFLIP),
        AugmentStep(op=AugmentOp.BRIGHTNESS_CONTRAST, amount=0.2),
    ),
    variants_per_asset=2,
)
recipe = PreprocessingRecipeService(workspace).create(project.id, "yolo-640", spec)
ReleaseService(workspace).export(
    release.id,
    exporter,
    dest,
    target=target,
    recipe=recipe.spec,
    recipe_name=recipe.name,
    drivers=drivers(),
)

A recipe is a value

RecipeSpec is what an export snapshots: the steps, in order, and how many augmented variants each training image gets. PreprocessingRecipe wraps one under a name so a project can list and edit it. The two are deliberately separate, because an export keeps the spec by value: editing or deleting a recipe after an export changes nothing about that export, and the export report carries the spec it ran with, its hash, and the Pillow version that produced the bytes.

There is no state on a recipe and no allowed_actions vocabulary. Nothing depends on the stored value once an export has run, so every operation is always offered and every write is unconditional - the one resource here that a schema draft's revision protocol does not apply to.

recipe_hash(spec) is sha256 over the spec's canonical bytes, the same encoder and digest the manifest uses, so two exports carrying the same spec carry the same hash whatever order the fields were written in.

Which exports ran a recipe

Every recipe a surface returns carries used_by: how many succeeded exports ran it (export_count), and the newest one's release_id, release_tag, target and format - target is null for an export that named a format rather than a target. used_by is null when no export ran it. PreprocessingRecipeService.usage(project_id) reads it once for the whole project, from the workspace's succeeded export.release jobs and the project's releases, so its cost does not grow with the number of recipes listed.

The relation exists only on the job side, and it is matched by name: the job's recipe snapshot keeps the name the recipe had when the export was asked for, and nothing else identifies it. Three consequences follow, and all three are by design:

  • a renamed recipe leaves the exports it ran under its old name behind;
  • a new recipe created under a deleted recipe's name inherits that recipe's exports;
  • only queued exports count - POST /releases/{id}/export leaves a job behind, while the CLI's export and MCP's export_release write straight to a directory and leave no record.

The grammar

Step Fields What it does
resize strategy (letterbox, stretch, fill or center_crop), width, height (32 to 8192), pad_value (0 to 255, default 114) Every exported image, base and variant, lands at width × height. stretch scales each axis on its own; letterbox keeps the aspect, scales to fit, and pads the rest with pad_value - the grey YOLO trainers letterbox with themselves. fill keeps the aspect, scales by max(W'/W, H'/H) so the image covers the canvas, and crops the overflow, centred. center_crop does not scale: it cuts a centred width × height window out of the source, and pads with pad_value along an axis where the source is smaller than the window. The two cropping strategies can cut labels down or away - see Cropping.
augment op (one the registry holds), amount (above 0 and at most 0.5, default 0.2), version (default 1), params (default none) One augmentation applied when generating variants. amount bounds the brightness and contrast factors and means nothing to the others. version names which registered version of the op runs, and params holds the parameters that version declares beyond amount - rotate's max_degrees (0.01 to 45, default 15), each later op's own (see the registry's parameter table), and none for hflip, brightness_contrast, rot90, vflip or grayscale. A parameter left out takes its declared default, but is not written into the step, so a step
that leaves it out and one that spells the default out hash as two recipes. The REST body, MCP's recipe tools and the CLI's --spec FILE accept and validate both, and every surface's read-back carries both, so a recipe written with them reads back as it was written. The CLI flag form writes version 1 with no params.

Cross-field rules, refused with the rule named: at most one resize step, and it comes first; each op at most once; coarse_dropout after rotate, translate, zoom, shear, random_crop, random_resized_crop and object_safe_crop when a recipe holds it with any of them, because what a hole hides is judged once and a later cut could cut away the part left showing; object_safe_crop before every step that moves a label - every op but the photometric ones - because it chooses its window from the labels where the resize left them; an augment step needs variants_per_asset of at least 1; and variants_per_asset (0 to 8) needs at least one augment step. target records which export target's hints the recipe was written from and is informational - nothing resolves it, and a recipe applies to any export. balance is optional and plans how many variants each training image gets instead - see Balancing classes.

A step's version must be one the registry holds for its op, and every key in params must be a parameter that version declares, of its declared type and inside its range; amount is the step's own field and never a member of params. Each is refused with the reason named. version and params are left out of a stored or hashed step while they hold their legacy values - version 1, no params - so a recipe written before they existed keeps its canonical bytes and its recipe_hash, and so does one that spells "version": 1 out.

The hints come from the target: GET /export-targets, visionset target list and list_export_targets carry recommended_size, recommended_strategy, trainer_resizes and augmentation_common for each, and a surface preselects from them. Every YOLO target resizes on its own, so pre-resizing is a choice about archive size and loading speed rather than a requirement.

The augmentation registry

What an augmentation is is declared once, in AUGMENT_OPERATIONS (augment_operations() lists it in its stable order: by op, then version), and never inferred from the code that runs it. Each AugmentOperation is one (op, version) and declares:

Field What it says
parameters Every parameter the step carries, with its type (float, int or bool), default and range. inert marks one the step validates but the operation never reads.
family spatial (moves pixels, and so labels) or photometric (changes pixel values only).
modalities What the operation can run on. image only; a scan is refused.
geometries What it can transform - read from AUGMENT_GEOMETRIES, the table the geometry transform refuses by, never restated.
tasks The trainer tasks it can serve. A task not listed is unsupported, not assumed.
semantics What it does to a label's meaning: preserves, mirrors (a class named for a side now names the other), reorients (a class tied to up or down may not survive), recolors (a class defined by its colour may not survive) or occludes (part of what a label covers may be hidden).
loss lossless (never cuts a label it supports) or lossy (asks the same explicit consent a cropping resize does).
drivers The built-in drivers that apply it.
preview Whether a preview's showcase can show it at its declared strength.
reads_labels Whether it chooses its draw from the image's labels as well as the seed. Only object_safe_crop does; see Choosing the window from the labels.
op version family amount semantics loss tasks
hflip 1 spatial inert mirrors lossless detect, segment, classify, obb, semantic
brightness_contrast 1 photometric bounds both factors preserves lossless detect, segment, classify, pose, obb, semantic
rot90 1 spatial inert reorients lossless detect, segment, classify, obb, semantic
vflip 1 spatial inert mirrors lossless detect, segment, classify, obb, semantic
rotate 1 spatial inert; max_degrees bounds the angle reorients lossy detect, segment, classify, obb, semantic
hue_saturation 1 photometric inert recolors lossless detect, segment, classify, pose, obb, semantic
gamma 1 photometric inert preserves lossless detect, segment, classify, pose, obb, semantic
grayscale 1 photometric inert recolors lossless detect, segment, classify, pose, obb, semantic
channel_shift 1 photometric inert recolors lossless detect, segment, classify, pose, obb, semantic
autocontrast 1 photometric inert preserves lossless detect, segment, classify, pose, obb, semantic
gaussian_blur 1 photometric inert preserves lossless detect, segment, classify, pose, obb, semantic
motion_blur 1 photometric inert preserves lossless detect, segment, classify, pose, obb, semantic
noise 1 photometric inert preserves lossless detect, segment, classify, pose, obb, semantic
jpeg 1 photometric inert preserves lossless detect, segment, classify, pose, obb, semantic
downscale 1 photometric inert preserves lossless detect, segment, classify, pose, obb, semantic
coarse_dropout 1 photometric inert occludes lossy detect, pose, obb
shadow 1 photometric inert preserves lossless detect, segment, classify, pose, obb, semantic
translate 1 spatial inert preserves lossy detect, segment, classify, pose, obb, semantic
zoom 1 spatial inert preserves lossy detect, segment, classify, pose, obb, semantic
shear 1 spatial inert preserves lossy detect, segment, classify, pose, obb, semantic
random_crop 1 spatial inert preserves lossy detect, segment, pose, obb, semantic
random_resized_crop 1 spatial inert preserves lossy detect, segment, pose, obb, semantic
object_safe_crop 1 spatial inert preserves lossy detect, segment, pose, obb, semantic

The parameters each op after rotate declares, every one in params, each draw bounded by them:

op parameter (default, range) What each variant draws
hue_saturation max_hue (10, 0 to 180 degrees), max_saturation (0.3, 0 to 0.9) A hue turn in [-max_hue, max_hue] degrees, then a saturation factor in [1 - max_saturation, 1 + max_saturation].
gamma max_gamma (1.5, 1.01 to 3) A gamma log-uniform in [1 / max_gamma, max_gamma], applied to every colour channel - an exposure curve.
grayscale none Nothing: every variant loses its colour, kept as three equal channels.
channel_shift max_shift (0.1, 0.01 to 0.5) Three gains, red, green and blue, each in [1 - max_shift, 1 + max_shift] - a white-balance error.
autocontrast cutoff (1, 0 to 20 percent) Nothing: the darkest and lightest cutoff percent are clipped and the tones stretched to the full range, keeping hue. Pillow's ImageOps.autocontrast; histogram equalization and CLAHE are not offered.
gaussian_blur max_radius (2, 0.1 to 10 pixels) A Gaussian radius in (0, max_radius] pixels.
motion_blur max_length (9, 3 to 63 pixels) A smear length in [3, max_length] pixels and an axis, horizontal or vertical; diagonal smears are not offered.
noise max_sigma (10, 0.5 to 50 grey levels) A standard deviation in (0, max_sigma] and a 32-bit key the noise samples are derived from, independently per channel.
jpeg min_quality (30, 5 to 95) A JPEG quality in [min_quality, 95].
downscale min_scale (0.5, 0.1 to 0.9) A factor in [min_scale, 1): the picture is shrunk by it and scaled back to its own size.
coarse_dropout holes (4, 1 to 8), max_size (0.2, 0.02 to 0.5), fill (0, 0 to 255) holes rectangles, each side in (0, max_size] of the picture's, placed anywhere on it and filled with the grey fill. They may overlap.
shadow max_strength (0.5, 0.05 to 0.8) A darkening in (0, max_strength] at one side of the frame, fading linearly to none at the other, along a direction drawn from a full turn.
translate max_translate (0.1, 0.01 to 0.5), fill (0, 0 to 255) A share of the width and a share of the height, each in [-max_translate, max_translate], rounded to whole pixels; the canvas the picture leaves bare is filled with the grey fill.
zoom max_zoom (0.2, 0.01 to 0.5), fill (0, 0 to 255) A factor in [1 - max_zoom, 1 + max_zoom], never 1, about the centre: above 1 crops the edges away, below 1 pads them with fill.
shear max_shear (10, 0.01 to 30 degrees), fill (0, 0 to 255) An angle in [-max_shear, max_shear], never 0, and an axis, horizontal or vertical, about the centre; the bare corners are filled with fill.
random_crop min_size (0.6, 0.1 to 0.95) A window whose width and height are the same share of the picture's, in [min_size, 1), placed anywhere on it. The variant is the window's size.
random_resized_crop min_area (0.5, 0.1 to 0.95), max_aspect (1.33, 1 to 2) A window covering a share of the area in [min_area, 1), its width-to-height ratio log-uniform in [1 / max_aspect, max_aspect] relative to the picture's own, scaled back to the picture's size. A window that does not fit is drawn again, at most 10 times; after that the window of the first area at the picture's own ratio is kept, centred, and the draw says fallback.
object_safe_crop min_size (0.6, 0.1 to 0.95) A window whose width and height are the same share of the picture's, in [min_size, 1), and one of the image's objects, placed anywhere that holds the object's bounding box whole. A window too small for the object drawn with it is drawn again, at most 10 times; after that the first is widened to hold the first object, centred on it, and the draw says fallback: widened. An image with no objects keeps the first window, centred, and the draw says fallback: no_objects. The variant is the window's size.

All twenty-three run on images, are applied by the built-in Pillow driver and can be previewed. pose is absent from the mirrors and turns because no keypoint geometry yet says which point becomes which under a mirror, and the turns were registered before that question was separated from it; a move, a zoom, a shear and the crops neither mirror nor re-axis the frame, so every keypoint keeps its identity and they serve pose. classify is absent from the crops, because a window can leave out what an image-level class names. depth is absent from all of them because no label the system carries is a depth map. Eight ops are lossy: rotate, whose turned canvas no longer covers the source's corners, so a label near an edge can be cut down or away - see Rotating: what survives the turn - coarse_dropout, whose holes can hide a label past keeping - see Hiding: what survives the holes - and translate, zoom, shear, random_crop, random_resized_crop and object_safe_crop, whose map can carry part of the picture off the canvas - see Moving, zooming, shearing and cropping. A registered version is never changed: a different default, draw or behaviour is a new version beside it, so a stored recipe keeps meaning what it meant. modalities, geometries, tasks, loss and drivers are what the compatibility resolver refuses an export by. See An augmentation is a registered version for the rule and why it holds.

Every surface publishes the registry as the kernel serializes it, one row per (op, version) with each field above: GET /augmentation-operations, visionset recipe operations (--json for the document) and the MCP tool list_augmentation_operations. It is a property of the build, not of a project, and judges nothing; whether a recipe runs over one release's labels is the recipe assessment's answer.

Which step serves which label

Before an export transforms anything, resolve_augmentation(recipe, carried, target_tasks=, installed_step_kinds=) judges every step of the recipe against every (class, geometry, modality) the export would hand its plugin, and answers one StepCompatibility per pair: supported, conditional (it runs and loses labels the export report counts and consent must cover) or refused, with every reason that applies and a one-sentence message. Pre-flight (check_export, require_export_consent) and the export itself compute it the same way, from the same inputs, and ReleaseService.recipe_compatibility returns it to an SDK caller without refusing anything. Nothing stops at the first problem: a mixed release gets an entry for every class and geometry that fails, so a refusal names all of them.

ReleaseService.assess_recipe(release_id, exporter, recipe, target=, drivers=) answers the same question for a draft, saved or not, and never raises for the recipe. Its RecipeAssessment holds the resolution, the target it is for, and exactly one of counts or refusal. refusal is the code and message an export of the recipe with allow_lossy would refuse it with, caught from the same transform pre-flight and export run and from the format itself. Consent is not part of it: without allow_lossy, a lossy format or a cropping resize is refused for the loss first, and the compatibility report says whether it will be. counts are what the export writes, counted the way the export counts them: the format is handed what the export would hand it and run into a scratch directory, reading a one-pixel stand-in for every image, and every image it reads is recorded. So source_files and augmented_files are the images the format reads - classification-dir leaves out an untagged picture, and mot and cvat-video write only the frames of a tracked sequence - and train_images, val_images and test_images are those files per fold (null without a split). dropped_labels and clipped_labels are what a cropping resize cuts away or down. A format that refuses the layout it is handed, such as a pose export beside boxes, is reported as the export would raise it. An unknown release or a damaged manifest still raises. The assessment transforms the whole manifest and runs the format over it, so its result is cached: a repeat of the same release and recipe does not run the format again.

What the export carries is carried_by(manifest, folds) over the manifest the export hands its plugin - after the format and the target have narrowed it, so a label the export drops is never judged. A resize meets every label; an augmentation meets the labels of the train fold only, because no other fold is augmented, and a release without a split is judged against every label and refused requires_split besides.

Fail closed. A step is supported for a label only where the registry declares it: the op's modalities, geometries and tasks for an augmentation, RESIZE_GEOMETRIES for a resize. Anything else is refused, unknown_combination when nothing more specific names why. That is a property of the resolver rather than something an export meets today: a recipe cannot name an unregistered version, since the spec refuses one when it is written, and every label a release holds is of a geometry the registry rules on. It is what keeps a kind added later - the gated rows below - refused until somebody declares it.

The target is the export's, never the recipe's. A recipe's target only records where its hints came from. The task set judged is that of the target the export is addressed to; an export addressed to a format, or to a target whose family has no trainer (its task set is empty), is judged on the format alone, with no task constraint. A label serves the tasks of its geometry that the target accepts - bbox feeds detect, polygon segment and detect, mask segment and semantic, obb obb, keypoints pose, classification_tag classify - and a label serving none of them is judged against every task of the target, since which one it feeds is not something the export can say. So hflip over a box is supported for a target that also trains pose, and refused over its keypoints.

Reason code Verdict When
modality_unsupported refused The step reads images and the label, or an asset, is on a scan.
geometry_unsupported refused The step cannot transform the geometry - the table in Where the geometry moves.
task_unsupported refused The target trains the label for a task the op does not declare.
semantics_unrepresentable refused The op's semantic effect would change what the label means, and nothing in the data model can say how.
driver_unavailable refused No installed driver applies the step's kind, or none is declared for the op. Judged only when the caller hands the installed drivers; the export always does.
loss_requires_consent conditional The step can cut a label down or away: a fill or center_crop resize, or a lossy op - rotate, translate, zoom, shear, random_crop, random_resized_crop, or coarse_dropout, which hides rather than cuts - over any geometry it supports but classification_tag. The loss is counted in the compatibility report and consented to with allow_lossy.
requires_split refused The recipe augments and the release has no split.
unknown_combination refused Nothing declares the combination supported.

The matrix for every registered op, judged over one label of each kind - generated from the resolver by scripts/export_augmentation_matrix.py, and held to it by a test. Feeds is the tasks a label of the kind can be trained for. A cell is the verdict without a target, then what a target's tasks add: "when trained for pose" refuses the cell when the target trains that label for pose, and "under a target training ..." is the fail-closed rule above - a label whose fed tasks the target trains none of is judged against every task it does train. A lane or a 3D label feeds nothing, so a target training pose or depth refuses a spatial op over it. depth is refused by every op, because no op declares it and no label feeds it. text and panoptic are gated: no geometry carries them yet, and every op refuses them until one does - with semantics_unrepresentable besides where the op's effect would change what one means: a mirror, a turn or a hole for text, a hole for a panoptic segment. A caller whose format writes a geometry as a gated kind - masks written as panoptic segments - passes judged_as={GeometryType.MASK: LabelKind.PANOPTIC}, and every step of the recipe, a resize included, is then refused over those labels with the reasons the gated row publishes, before anything is written. The resolver offers it; which formats pass it is the format's to declare.

Label Feeds hflip v1 brightness_contrast v1 rot90 v1 vflip v1 rotate v1 hue_saturation v1 gamma v1 grayscale v1 channel_shift v1 autocontrast v1 gaussian_blur v1 motion_blur v1 noise v1 jpeg v1 downscale v1 coarse_dropout v1 shadow v1 translate v1 zoom v1 shear v1 random_crop v1 random_resized_crop v1 object_safe_crop v1
classification (classification_tag on image) classify supported; task_unsupported under a target training none of classify and training pose or depth supported; task_unsupported under a target training none of classify and training depth supported; task_unsupported under a target training none of classify and training pose or depth supported; task_unsupported under a target training none of classify and training pose or depth supported; task_unsupported under a target training none of classify and training pose or depth supported; task_unsupported under a target training none of classify and training depth supported; task_unsupported under a target training none of classify and training depth supported; task_unsupported under a target training none of classify and training depth supported; task_unsupported under a target training none of classify and training depth supported; task_unsupported under a target training none of classify and training depth supported; task_unsupported under a target training none of classify and training depth supported; task_unsupported under a target training none of classify and training depth supported; task_unsupported under a target training none of classify and training depth supported; task_unsupported under a target training none of classify and training depth supported; task_unsupported under a target training none of classify and training depth refused: geometry_unsupported; task_unsupported when trained for classify; task_unsupported under a target training none of classify and training segment or semantic or depth supported; task_unsupported under a target training none of classify and training depth supported; task_unsupported under a target training none of classify and training depth supported; task_unsupported under a target training none of classify and training depth supported; task_unsupported under a target training none of classify and training depth refused: geometry_unsupported; task_unsupported when trained for classify; task_unsupported under a target training none of classify and training depth refused: geometry_unsupported; task_unsupported when trained for classify; task_unsupported under a target training none of classify and training depth refused: geometry_unsupported; task_unsupported when trained for classify; task_unsupported under a target training none of classify and training depth
bbox (bbox on image) detect supported; task_unsupported under a target training none of detect and training pose or depth supported; task_unsupported under a target training none of detect and training depth supported; task_unsupported under a target training none of detect and training pose or depth supported; task_unsupported under a target training none of detect and training pose or depth conditional: loss_requires_consent; task_unsupported under a target training none of detect and training pose or depth supported; task_unsupported under a target training none of detect and training depth supported; task_unsupported under a target training none of detect and training depth supported; task_unsupported under a target training none of detect and training depth supported; task_unsupported under a target training none of detect and training depth supported; task_unsupported under a target training none of detect and training depth supported; task_unsupported under a target training none of detect and training depth supported; task_unsupported under a target training none of detect and training depth supported; task_unsupported under a target training none of detect and training depth supported; task_unsupported under a target training none of detect and training depth supported; task_unsupported under a target training none of detect and training depth conditional: loss_requires_consent; task_unsupported under a target training none of detect and training segment or classify or semantic or depth supported; task_unsupported under a target training none of detect and training depth conditional: loss_requires_consent; task_unsupported under a target training none of detect and training depth conditional: loss_requires_consent; task_unsupported under a target training none of detect and training depth conditional: loss_requires_consent; task_unsupported under a target training none of detect and training depth conditional: loss_requires_consent; task_unsupported under a target training none of detect and training classify or depth conditional: loss_requires_consent; task_unsupported under a target training none of detect and training classify or depth conditional: loss_requires_consent; task_unsupported under a target training none of detect and training classify or depth
obb (obb on image) obb supported; task_unsupported under a target training none of obb and training pose or depth supported; task_unsupported under a target training none of obb and training depth supported; task_unsupported under a target training none of obb and training pose or depth supported; task_unsupported under a target training none of obb and training pose or depth conditional: loss_requires_consent; task_unsupported under a target training none of obb and training pose or depth supported; task_unsupported under a target training none of obb and training depth supported; task_unsupported under a target training none of obb and training depth supported; task_unsupported under a target training none of obb and training depth supported; task_unsupported under a target training none of obb and training depth supported; task_unsupported under a target training none of obb and training depth supported; task_unsupported under a target training none of obb and training depth supported; task_unsupported under a target training none of obb and training depth supported; task_unsupported under a target training none of obb and training depth supported; task_unsupported under a target training none of obb and training depth supported; task_unsupported under a target training none of obb and training depth conditional: loss_requires_consent; task_unsupported under a target training none of obb and training segment or classify or semantic or depth supported; task_unsupported under a target training none of obb and training depth conditional: loss_requires_consent; task_unsupported under a target training none of obb and training depth conditional: loss_requires_consent; task_unsupported under a target training none of obb and training depth refused: geometry_unsupported; task_unsupported under a target training none of obb and training depth conditional: loss_requires_consent; task_unsupported under a target training none of obb and training classify or depth refused: geometry_unsupported; task_unsupported under a target training none of obb and training classify or depth conditional: loss_requires_consent; task_unsupported under a target training none of obb and training classify or depth
polygon (polygon on image) detect, segment supported; task_unsupported under a target training none of detect or segment and training pose or depth supported; task_unsupported under a target training none of detect or segment and training depth supported; task_unsupported under a target training none of detect or segment and training pose or depth supported; task_unsupported under a target training none of detect or segment and training pose or depth conditional: loss_requires_consent; task_unsupported under a target training none of detect or segment and training pose or depth supported; task_unsupported under a target training none of detect or segment and training depth supported; task_unsupported under a target training none of detect or segment and training depth supported; task_unsupported under a target training none of detect or segment and training depth supported; task_unsupported under a target training none of detect or segment and training depth supported; task_unsupported under a target training none of detect or segment and training depth supported; task_unsupported under a target training none of detect or segment and training depth supported; task_unsupported under a target training none of detect or segment and training depth supported; task_unsupported under a target training none of detect or segment and training depth supported; task_unsupported under a target training none of detect or segment and training depth supported; task_unsupported under a target training none of detect or segment and training depth refused: geometry_unsupported; task_unsupported when trained for segment; task_unsupported under a target training none of detect or segment and training classify or semantic or depth supported; task_unsupported under a target training none of detect or segment and training depth conditional: loss_requires_consent; task_unsupported under a target training none of detect or segment and training depth conditional: loss_requires_consent; task_unsupported under a target training none of detect or segment and training depth conditional: loss_requires_consent; task_unsupported under a target training none of detect or segment and training depth conditional: loss_requires_consent; task_unsupported under a target training none of detect or segment and training classify or depth conditional: loss_requires_consent; task_unsupported under a target training none of detect or segment and training classify or depth conditional: loss_requires_consent; task_unsupported under a target training none of detect or segment and training classify or depth
mask (mask on image) segment, semantic supported; task_unsupported under a target training none of segment or semantic and training pose or depth supported; task_unsupported under a target training none of segment or semantic and training depth supported; task_unsupported under a target training none of segment or semantic and training pose or depth supported; task_unsupported under a target training none of segment or semantic and training pose or depth conditional: loss_requires_consent; task_unsupported under a target training none of segment or semantic and training pose or depth supported; task_unsupported under a target training none of segment or semantic and training depth supported; task_unsupported under a target training none of segment or semantic and training depth supported; task_unsupported under a target training none of segment or semantic and training depth supported; task_unsupported under a target training none of segment or semantic and training depth supported; task_unsupported under a target training none of segment or semantic and training depth supported; task_unsupported under a target training none of segment or semantic and training depth supported; task_unsupported under a target training none of segment or semantic and training depth supported; task_unsupported under a target training none of segment or semantic and training depth supported; task_unsupported under a target training none of segment or semantic and training depth supported; task_unsupported under a target training none of segment or semantic and training depth refused: geometry_unsupported; task_unsupported when trained for segment, semantic; task_unsupported under a target training none of segment or semantic and training classify or depth supported; task_unsupported under a target training none of segment or semantic and training depth conditional: loss_requires_consent; task_unsupported under a target training none of segment or semantic and training depth conditional: loss_requires_consent; task_unsupported under a target training none of segment or semantic and training depth conditional: loss_requires_consent; task_unsupported under a target training none of segment or semantic and training depth conditional: loss_requires_consent; task_unsupported under a target training none of segment or semantic and training classify or depth conditional: loss_requires_consent; task_unsupported under a target training none of segment or semantic and training classify or depth conditional: loss_requires_consent; task_unsupported under a target training none of segment or semantic and training classify or depth
lane (polyline on image) nothing supported; task_unsupported under a target training pose or depth supported; task_unsupported under a target training depth refused: geometry_unsupported; task_unsupported under a target training pose or depth supported; task_unsupported under a target training pose or depth refused: geometry_unsupported; task_unsupported under a target training pose or depth supported; task_unsupported under a target training depth supported; task_unsupported under a target training depth supported; task_unsupported under a target training depth supported; task_unsupported under a target training depth supported; task_unsupported under a target training depth supported; task_unsupported under a target training depth supported; task_unsupported under a target training depth supported; task_unsupported under a target training depth supported; task_unsupported under a target training depth supported; task_unsupported under a target training depth refused: geometry_unsupported; task_unsupported under a target training segment or classify or semantic or depth supported; task_unsupported under a target training depth conditional: loss_requires_consent; task_unsupported under a target training depth conditional: loss_requires_consent; task_unsupported under a target training depth conditional: loss_requires_consent; task_unsupported under a target training depth conditional: loss_requires_consent; task_unsupported under a target training classify or depth conditional: loss_requires_consent; task_unsupported under a target training classify or depth conditional: loss_requires_consent; task_unsupported under a target training classify or depth
keypoints (keypoints on image) pose supported; task_unsupported when trained for pose; task_unsupported under a target training none of pose and training depth supported; task_unsupported under a target training none of pose and training depth supported; task_unsupported when trained for pose; task_unsupported under a target training none of pose and training depth supported; task_unsupported when trained for pose; task_unsupported under a target training none of pose and training depth conditional: loss_requires_consent; task_unsupported when trained for pose; task_unsupported under a target training none of pose and training depth supported; task_unsupported under a target training none of pose and training depth supported; task_unsupported under a target training none of pose and training depth supported; task_unsupported under a target training none of pose and training depth supported; task_unsupported under a target training none of pose and training depth supported; task_unsupported under a target training none of pose and training depth supported; task_unsupported under a target training none of pose and training depth supported; task_unsupported under a target training none of pose and training depth supported; task_unsupported under a target training none of pose and training depth supported; task_unsupported under a target training none of pose and training depth supported; task_unsupported under a target training none of pose and training depth conditional: loss_requires_consent; task_unsupported under a target training none of pose and training segment or classify or semantic or depth supported; task_unsupported under a target training none of pose and training depth conditional: loss_requires_consent; task_unsupported under a target training none of pose and training depth conditional: loss_requires_consent; task_unsupported under a target training none of pose and training depth conditional: loss_requires_consent; task_unsupported under a target training none of pose and training depth conditional: loss_requires_consent; task_unsupported under a target training none of pose and training classify or depth conditional: loss_requires_consent; task_unsupported under a target training none of pose and training classify or depth conditional: loss_requires_consent; task_unsupported under a target training none of pose and training classify or depth
image_3d (cuboid_3d on image) nothing refused: geometry_unsupported; task_unsupported under a target training pose or depth supported; task_unsupported under a target training depth refused: geometry_unsupported; task_unsupported under a target training pose or depth refused: geometry_unsupported; task_unsupported under a target training pose or depth refused: geometry_unsupported; task_unsupported under a target training pose or depth supported; task_unsupported under a target training depth supported; task_unsupported under a target training depth supported; task_unsupported under a target training depth supported; task_unsupported under a target training depth supported; task_unsupported under a target training depth supported; task_unsupported under a target training depth supported; task_unsupported under a target training depth supported; task_unsupported under a target training depth supported; task_unsupported under a target training depth supported; task_unsupported under a target training depth refused: geometry_unsupported; task_unsupported under a target training segment or classify or semantic or depth supported; task_unsupported under a target training depth refused: geometry_unsupported; task_unsupported under a target training depth refused: geometry_unsupported; task_unsupported under a target training depth refused: geometry_unsupported; task_unsupported under a target training depth refused: geometry_unsupported; task_unsupported under a target training classify or depth refused: geometry_unsupported; task_unsupported under a target training classify or depth refused: geometry_unsupported; task_unsupported under a target training classify or depth
scan (cuboid_3d on point_cloud) nothing refused: modality_unsupported, geometry_unsupported; task_unsupported under a target training pose or depth refused: modality_unsupported; task_unsupported under a target training depth refused: modality_unsupported, geometry_unsupported; task_unsupported under a target training pose or depth refused: modality_unsupported, geometry_unsupported; task_unsupported under a target training pose or depth refused: modality_unsupported, geometry_unsupported; task_unsupported under a target training pose or depth refused: modality_unsupported; task_unsupported under a target training depth refused: modality_unsupported; task_unsupported under a target training depth refused: modality_unsupported; task_unsupported under a target training depth refused: modality_unsupported; task_unsupported under a target training depth refused: modality_unsupported; task_unsupported under a target training depth refused: modality_unsupported; task_unsupported under a target training depth refused: modality_unsupported; task_unsupported under a target training depth refused: modality_unsupported; task_unsupported under a target training depth refused: modality_unsupported; task_unsupported under a target training depth refused: modality_unsupported; task_unsupported under a target training depth refused: modality_unsupported, geometry_unsupported; task_unsupported under a target training segment or classify or semantic or depth refused: modality_unsupported; task_unsupported under a target training depth refused: modality_unsupported, geometry_unsupported; task_unsupported under a target training depth refused: modality_unsupported, geometry_unsupported; task_unsupported under a target training depth refused: modality_unsupported, geometry_unsupported; task_unsupported under a target training depth refused: modality_unsupported, geometry_unsupported; task_unsupported under a target training classify or depth refused: modality_unsupported, geometry_unsupported; task_unsupported under a target training classify or depth refused: modality_unsupported, geometry_unsupported; task_unsupported under a target training classify or depth
text (gated) — refused: unknown_combination, semantics_unrepresentable refused: unknown_combination refused: unknown_combination, semantics_unrepresentable refused: unknown_combination, semantics_unrepresentable refused: unknown_combination, semantics_unrepresentable refused: unknown_combination refused: unknown_combination refused: unknown_combination refused: unknown_combination refused: unknown_combination refused: unknown_combination refused: unknown_combination refused: unknown_combination refused: unknown_combination refused: unknown_combination refused: unknown_combination, semantics_unrepresentable refused: unknown_combination refused: unknown_combination refused: unknown_combination refused: unknown_combination refused: unknown_combination refused: unknown_combination refused: unknown_combination
panoptic (gated) — supported supported supported supported refused: unknown_combination refused: unknown_combination refused: unknown_combination refused: unknown_combination refused: unknown_combination refused: unknown_combination refused: unknown_combination refused: unknown_combination refused: unknown_combination refused: unknown_combination refused: unknown_combination refused: unknown_combination, semantics_unrepresentable refused: unknown_combination refused: unknown_combination refused: unknown_combination refused: unknown_combination refused: unknown_combination refused: unknown_combination refused: unknown_combination

What the data model cannot say is not refused. Nothing marks a class as orientation-bound - a lane whose meaning is its driving side, a sign whose meaning is its reading direction, a label defined by a colour - so every op treats such a class like any other of its geometry. The registry says which ops put such a class at risk instead: hue_saturation, grayscale and channel_shift are recolors, and the recipe editor says so beside each, so a dataset whose classes are colours - a traffic light's state, a ripe fruit - should leave them out. hflip over keypoints is supported when no target trains pose, as described below: no metadata says which points mirror each other.

A refusal keeps the class it has always had, and the order an export always met them in. A scan is ExportSourceUnreadable; then a missing split is AugmentationRequiresSplit, a geometry a step cannot move PreprocessingStepUnsupportedGeometry and a source size the manifest never recorded ExportSourceUnreadable, each with its message and first offender; then a missing driver is PreprocessingDriverNotFound. Every other refusal is AugmentationIncompatible, which never names a missing driver and carries every refused entry as offenders (detail.offenders on REST, the CLI's --json refusal and the MCP envelope); its message names the first five and counts the rest. A conditional entry refuses nothing: its loss is in the compatibility report and the existing consent decides.

Where the geometry moves, and where the pixels do

The kernel owns every coordinate an export writes. transform_manifest moves the annotations - scale and offset for a resize, a mirror for hflip and vflip, a quarter turn for rot90, a turn about the centre for rotate, nothing for brightness_contrast - and the pixel driver moves the bytes, and the two agree because both read the same arithmetic: canvas_fit is the single spelling of where letterbox, fill and center_crop content lands - the scale, the content size round(W·scale) × round(H·scale), and each offset as the integer-floored half of target - content, negative where the content overflows and is cropped - and the per-variant draws come from one seed.

A spatial op that is not a whole-pixel permutation is an affine map from kernel/domain/affine.py, read by both sides. Coordinates are pixel-edge: (0, 0) is the top-left corner of the top-left pixel, pixel (i, j) covers [i, i+1) × [j, j+1) with its centre at (i + 0.5, j + 0.5), and a W × H image's centre is (W / 2, H / 2) whatever the parity. A positive angle turns counter-clockwise on screen, the sense rot90 turns. The geometry transform moves labels through the map; the pixel driver hands the map's inverse to Pillow's affine transform, which samples output pixel centres in the same frame, and a mask is resampled nearest-neighbour through the same inverse in the kernel.

step bbox obb polygon polyline mask keypoints polyline_3d, cuboid_3d classification_tag
stretch scale x, y refused scale scale resampled nearest-neighbour scale refused unchanged
letterbox scale then offset centre and sides scaled, centre offset, angle kept same same resampled nearest-neighbour, padding background same refused unchanged
fill, center_crop scale then offset, clipped to the canvas refused same, clipped; the largest piece kept refused resampled nearest-neighbour; dropped when under half its pixels' centres stay refused refused unchanged
hflip x' = W - x - w cx' = W - cx, angle' = -angle mirror points mirror points, order kept mirrored, exact mirror points, order and visibility kept refused unchanged
brightness_contrast unchanged unchanged unchanged unchanged unchanged unchanged unchanged, calibration kept unchanged
rot90 rotate corners, rebuilt axis-aligned (cx, cy)' = (cy, W - cx), angle' = angle - pi/2 rotate points refused turned, exact; size swaps rotate points, order and visibility kept refused unchanged
vflip y' = H - y - h cy' = H - cy, angle' = -angle mirror points mirror points, order kept mirrored, exact mirror points, order and visibility kept refused unchanged
rotate turn corners, refit axis-aligned, clipped to the canvas centre turned, angle' = angle - θ; dropped if a corner leaves the canvas turn points, clipped; the largest piece kept refused resampled nearest-neighbour, corners background turn points; dropped if a labelled point leaves the canvas refused unchanged
every photometric op but coarse_dropout unchanged unchanged unchanged unchanged unchanged unchanged unchanged, calibration kept unchanged
coarse_dropout unchanged; dropped if the holes hide more than half of it unchanged; dropped if the holes hide more than half of it refused refused refused unchanged; dropped if a visible point is hidden refused refused
translate, zoom move or scale corners, exact, clipped to the canvas centre moved, sides scaled, angle kept; dropped if a corner leaves the canvas map points, clipped; the largest piece kept map points, order kept; dropped if a labelled point leaves the canvas resampled nearest-neighbour, bare canvas background map points, order and visibility kept; dropped if a labelled point leaves the canvas refused unchanged
shear lean corners, refit axis-aligned, clipped refused as translate as translate as translate as translate refused unchanged
random_crop moved into the window, clipped as translate; the window is the canvas as translate as translate as translate; size is the window's as translate refused refused
random_resized_crop window scaled to the canvas, clipped refused as translate as translate as translate as translate refused refused
object_safe_crop as random_crop as random_crop as random_crop as random_crop as random_crop as random_crop refused refused

hflip mirrors a keypoints label's coordinates and nothing else. It does not swap the points a class's spec names left and right, because no metadata says which pairs mirror each other yet - a KeypointSpec holds names and a skeleton, no left/right pairs - so a flipped left_eye is still point 1 and now sits on the right of the picture. A dataset whose keypoints are handed (left and right limbs) should not use hflip until that exists. An export to a target that trains pose, the Ultralytics YOLO targets among them, refuses hflip and vflip over keypoints for that reason, and the refusal says so; rot90 and rotate are refused there too. translate, zoom, shear and the crops serve pose: none of them changes which side a point is on.

A step declares what it can transform, and a geometry it cannot is a typed refusal, never a consent: PreprocessingStepUnsupportedGeometry names the step, the geometry and the first asset carrying it. Today that is rot90 and rotate over a polyline, whose point order carries meaning relative to the frame's axes; a fill or center_crop resize over a polyline, which a crop can cut into pieces with no rule for which piece is the lane - a resize's reach depends on its strategy; a rotated box (obb) under stretch, which scales the axes apart and turns a rotated rectangle into a parallelogram, and under fill or center_crop, whose canvas edge cuts one into a shape that is no longer a rectangle - only letterbox carries it, exactly, since its one scale keeps every angle; a fill or center_crop resize over keypoints (#1158), because a keypoint cut away keeps its slot in the list and nothing in a crop can say whether it became occluded or unlabeled - so no step ever moves a point out of the frame and a keypoint's visibility is never rewritten; and shear and random_resized_crop over a rotated box, which they would turn into a parallelogram; random_crop and random_resized_crop over a classification_tag, because a window can leave out what an image-level class names and keeping the tag would claim it survived; every pixel-moving step over a 3D label: a resize changes the intrinsics it is read through, and a mirror or a quarter turn changes the frame's handedness or axes, so each would need a new calibration per variant. Only brightness_contrast keeps one, and each variant carries its source's calibration. An export that does not write the 3D label - every installed format for a label on an image, with or without a target - drops it before any step runs, counted and behind lossy consent, so it cannot make a step refuse; only the preview, which shows every label, and a format that writes 3D meet the refusal. kitti, the one format that writes 3D, writes scans, and a recipe is refused for an export that writes scans. The lossy-consent path is for a format that cannot carry a label; a label that cannot follow its image is not something to consent to.

Cropping: what survives the cut

fill and center_crop are the only resize steps that lose labels; the lossy augmentations are below. Each label is placed on the canvas by the same arithmetic as the pixels and then cut to the canvas rectangle:

  • a box is clipped to the canvas;
  • a polygon is clipped to the canvas. When the cut leaves several separate pieces - a concave shape whose middle falls off the edge - only the largest piece by area is written; the others are not joined to it along the edge. A run of vertices along a canvas edge is reduced to its two ends, so a source edge lying on the crop line leaves no zero-width spike to stretch a box derived from the points, and no zero-area piece is ever written. Areas are unsigned, per piece. A ring that crosses itself is outside what this promises: the schema does not refuse one, and it may come back as one clipped ring rather than its separate pieces;
  • a label left with less than half its area on the canvas (CROP_KEEP_FRACTION, a fixed 0.5 measured against the label as scaled, before the cut; for a polygon, the piece kept) is dropped, and so is one wholly off it. Exactly half is kept;
  • a mask is resampled nearest-neighbour onto the canvas - every output pixel takes the source pixel under its centre, so the mask stays one label's pixels and two masks of one image never come to share one - and judged by its foreground pixels' own centres, like a turned mask below: cut when one lands off the canvas, dropped when fewer than half stay on it. stretch and letterbox resample a mask too and never cut one; a letterbox's padding is background;
  • a classification_tag has no coordinates and always passes.

A label cut down and kept is reported degraded; a label cut away is reported dropped. The resize runs before every augmentation, so each variant loses exactly the labels its base image does, and the counts are of the release's own labels. Both go into the export's compatibility report beside what the format loses - excluded_annotations and degraded_annotations - and in rows of their own: the labels the crop cut away leave their (class, geometry) row for a dropped row, and the ones it cut down for a degraded row, each with cropped_by naming the strategy and the crop's count in its reason, while the class's other row counts only what the crop left alone. Summed by status, the rows then agree with the totals, and a surface can say the recipe cut a label rather than blaming the format or the target. A drop asks for allow_lossy like any other loss. The geometry transform writes nothing, so it runs before consent is asked: pre-flight (GET /releases/{id}/export-compatibility, export --check, check_export) answers 200 with the loss in the report, and an export without allow_lossy is refused with LossyExportNotConsented before anything is written, carrying the same report - the format's loss and the crop's together, so what a person consents to is what the export writes. A cut-away label is no company for a solitary geometry: if the crop takes every box, a format that writes tags only when they are alone is reported writing them.

Rotating: what survives the turn

rotate turns each augmented variant about the image centre by an angle drawn from [-max_degrees, max_degrees], never 0, and keeps the canvas size: the source's corners turn off the canvas and the uncovered corners are filled - black (opaque where the image has alpha) in the pixels, bilinear; background in a mask, nearest-neighbour. Every label is turned by the same map and then judged against the canvas with the crop's rules and its CROP_KEEP_FRACTION, measured against the turned label:

  • a box turns its four corners and is refitted to the axis-aligned box holding them. That box is looser than the object whenever the angle is not a quarter turn - the operation's declared cost, not counted as a cut. It is then clipped to the canvas: cut when it leaves the canvas, dropped when less than half of it is left;
  • a rotated box turns exactly - its centre moves and the turn is subtracted from its angle
    • and is kept only whole. One with any corner off the canvas is dropped, because a rotated rectangle cut by the canvas edge is no longer a rectangle;
  • a polygon turns its vertices and is clipped as a crop clips one: of several pieces the largest is kept, and it is dropped when that piece is less than half the turned polygon;
  • keypoints turn exactly and are kept only whole: a keypoint carried off the canvas keeps its slot, and nothing in a turn can say whether it became occluded or unlabeled, so the annotation is dropped rather than any visibility rewritten. A point marked unlabeled (visibility 0) has no position to lose and never causes a drop;
  • a mask is resampled nearest-neighbour, but what the turn cut is judged by its foreground pixels' own centres, never by the resampled area: it is cut when one is carried off the canvas and dropped when fewer than half of them stay on it. Resampling alone never drops or cuts a mask; one whose resample lights nothing although its centres stay on the canvas - a lone pixel between two sample points - is written as the pixels under its carried centres;
  • a classification_tag always passes. A polyline and every 3D label are refused.

Every coordinate written lies on the canvas, so no box, polygon or point is ever emitted off it or without area. Unlike a crop, a turn's losses differ per variant, so they are counted per variant copy: each variant file records what its turn cut, and the compatibility report gains rows of their own - dropped and degraded, with augmented_by naming the op - counting the copies cut, never the release's own labels, which the base image always writes. They count towards excluded_annotations and degraded_annotations, so a recipe holding rotate asks for allow_lossy whenever a turn cut anything, before anything is written. The export report's preprocessing carries augment_dropped_annotations and augment_clipped_annotations, and a recipe assessment's counts carry augment_dropped_labels and augment_clipped_labels. Base images and the val and test folds are never turned, so their bytes and labels are those of the same recipe without rotate.

Hiding: what survives the holes

coarse_dropout fills its rectangles in the pixels and moves no label. Each hole is drawn as fractions of the canvas it lands on and placed on whole pixel edges by dropout_rects, which the geometry transform judges labels against and the pixel driver fills, so a label and the pixels hiding it cannot disagree by a rounding. Every label is then kept exactly as it was annotated, or dropped:

  • a box or rotated box is dropped when the holes hide more than half its area (CROP_KEEP_FRACTION, the crop's own share; exactly half is kept), measured exactly over the union of the holes, so two overlapping holes are never counted twice, and against the part of the label on the canvas, so a box mostly off the picture is judged by what the picture shows. A box the holes touch and do not hide past keeping is kept whole and reported degraded: nothing in the label says which part of it is still visible, and no visibility or amodal flag is written;
  • keypoints are kept only wholly visible: a point judged visible, or one with no visibility recorded, under a hole would now be occluded, and a step never rewrites a visibility, so the annotation is dropped. A point already occluded or unlabeled changes nothing;
  • a polygon or mask is refused: kept over a hole, it would still name the hidden pixels as the object, and segmentation would learn the fill as the object. A polyline, a classification tag and every 3D label are refused too - a path or a tag has no area to judge, and a whole-image tag cannot say whether the hole hid what it names. So the op serves detect, obb and pose only, and a target training segment, semantic or classify from a release refuses it.

What the holes cost is counted like a turn's, per variant copy, in augmented_by rows whose reason says the op hides the copies rather than cuts them, and it asks for allow_lossy whenever it hid anything. Pre-flight, the recipe assessment and the export count it from the same plan, so the counts a person consents to are the counts written. A hole is filled opaque in a picture with alpha, as a turn's uncovered corners are.

Moving, zooming, shearing and cropping: what survives the map

translate, zoom, shear, random_crop, random_resized_crop and object_safe_crop are each one affine map of the canvas, spatial_map(draw, width, height) in the kernel: where it sends a point, the canvas it lands on, whether it moves whole pixels and the fill. The geometry transform moves every label through it; the pixel driver resamples through its inverse onto that canvas - nearest for translate and the two plain-window crops, which move whole pixels, so the variant is an exact copy of the source's pixels, and bilinear for the rest. A crop window is drawn as fractions of the canvas and placed on whole pixel edges by crop_rect, the way dropout_rects places a hole, so a label and the pixels around it cannot disagree by a rounding. random_crop's and object_safe_crop's variant is the window's size; every other map keeps the canvas size, and the canvas it leaves bare is the step's fill in the pixels and background in a mask. Every label is then judged by the rules rotate judges by, above, with CROP_KEEP_FRACTION:

  • a box maps its corners and is refitted, exactly for a move, a zoom or a crop and looser for a shear, then clipped to the canvas, cut or dropped by the share left;
  • a rotated box keeps its angle, its centre moved and its sides scaled by a zoom's factor, and is kept only whole. shear and random_resized_crop refuse one: a shear, or a window scaled back to the canvas along two axes apart, turns a rotated rectangle into a parallelogram;
  • a polygon is clipped, the largest piece kept, dropped under half;
  • keypoints and a lane (polyline) map every point in its own order, every visibility carried as it was, and are kept only whole: a point with a position carried off the canvas drops the annotation, because nothing in a crop can say whether it became occluded or unlabeled, or which piece of a cut lane is the lane. A point marked unlabeled never drops one. No new truncation rule is introduced for a lane: one the map cuts is dropped and counted, never clipped;
  • a mask is resampled nearest-neighbour onto the output canvas, and cut or dropped by its pixels' carried centres; no value but the label's own and background is ever written, and two masks of one image never come to share a pixel, so a class map composed from them keeps every class and instance id. A mask whose resample lights nothing is written as its carried centres, as a turned one is, minus every pixel another mask of the image already holds, and is dropped when none is left (a resize does the same);
  • a classification tag passes a move, a zoom and a shear, and is refused by every crop, which therefore serve no classifier.

Each step judges the share left against the label it was handed, not the one annotated, so a label cut by several steps of one recipe can be kept with less than half of its original area; it is reported cut by the last step that cut it. What a map cuts is counted per variant copy, exactly as a turn's is, in augmented_by rows, the export report's augment_dropped_annotations and augment_clipped_annotations and a recipe assessment's augment_dropped_labels and augment_clipped_labels, and asks for allow_lossy before anything is written.

Choosing the window from the labels

object_safe_crop is random_crop with one promise: the window holds at least one of the image's objects whole. It is the one registered op that reads_labels, and the amended rule says what that costs:

  • One snapshot, read once. For each training image the kernel reads an ObjectSnapshot from the release's frozen manifest, narrowed to the labels the export carries - its target's, when it names one: the canvas size after the resize, and every label's bounding box on it - a box's own, a rotated box's corners, a polygon's or lane's vertices, every keypoint with a position, a mask's foreground - sorted, so the order labels were written in never changes a draw. A label with no position, an image-level tag or a keypoint set wholly unlabeled, is not an object, and neither is a label lying partly or wholly off the image, which no window holds whole; an image whose only labels lie off it takes the no_objects fallback. The step runs before any step that moves a label, which the recipe rules hold, so the boxes are where the window cuts.
  • One plan. The plan is sampled from the recipe, the content hash, the snapshot and k, and carries the snapshot. The geometry transform, the pixel driver, the preview and the assessment read that plan; the pixel driver is handed the draw and never a label.
  • The window. Each attempt reads four words of the step's stream: the window's share in [min_size, 1), which object, and where the window lies among the whole-pixel positions that hold that object's box. A window too small for its object is drawn again, at most 10 times, and then the first is widened to hold the first object, centred on it as far as the canvas allows. The draw records objects (how many the snapshot held), target (the one held, counting from 1 in the snapshot's order) and fallback when the draw alone did not choose: widened, or no_objects for an image without any, which keeps the first window, centred. The preview's sampled values show all three. Under showcase the window is min_size, widened if need be and centred on the first object.
  • What it promises. The held object is inside the window to the pixel, so the crop never cuts it; every other label is judged as random_crop judges it, cut, dropped and counted as any crop's loss and consented to with allow_lossy. A step after it - a later cut, a turn, coarse_dropout
    • can still cut or hide the held object, counted as that step's loss. No label is dropped silently and no new truncation rule comes with it.
  • Identity. The variant seed is sha256(f"{recipe_hash}:{content_hash}:{digest}:{k}"), the digest the sha256 of the snapshot's canonical bytes under its own domain tag, and the variant's key is <hash>-obj<digest>-aug<k>. Two assets sharing one image under different label geometry are two variants with two files; under the same geometry - a class renamed, say - they are one, because the pixels are. Every recipe without the step keeps <hash>-aug<k>, its seed, its plans and its report exactly as before.
  • Refusals. An image-level tag is refused, and no classifier is served, as by every crop; a 3D label is refused as by every spatial step; a step that moves a label before it is refused by the recipe. The editor puts it first among the steps for that reason.

Changing pixel values: colour, tone and camera

The ops that change pixel values keep every pixel where it is, so each label - a 3D label and its calibration included - is written exactly as the base image's, and no label is ever lost. Alpha is carried untouched, and a colour change (hue_saturation, channel_shift, grayscale) leaves a grey picture as it is, because it has no colour to change. noise is derived from the draw alone: every sample is the mean of four bytes of SHAKE-256 output keyed by the draw's key, close to Gaussian, so the same plan adds the same noise on every machine without a random source. jpeg compresses through the JPEG codec at the drawn quality; a JPEG source comes back as those compressed bytes themselves rather than being encoded a second time at quality 95, and any other source is decoded from them and written in its own format, so the artefacts survive losslessly. downscale shrinks by box averaging and scales back bilinearly.

The camera ops can hide small things. A blur, a smear, noise, heavy compression or a low resolution can leave a small object or a line of text unreadable in a variant while its label is still written, because nothing in the pixels is judged. Keep their bounds modest for datasets of small objects, and preview the strongest setting before exporting.

Drivers are plugins on the PreprocessingDriver port, discovered over the visionset.preprocessing entry-point group the way exporters are, and the kernel takes driver instances rather than names. The built-in pair uses Pillow, the only image dependency: a JPEG comes back a JPEG at quality 95 with its chroma subsampling kept, a PNG a lossless PNG, and any other encoding a PNG. No metadata travels.

Determinism, and its scope

Variant k of an asset is seeded by sha256(f"{recipe_hash}:{content_hash}:{k}"), and every draw - the brightness and contrast factors, how many quarter turns rot90 makes - reads a fixed position of that digest: brightness word 1, contrast word 2, rot90 word 3. The draws are sampled once into a plan, sample_plan(spec, content_hash=, variant=k): a frozen VariantPlan holding one draw per augmentation step in recipe order. It is a function of the recipe, the image and k alone - and, for a recipe holding object_safe_crop, of the image's label snapshot, which then joins the seed - and both the geometry transform and the pixel driver read it, so neither draws for itself. An operation registered after these three reads its own StepStream instead - an index-addressed sequence of words derived from the variant seed and the step's (op, version) under a domain tag - so under one variant seed a step's draw never depends on which other steps the recipe holds: rotate v1 reads its magnitude from word 0 as max_degrees · (w + 1) / 2^32 and its sign from the low bit of word 1, and vflip and grayscale draw nothing. A bound drawn as (0, max] reads its word as max · (w + 1) / 2^32, so it is never 0; coarse_dropout reads four words per hole - width, height, then where it lies. The seed digests the recipe hash, so changing the steps still changes every variant, as it always has. Nothing draws from a global random source. hflip draws nothing and always mirrors, for the reason rot90 never draws zero turns: a variant that came out identical to its source would be the base image under a variant's name. The same recipe over the same bytes therefore draws the same variant on any machine, and the geometry arithmetic is exact everywhere. This is the export's path; the preview's showcase mode, described below, is the one place a draw is fixed rather than seeded.

Byte stability is promised within one environment only. The pixels a resize or an enhancement produces depend on the codec and resampling code that produced them, so two machines with different Pillow builds can write different bytes for the same variant. The report records pillow_version for exactly this reason, and a digest in the report's mapping is a fact about one run rather than a promise about the next.

A report can be replayed. replay_export_report(report, environment) in the kernel re-derives every plan the report records with sample_plan, from the report's own spec, and compares it with the recorded one. A plan depends on the spec, the source hash and k alone - and on the label snapshot a version-4 plan records, which the replay reads back from the plan itself - so a plan that differs, or a plan of a recipe that reads labels recording no snapshot, is a mismatch wherever the replay runs, and so is a recipe_hash the spec does not produce or a variant outside 1..variants_per_asset - or, in a version-3 report of a balancing recipe, outside 1..n for the variants its source records. The plans must also name every variant row of mapping exactly once: a plan missing, repeated, or naming a file the export did not write is a mismatch, listed in missing_plans, duplicate_plans or unexpected_plans. That includes an empty plans beside variant rows in a version-2 report, which contradicts itself rather than recording nothing; a recipe that wrote no variants replays as match with nothing checked. The codec and the drivers decide the bytes, never the plan: when every plan matches but pillow_version or a driver's name or version differs from the environment the replay runs in (export_environment(drivers)), the outcome is environment_differs, with each difference listed, not a mismatch. Otherwise it is match. A version-1 report, or one without a recipe, records no plans, and its outcome is unrecorded. A replay checks plans, not bytes: to compare the bytes, export again in the same environment and compare mapping. Every registered operation's draw is a plan entry like any other, so the moves, zooms, shears, crops, colour, camera and occlusion operations replay exactly as the original three do, and a report written before them still reads and replays.

visionset recipe replay PATH and the MCP tool replay_export_report replay a report against the drivers installed where they run, without opening a workspace: PATH is the report itself or the directory the export wrote it into. Both answer the outcome and every list above; the CLI exits 1 on mismatch only. The preview of variant k of a training image is that same variant, drawn from the same plan, so a recorded variant can be looked at again without exporting.

Presets

A preset is a ready-made recipe for a common trainer task, to start a draft from. It is an ordinary RecipeSpec built from the registry: choosing one copies its spec into a draft, which is edited and saved like any recipe, and nothing remembers which preset a saved recipe came from. A test holds that every preset is a valid spec and that the resolver supports every step over every label kind the preset claims, under every task it claims.

Preset Tasks Kinds Steps Variants
classification classify classification hflip, rotate (10°), zoom (0.1), brightness_contrast, gamma 2
detection detect bbox hflip, translate (0.1), zoom (0.2), brightness_contrast, gamma, coarse_dropout (3 holes, 0.1) 3
segmentation segment, semantic polygon, mask hflip, translate (0.1), zoom (0.15), brightness_contrast, gamma 2
oriented-detection obb obb hflip, vflip, rot90, translate (0.1), brightness_contrast, gamma 3
pose pose keypoints translate (0.1), zoom (0.15), brightness_contrast, gamma, coarse_dropout (2 holes, 0.1) 2
lanes - lane translate (0.03), zoom (0.05), brightness_contrast, gamma, shadow 2
camera every image task every 2D kind motion_blur, noise, jpeg 2

What the catalog leaves out is deliberate. No preset holds a recolors op, because a class defined by its colour - a traffic light's state - would not survive one. No preset crops: a crop sets the variant's size and serves no classifier. coarse_dropout comes last, after every op that can cut, and never in a segmentation preset, whose polygons and masks it refuses. pose neither mirrors nor turns, because no keypoint schema says which point becomes which. lanes mirrors nothing, because a lane is named for its side, and keeps its move and zoom small, because a lane a map cuts is dropped whole. detection and classification mirror: a class named for a side - left_turn - needs hflip removed. A preset that cuts still needs allow_lossy at export for what it cuts, like any recipe. No preset balances.

GET /recipe-presets, visionset recipe presets (--json for the document) and the MCP tool list_recipe_presets list the catalog; visionset recipe create NAME -p P --preset detection stores a copy, which --resize, --variants and --balance adjust. The recipe editor offers the same list.

Balancing classes

Without a balance, every training image gets variants_per_asset variants. With one, the export plans a count per training image instead, so a class the train fold holds few labels of gains more copies than one it holds many of. Balancing runs only when a recipe asks for it, and only over the train fold: validation and test images, the release and its source images are never touched, and every variant is drawn from the same plan it would be drawn from without a balance.

{
  "target": null,
  "steps": [ { "kind": "augment", "op": "hflip" } ],
  "variants_per_asset": 4,
  "balance": { "policy": "class_target", "targets": { "pedestrian": 400, "cyclist": 200 }, "max_variants": 5000 }
}
Field Meaning
policy uniform raises every class toward the train fold's largest class, counted in labels. class_target raises the classes targets names toward the label counts it names, and aims at no other class.
targets class_target only: a class name and its target label count, at least 1. A uniform balance names none.
max_variants Optional: the most variants the whole export draws.

variants_per_asset becomes the most variants any one image gets, and must be at least 1. The plan is a pure function of the manifest the export hands its format, the release's folds and the spec, so the same release, format, target and recipe always plan the same counts:

  1. Each class's labels are counted on the train fold's base images, over the labels the export writes: those its target carries, or without a target those its format writes whole or degraded. A class the export drops neither sets a target nor draws a variant.
  2. Each training image is driven by one class: of the classes it holds that have a target, the one furthest below its target, as a share of it, ties broken by name. An image holding no such class gets no variant.
  3. In rounds, every image whose driving class is still short of its target gets one more variant, in manifest order, until no image qualifies, variants_per_asset rounds have run, or max_variants is reached. Each variant counts every label the image holds toward its class.

A variant copies every label on its image, so a class sharing images with a rare class rises with it: balancing cannot raise one class alone where labels co-occur, and the plan says so rather than hiding it. A class with no label on the train fold cannot gain any - there is nothing to copy - and stays at 0 whatever its target; a target naming a class the schema does not hold, such as a misspelt one, is reported the same way rather than refused. The last image granted can overshoot a target by its own labels, and a cap can leave a class short.

The plan is reported, never assumed. A recipe assessment carries balance - the policy, variants, images (training images given at least one variant) and per class before, after and target - whether or not the export would refuse, and the export report records the same under preprocessing.balance. after counts the copies the planned variants carry, before any loss a lossy step causes, which the counts beside it report. The export budget, the assessment's file counts and the files written all sum the same per-image counts. A preview shows any variant 1..variants_per_asset of an image, drawn under the balanced recipe's own hash, whether or not the plan gives that image so many.

The train fold, and nothing else

Augmented variants are generated for the train fold only: a model must never validate on a variant of an image it trained on. The folds are the release's own split recipe over its frozen manifest - the same cut GET /releases/{id}/assignment answers - so a variant lands exactly where its source does. A recipe that augments therefore requires a release published with a split, and one without is refused with AugmentationRequiresSplit at pre-flight and again at export. Base images are written for every asset whatever its fold, resized when the recipe says so.

The transform runs after the export is narrowed to its target. A geometry the target's task set does not accept is dropped first, consented through allow_lossy like every other drop, so a polyline a boxes-only target would never write cannot make rot90 refuse. The transform runs before consent is asked, so the refusal's report includes what a cropping resize cuts away; a recipe the transform refuses outright (AugmentationRequiresSplit, PreprocessingStepUnsupportedGeometry, AugmentationIncompatible, PreprocessingDriverNotFound, ExportSourceUnreadable) still loses to an unconsented format loss, so a caller who has not accepted that loss is answered about it first. Either refusal comes before any output exists.

Naming, counting, and the report

A base image keeps its original-hash-derived name; variant k is <hash>-aug<k>, with its label file named the same way beside it - or <hash>-obj<digest>-aug<k> under a recipe whose plans read labels, <digest> the snapshot's whole digest. Inside the kernel that key is what the export's content reader resolves: the plugin sees one manifest asset per file to write, the base under its source hash and each variant under its -aug key, sharing the source's asset_id so the plugin's own fold lookup keeps it with its source.

ExportResult separates what the release held from what the recipe added: source_file_count and augmented_file_count count the images the plugin read and wrote, and the annotation pair counts the labels the same way; file_count stays the total of everything written, labels and descriptors included. visionset-export-report.json gains a preprocessing block - null for an export that applied no recipe. dropped_annotations and clipped_annotations count the release's labels a cropping resize cut away, and cut down and kept; both are 0 for any other recipe. augment_dropped_annotations and augment_clipped_annotations count the variant copies a lossy augmentation - rotate, or coarse_dropout - cut away or hid past keeping, and cut down or hid in part, over every variant written:

{
  "preprocessing": {
    "recipe_name": "yolo-640",
    "spec": { "target": "yolo11", "steps": [ … ], "variants_per_asset": 2 },
    "recipe_hash": "…",
    "pillow_version": "12.0.0",
    "mapping": [
      { "file": "images/train/<hash>.jpg", "source_content_hash": "<hash>", "exported_sha256": "…", "variant": 0 },
      { "file": "images/train/<hash>-aug1.jpg", "source_content_hash": "<hash>", "exported_sha256": "…", "variant": 1 }
    ],
    "dropped_annotations": 0,
    "clipped_annotations": 0,
    "augment_dropped_annotations": 0,
    "augment_clipped_annotations": 0,
    "plans": [
      { "content_hash": "<hash>", "variant": 1, "draws": [ { "op": "hflip", "version": 1 } ] }
    ],
    "sources": [ { "content_hash": "<hash>", "asset_ids": [ "…" ] } ],
    "drivers": [
      { "step_kind": "augment", "name": "visionset.preprocessing.pillow.PillowAugmentDriver", "version": "…" },
      { "step_kind": "resize", "name": "visionset.preprocessing.pillow.PillowResizeDriver", "version": "…" }
    ],
    "steps": [
      { "index": 0, "kind": "resize", "name": "resize", "version": null, "applied": 2, "skipped": [] },
      { "index": 1, "kind": "augment", "name": "hflip", "version": 1, "applied": 1,
        "skipped": [ { "reason": "base_image", "images": 1 } ] }
    ]
  },
  "report_version": 3
}

Every row of mapping traces a written image to the manifest asset it came from; a plugin that names its images after the key it read them under is matched by name, and one that names them its own way is matched by digest.

The report carries report_version, at its root beside the compatibility document. A report without the key is version 1 and holds only the fields above. Version 2 adds four more lists to preprocessing, each recorded from what the export's own transform ran, not worked out again afterwards:

Field What it records
plans The plan each written variant was transformed by: its content_hash, variant and one draw per augmentation step, in recipe order. The recipe hash is the report's own recipe_hash, so a plan does not repeat it. Ordered by source hash, then numerically by variant.
sources Each source hash the written images were read from, with the asset_ids of the manifest assets that hold those bytes. Ids only: an asset's uri is never recorded.
drivers The driver that applied each step kind: its class qualified by module, and its version when the driver declares one. The built-in drivers declare the distribution's version.
steps Per recipe step, in order: index, kind, name, version (augmentations only), how many written images it was applied to, and how many it skipped, by reason. Today the one reason is base_image: an augmentation runs over variants 1..n only.

Version 3 adds what a balancing recipe planned, and nothing for one that does not balance: preprocessing.balance holds the policy, the variants drawn, the training images given at least one and every class's before, after and target, and each sources entry gains variants, the count its bytes were given - the most any asset holding them got. Both are left out of the file when the recipe does not balance.

Version 4 is written only by an export whose recipe holds a step that reads labels, whether or not it wrote a variant, and every other export still writes version 3, byte for byte as before: each such plan gains objects, the snapshot it was sampled from, recorded whole so a replay re-derives the plan from the report alone, and each variant row of mapping gains objects, that snapshot's digest. Plans are then ordered by source hash, digest and variant, and a replay matches plans to rows by all three.

read_export_report in the kernel reads a report of any of the four versions into one typed value, with the later fields empty for an earlier report. A report naming a report_version newer than the build reads is refused with EXPORT_REPORT_VERSION_UNSUPPORTED, carrying report_version and supported_version in its detail; a document that is not a report is refused with EXPORT_REPORT_UNREADABLE, whose message names how many problems were found and where the first is, never the offending value. visionset recipe replay and MCP's replay_export_report read a report and answer both refusals by code; REST has no route that reads one.

The CLI's --json and MCP's export_release result carry sources, drivers and steps as written, but in place of plans only plan_count: a plan per variant is the largest part of the report, and the full list is in the file the export wrote.

Previewing a recipe

POST /projects/{id}/preprocessing-preview takes a spec, an asset and a variant index and answers the image and its placed annotations, rendered on the export's own kernel path over a one-asset manifest with the asset in the train fold - so every variant a spec declares can be looked at whether or not a release exists. The geometry is transform_manifest's and the pixels transformed_bytes', both reading the variant's sample_plan, so no operation has a preview of its own: variant k of a training image, previewed without showcase and under the cap, is the same draws and the same bytes the export writes for it. Its labels are the asset's as they stand now, placed by the same plan, so they match the export's only while the asset's labels are still the ones the release froze and the export's target keeps them all. The body's optional target names the export target to preview for: the labels are then narrowed to what it carries by the function the export narrows by, so a step that reads labels chooses from the same ones and the preview is that export's variant. Choosing the image and k therefore chooses one of the export's own deterministic seeds. The image is capped to 512 pixels on its longer side, labels scaled to match - a rotated box by the cap's one ratio on both axes, so it stays a rectangle and may sit under half a pixel off on the short axis, where the capped size was rounded, and a mask is resampled nearest-neighbour to the capped size, which is lossy and a preview-only resampling - and the response is never cached: the spec is the request's own. width and height are the rendered size; original_width and original_height are the size the asset recorded, and frame_index and source_name say where the sample came from - the frame of a clip, and the name of the source it was ingested from. Each is null when the asset recorded none. export_width and export_height are the size the export writes, and downsampled is true when the cap shrank the image, so its bytes are not the export's.

The response also says what the variant drew and lost. content_hash, recipe_hash and variant are the key the report records the variant's plan under, and draws is that plan: one entry per augmentation step, in recipe order, with the step's op, version and sampled values - a nested value named by its path, a crop's window.x or the second hole's holes.2.width - and empty for the base image. losses names every label a step cut away (dropped) or cut down and kept on the shown image, with its label_class and the step: resize for a cropping resize, which every image of the asset loses alike, or the op that cut this variant alone; one label can have an entry for each. Under the same two conditions, the entries an op made, summed over a release's training images and variants, are the report's augment_dropped_annotations and augment_clipped_annotations. Because the labels are taken before an export's target narrows them, a label the target would drop anyway can still be listed; whether the target accepts the recipe at all is the recipe assessment's answer, which the browser shows beside the preview.

The body also takes showcase, false by default. With it true the variant's draws are fixed at each step's declared strength - hflip and vflip mirror, rot90 makes one quarter turn, rotate turns max_degrees counter-clockwise, brightness and contrast use the full amount, and every later op takes its bound: the largest hue turn, gamma, blur, smear, noise and shadow, the lowest JPEG quality and scale, three channel gains of 1 + max_shift, 1 and 1 - max_shift, a shadow on the left edge, holes rectangles of max_size along the diagonal, a move of max_translate right and down, a zoom in by 1 + max_zoom, a horizontal shear of max_shear, and the centred window of min_size or of min_area at the picture's own ratio - so the picture shows what a step does rather than one seeded draw of it. That is a preview's concern only: an export always takes the seeded path above, and the kernel spells the fixed draws as one sentinel seed (SHOWCASE_SEED) that every draw recognises, sampled into a plan with showcase set, so the pixel driver and the geometry transform still agree through the same code. The response's showcase is true only for such a plan, never for the base image: a showcase picture is an illustration, and no export writes it.

Measured cost

On the recorded baseline, exporting a 5,000-image release with letterbox 640x640, hflip and brightness_contrast at two variants wrote 12,000 images in 93 s, about 31 ms per source image and flat from 500 to 5,000. With the zip the background export adds, it took 153 s and peaked at 4.1 GiB of extra disk for a 594 MB release. A recipe export is held to a budget that is checked before anything is written. A recipe assessment of the same release took 1.7 s on that baseline, which predates the assessment cache.

The assessment cache

Assessing a recipe runs the format, so it is the dialog's slowest repeated call. Measured through assess_recipe over a real workspace on one desktop core, a release of 20,000 assets at the cap of eight variants took 18.8 to 19.6 s cold, and a repeat of the same assessment takes 1.06 to 1.64 s. The repeat is not free: it reads and parses the manifest again, judges the refusals below, builds the key and stats each source blob once. What it skips is the transform and the format's dry run, which are nearly all of the cold time. The counts are the ones the cold call produced, so they stay exact and equal to an export's.

What is kept. The result of the transform and the format's dry run: either the recipe refusal it raised, or the counts (files, folds, dropped and clipped labels) and, for each distinct image the format read, its content hash and how many files it was read for. Nothing else is kept, and the transformed manifest is not.

What is answered on every call. The refusals that read the installed drivers, the export budget or blob sizes: a missing driver, an incompatible step, a scan in the export, an export over the budget, and a blob whose size cannot be read. They run before the cache is consulted, so changing the drivers or the budget takes effect at once. estimated_bytes is summed from the blob store each time, so a blob that goes missing after an assessment makes it null rather than repeating its old size. Each blob is stat-ed once per call. A recipe that one of these refuses is refused afresh every time, and for a resolution refusal that includes running the transform first, because it must report the same first offender an export would; a repeated refused assessment of a very large release is therefore not cheap.

The key. The release id, its manifest hash and split recipe, the recipe's canonical hash (recipe_hash), the format name, the exporter's class and the geometry and modality sets the export hands its plugin are read from, and the whole target definition rather than its name. A release is immutable and a recipe is named by its content, so an entry only answers the inputs it was made from. Drivers and the budget are not part of the key because nothing kept depends on them; they are judged first, as above.

Ownership. One cache per open workspace, held by WorkspaceService.recipe_assessments. The REST server opens one workspace for the whole app and builds a ReleaseService per request, so every request shares the cache. MCP opens a fresh workspace for each tool call and the CLI for each command, so neither ever hits it: their repeats run the format again. The cache lives in memory only and is empty after a restart.

Limits. At most 256 entries and an estimated 64 MiB, least recently used out first. An entry is estimated at 1 KiB plus 192 bytes for each distinct image the format read, so the 20,000-image case is about 3.7 MiB. An entry larger than the bound is answered and not kept.

Failure paths. Concurrent identical requests run the format once; the others wait and share its answer. A recipe refusal from the transform or the format is kept, because it follows from the key. Any other error, such as a damaged manifest or a format that crashes, is never kept: it reaches every waiting caller and the next call runs again. A format installed under a name and class it already had, with different behaviour, in a running process is not detected; restart the server.

The export budget

A recipe is where an export multiplies: each train image is written again for every variant, up to eight. An export that runs a recipe is therefore held to a budget, and an export without one is not. The defaults are 100,000 files and 64 GiB. The file count is the number of distinct files the export hands its format: one per asset, plus one more per variant each train-fold asset gets - variants_per_asset, or the count a balance plans for it - with assets that share a content hash counted once. A format that leaves an image out writes fewer, so it is an upper bound, and the refusal says "up to". The size is an estimate over the same files: each is counted at the size of the source blob it is made from, a variant at its source's, read from the workspace's blob store because a release manifest records no sizes. A resize or an augmentation re-encodes, so the files written can be larger or smaller. The assessment's estimated_bytes sums the same sizes over the files the format actually read, so it is the refusal's figure less anything the format leaves out. It is null when a source blob is missing; the budget then still refuses if the known sizes alone are over the byte limit, and otherwise the export refuses on the missing blob when it runs.

Over either limit the export is refused with ExportBudgetExceeded (EXPORT_BUDGET_EXCEEDED, 409) before anything is written. The message gives the file count, the estimate and both limits, and names the remedy: fewer variants_per_asset, or a larger budget, and for a balancing recipe its max_variants too. The check sits in the transform every entry point shares, so the SDK, REST, the CLI and MCP agree, and a recipe assessment reports it as its refusal with the same code and sentence.

A server, the CLI and MCP read VISIONSET_EXPORT_MAX_FILES and VISIONSET_EXPORT_MAX_BYTES, each a positive integer; an empty value is the same as unset. The kernel reads no environment, so an SDK caller passes ReleaseService(workspace, ExportBudget(max_files=..., max_bytes=...)). The worker that runs the export job reads the same variables as the route that pre-flights it, so the two refuse alike. A server does not start on a value that is not a positive integer, and the CLI and MCP refuse with EXPORT_BUDGET_INVALID naming the variable. Unlike the executor's settings, these are not listed by GET /settings.

A refused export leaves no output: the budget and every recipe refusal are answered before dest is created. A plugin or write failure after that removes, best effort, what the call added to dest: the directory itself when the call created it, otherwise only paths that were not there before. A file that was there and that the plugin overwrote keeps its new content, files reached through a symlinked subdirectory are not removed, and parent directories created for dest stay. A path that cannot be removed is logged and does not replace the original failure. An export job is cancelled between images: the kernel calls an optional checkpoint(done, total) before each image the format reads, and the job's checkpoint raises to stop, which removes the output like any other failure. Memory while exporting does not grow with image size, because each image is transformed and written before the next is read; it does grow with the number of files, through the manifest the format is handed and the record kept of every file for the report, which is metadata and not pixels. done counts distinct files read and total is the upper bound the budget counts. A plugin that catches every exception would swallow the stop, so a format lets it pass.

Refusals

Error When
PreprocessingRecipeNotFound The project has no recipe under that name. 404.
PreprocessingRecipeNameTaken Another recipe of the project carries that name, or a rename lands on one. Checked before writing and refused by a unique index, the ReleaseTagTaken shape. 409.
InvalidName The name is not a slug: lowercase letters, digits, dots, hyphens and underscores, starting with a letter or digit, at most 64 characters. 422.
VALIDATION_ERROR The spec breaks the grammar: two resize steps, a resize after an augmentation, an augmentation repeated, augmentation steps with variants_per_asset 0, variants with no augmentation step, an unknown op, a version the registry does not hold for it, or a params key the version does not declare or a value of the wrong type or out of its range; a balance with variants_per_asset 0, a uniform balance naming targets, a class_target balance naming none, an empty class name, or a target or max_variants below 1. The rule that was broken is the message, in the words above. Refused by the spec model itself, so every surface says the same thing. 422.
AugmentationRequiresSplit The recipe augments and the release was published without a split recipe. Raised at pre-flight and at export. 409.
AugmentationIncompatible The compatibility resolver refuses a step for a label the export carries, for a reason none of the refusals around it names. Today that is one cause: the export's target trains the label for a task the op does not serve - a spatial op over keypoints a target trains for pose, or any op under a target that trains depth. Carries every refused entry as offenders. Raised at pre-flight and at export. 409.
PreprocessingStepUnsupportedGeometry A step met a geometry outside the set it declares it can transform - every step declares supported_geometries the way an exporter does, and today the exclusions are those the table above marks refused: a stretch resize over a rotated box, every resize over a mask, a fill or center_crop resize over a rotated box, a polyline or keypoints, rot90 or rotate over a polyline, and every step but brightness_contrast over a 3D label. Carries step, geometry and the first asset_id. 409.
LossyExportNotConsented A fill or center_crop resize cuts a label down or away, or a rotate cuts a variant's copy of one, and allow_lossy is false - the same refusal, and the same report, as a format that cannot carry a label. Raised by POST /releases/{id}/export (before the job is queued), the CLI's export and MCP's export_release, before anything is written; GET /releases/{id}/export-compatibility and --check answer 200 with the report instead. 409.
ExportSourceUnreadable A step needs the source's pixel size and the manifest never recorded one, or the asset's bytes are gone. 409.
ExportBudgetExceeded The recipe export would hand its format more files, or an estimated size, than the export budget allows. Raised at pre-flight and at export, before anything is written; carries the counts and limits. 409.
PreprocessingDriverNotFound No installed driver applies a step kind the recipe holds. Raised at pre-flight when the surface hands its drivers - REST, the CLI and MCP all do - and at export before anything is written. A fact about the installation, not the request. 500.

On every surface

UI In a release's Export section, choose a saved recipe or create one from the Recipe list, starting from a preset if you like; turn on class balancing in the editor to see each class's labels before and after. The dialog shows the name, model, resize, and augmentation controls on one page. When a training image is available, the preview shows how the recipe transforms it and estimates the output counts for each fold: choose one of the first training images and a variant to see exactly what the export draws for it, with the sampled values and any labels cut, or switch to full strength for an illustration no export writes. Select Create recipe or Save changes to keep the draft. Use Edit or Delete beside the selected recipe to manage it. See exporting in the browser.
REST GET /recipe-presets; POST/GET /projects/{id}/preprocessing-recipes, GET/PUT/DELETE /projects/{id}/preprocessing-recipes/{name}, POST /projects/{id}/preprocessing-preview; recipe= on POST /releases/{id}/export and GET /releases/{id}/export-compatibility; POST /releases/{id}/recipe-assessment judges a draft spec. The job carries the recipe as a snapshot.
CLI visionset recipe create NAME -p P --spec FILE or --resize letterbox:640x640 --augment hflip,brightness_contrast --variants 2 --target yolo11; --preset detection, --balance uniform or --balance class_target:car=500, --max-variants N; recipe presets, recipe list, show, update, delete; recipe assess; export --recipe NAME; recipe replay PATH replays an export's report. See cli.md.
MCP list_recipe_presets, create_preprocessing_recipe, list_preprocessing_recipes, get_preprocessing_recipe, update_preprocessing_recipe, delete_preprocessing_recipe (only with --allow-destructive); assess_recipe for a draft; recipe on export_release and check_export; replay_export_report replays an export's report. See mcp.md.

The export half is described with the rest of exporting in releases.md.