Overview
- Path type: JSON file (
.json) - Lossiness: Lossy (see below)
- Bbox format: Percentage-based
[x, y, width, height](0..100) - Use case: Label Studio integration, annotation workflows
Key Features
✓ Supports task export array format✓ Rectanglelabels bbox annotations
✓ Handles
annotations and predictions separately✓ Maps
score to/from IR confidence✓ Preserves rotation metadata (flattened to axis-aligned envelope)
✓ Supports legacy
completions fallback⚠️ Rotation is flattened (angle stored as attribute
ls_rotation_deg)⚠️ Requires unique image basenames
Structure
Label Studio uses a task array format:Bounding Box Format
Label Studio uses percentage-based coordinates (0 to 100):Conversion Example
Label Studio value:xmin = (10.0 / 100.0) × 640 = 64.0ymin = (20.0 / 100.0) × 480 = 96.0xmax = ((10.0 + 30.0) / 100.0) × 640 = 256.0ymax = ((20.0 + 40.0) / 100.0) × 480 = 288.0
[64.0, 96.0, 256.0, 288.0]
Annotations vs Predictions
Label Studio distinguishes between:annotations: Human-labeled ground truth (no score)predictions: Model predictions (with score)
confidence:
| Label Studio | IR confidence |
|---|---|
annotations | None |
predictions with score | Some(score) |
Writing Behavior
When writing Label Studio JSON:- IR annotations with
confidence == None→annotations - IR annotations with
confidence == Some(_)→predictions+score
Image Reference Handling
Label Studio stores full image URLs/paths indata.image:
file_name from the basename (query/fragment stripped):
https://example.com/assets/train/img1.jpg→img1.jpg/local/path/img2.jpg→img2.jpgimg3.jpg?size=large→img3.jpg
Image.attributes["ls_image_ref"].
Rotation Handling
Label Studio supports rotated rectangles via therotation field (degrees):
Annotation.attributes["ls_rotation_deg"].
Example
Input:- Compute rotated corners
- Find axis-aligned bounding envelope
- Store
ls_rotation_deg: "45"
Reader Behavior
Supported Input
- Empty array
[](empty dataset) - Task export array with:
annotationsOR legacycompletions(not both)- Optional
predictions - At most one result-set per task
Validation
- Enforces
type == "rectanglelabels" - Requires exactly one label per result
- Requires
original_widthandoriginal_heighton each result - Falls back to
data.width/data.heightif no results present - Requires consistent
from_name/to_namewithin a task
Deterministic IDs
- Image IDs: by derived basename (lexicographic)
- Category IDs: by label name (lexicographic)
- Annotation IDs: by image order then result order
Writer Behavior
Output Format
Writes task export JSON array:Field Defaults
from_name: UsesImage.attributes["ls_from_name"]or defaults to"label"to_name: UsesImage.attributes["ls_to_name"]or defaults to"image"image: UsesImage.attributes["ls_image_ref"]or falls back tofile_name
Rotation
Writes rotation fromAnnotation.attributes["ls_rotation_deg"] if present:
Lossiness
Label Studio format is lossy:Preserved ✓
- Image basenames and dimensions
- Category names
- Bounding boxes (percentage ↔ pixel conversion)
- Confidence (
score↔ IRconfidence) - Rotation angle (as attribute)
from_name/to_name(as attributes)
Not Preserved ✗
- Dataset-level metadata/licenses
- Rotation geometry (flattened to envelope)
- Custom annotation attributes (except rotation)
- Label Studio-specific metadata
Usage
Read Label Studio
label-studio-json, ls
Write Label Studio
Legacy Completions Support
Label Studio’s legacycompletions key is supported as fallback:
completions if annotations is absent. Having both is an error.
See Also
CVAT Format
Another annotation tool format
Format Overview
Compare all supported formats