Skip to main content

Open In Colab

GitHub

Supported predictions

To upload predictions in Labelbox, you need to create the prediction payload. This section provides this payload for every prediction type. Labelbox supports two formats for the predictions payload:
  • Python annotation types (recommended)
  • NDJSON
Both are described below.

Uploading confidence scores is optional

If you do not specify a confidence score, the prediction will be treated as if it had a confidence score of 1.

Point

Polyline

Polygon

Bounding box

Classification: Radio (single choice)

Bounding box with nested checklist classification

Bounding box with nested free-text classification

Classification: Checklist (multi-choice)

Classification: Nested radio

Classification: Nested checklist

End-to-end example: Upload predictions to a model run

Follow the steps below to upload predictions to a model run.

Before you start

You will need to import these libraries to use the code examples in this section.
Replace the value of API_KEY with a valid API key to connect to the Labelbox client.

Step 1: Import data rows into Catalog

Step 2: Create/select an ontology for your model predictions

Your model run should have the correct ontology set up with all the tools and classifications supported for your predictions. Here is an example of creating an ontology programmatically for all the example predictions above:

Step 3: Create a Model and model run

Step 4: Send data rows to the model run

Step 5: Create the predictions payload

Create the annotations payload using the snippets of code shown above. Labelbox supports two formats for the annotations payload: NDJSON and Python annotation types. Both approaches are described below with instructions to compose annotations into Labels attached to the data rows. The resulting labels and ndjson_labels from each approach will include every annotation (created above) supported by the respective method.

Step 6: Upload the predictions payload to the Model Run

Step 7: Send annotations to the Model Run (Optional)