Model-assisted labeling (MAL)

Import your model outputs (predictions) as pre-labels on your Data Rows.

17901790

The Model-assisted labeling (MAL) workflow allows you to import computer-generated predictions (or simply annotations created outside of Labelbox) and load them as pre-labels on an asset. Using MAL for pre-labeling can be useful for speeding up the labeling process and supporting human labeling efforts.

How it works

Imported annotations will appear when the asset is opened in the Editor as long as the following conditions are met:

  1. Model-assisted labeling is on

  2. The imported annotations are assigned to a Data Row

  3. The asset has not already been labeled in the Labelbox Editor

Currently, if a labeler skips or submits a label without making any changes first, the timer will not start and the duration time recorded will be 0 seconds. This logic may be revised in a future update.

Best practices

  • Make sure the annotations are in the proper format. Use the chart below to determine whether an annotation type is supported for the data type you are labeling.

  • Before you begin a new import job, make sure there are no existing MAL annotations on the Data Row. Duplicate import jobs may result in unexpected behavior.

  • To override an imported annotation on a Data Row, import the annotation again using the same uuid.

Use the Python SDK to create an import job for your annotations. Choose one of the following ways to import your annotations to Labelbox

Option 1: Import via Python annotation types (recommended)

The Labelbox Python Annotation Types provide a common format for representing human and machine-generated annotations. This standard interface allows you to build one set of tools that is compatible with all of your data.

The main advantage of using Annotation types is that it converts your annotations to NDJSON format.

Here are the Python annotation types that are supported for the Model-assisted labeling workflow.

Python annotation type

Image

Video

Text

Tiled imagery

Bounding box

N/A

Polygon

N/A

Point

N/A

Polyline

N/A

Segmentation mask

N/A

Entity

N/A

N/A

N/A

Relationship

Radio

Checklist

Free-form text

Option 2: Import via NDJSON

Your file should be in newline delimited (NDJSON) format. This means that each newline in your NDJSON file should be the entirety of a JSON object.

Create your NDJSON file

Annotation

Image

Video

Text

Audio

Document

Tiled imagery

Bounding box

N/A

N/A

Polygon

N/A

N/A

N/A

Point

N/A

N/A

N/A

Polyline

N/A

N/A

N/A

Segmentation mask

N/A

N/A

N/A

Entity

N/A

N/A

N/A

coming soon

N/A

Relationship

N/A

coming soon

Radio

Checklist

Free-form text

Import your annotations

Visit this page for a complete set of interactive tutorials to learn how to import your annotations via MAL.

Document

# MAL for bounding boxes in Documents
annotations = []

for row in project.export_queued_data_rows():
    print("row: ",row['id'], row['externalId'])
    annotations.append({
        "uuid": "a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a12",
        "name": "box",
        "dataRow": {"id": row['id']},
        "bbox": {"top": 50.0, "left": 200.7, "height": 150.8, "width": 200.0},
        "unit": "POINTS",
        "page": 4
    })

import_annotations = MALPredictionImport.create_from_objects(client=client, project_id = project.uid, name=f"import {str(uuid.uuid4())}", predictions=annotations)
import_annotations.wait_until_done()

Did this page help you?