lacing.adapters.label_studio#
Label Studio JSON adapter.
Label Studio is a popular labeling tool whose canonical export shape is
a JSON array of tasks, each with one or more annotations containing
typed results. We focus on time-interval results (the Audio,
Video, and TimeSeries labeling controls) since lacing is an
interval-annotation system.
Mapping#
Label Studio ↔ lacing
data.audio / data.video / data.url ↔ MediaRef.asset_id
result.from_name ↔ Tier.name
result.value.{start, end} (seconds) ↔ MediaRef.interval
result.value.labels (list of strings) ↔ body['labels']
annotation.completed_by (or user) ↔ Provenance.was_attributed_to
result.origin (“prediction”/…) → confidence heuristic
result.id → preserved in body
result.type → preserved in body
Lossy on dump#
Per-result Label Studio metadata (
image_rotation,original_width, etc.) is dropped — they’re irrelevant for time intervals.Predictions vs annotations distinction is collapsed: lacing tracks AI vs human via
confidenceandprovenance.was_generated_by, and we set Label Studio’sorigintomanualon dump.Multi-annotator support: only one annotation per task is emitted on dump (the first), since lacing’s per-annotation provenance fits Label Studio’s per-task
annotationslist awkwardly.
Spec: https://labelstud.io/guide/export.html
Functions
- lacing.adapters.label_studio.dump(store, target=None, *, pretty=True, **_kwargs)[source]#
Serialize
storeas a Label Studio JSON export.Annotations are grouped by
MediaRef.asset_id— each asset becomes one task with a singleannotations[0]entry collecting every region.confidence < 0.5flips the result into Label Studio’spredictionsslot rather thanannotations.