Skip to main content
Do you already know what you are doing and only want to look over a Jupyter Notebook example to import your predictions? We provide one here.
To upload predictions in Encord, you need to create a prediction branch. This guide explains everything you need to know for importing predictions.

Predictions Workflow

  1. Import Predictions to Project: Start by importing your labels and predictions into your Project.
  2. Analyze the Predictions: Once your predictions are imported, specify the prediction set you want to analyze.
  3. Select the Predictions: Once analysis completes, select the prediction set you want to view in the Explore tab of your Project.

Supported Prediction Formats

Encord Format (Recommended)
  • Supports multi-level nested classifications (radio, checklist, or free-form text) under objects or classifications.
  • Handles all object types and classification.
  • Only top-level objects and classifications are considered when calculating in model metrics.
COCO Format
  • Does not support multiple levels of nested classifications (radio, checklist, or free-form text) under tools or classifications.

Confidence Score

You can include confidence scores when uploading predictions. Encord automatically calculates model metrics based on your prediction set and assigned confidence scores.

Prediction Branches

When importing prediction sets into Encord, they are added as branches to individual label rows on your data units (images, videos, audio). Each data unit has the following:
  • A MAIN branch for ground truth annotations or pre-labels.
  • Optional Consensus branches and Prediction branches for different prediction sets.
Label branches

List Branches

Use list_branches to list all the branches (imported or Consensus) in a Project.
List branches

1. Import Predictions

Import your predictions to a Project. Encord currently supports importing predictions from the Encord format and from COCO.

Import Encord-Format Predictions

Use branch_name to create a prediction branch in label_rows_v2 for a data unit. Get the label rows with list_label_rows_v2(branch_name=...), add your predictions, and save the label rows: the predictions are saved to that branch, not to the main branch.
  • branch_name is case sensitive and can be up to 255 characters long.
  • branch_name supports letters (a-z, A-Z), digits (0-9), and the following special characters: hyphens (-), underscores (_), periods (.), and forward slashes (/).

Import Any Prediction Type to a Prediction Branch

Every example on the Import Labels page works for predictions, for all label types: bounding boxes, rotatable bounding boxes, polygons, polylines, keypoints, bitmasks, object primitives, and classifications. Make these changes to an example:
  • Pass branch_name when you get the label rows.
  • When you call set_for_frames, pass manual_annotation=False to mark the label as a prediction rather than a manual annotation, and pass your model’s score as confidence. If you leave them out, manual_annotation defaults to True and confidence defaults to 1.0.
Get label rows on a prediction branch
Mark a label as a prediction

Example: Bounding Box Predictions

This example imports one bounding box prediction (Cherry) to a video (Cherries_video.mp4) on a prediction branch. The same object instance is tracked across frames 103, 104, and 105, with the model’s confidence score on each frame.
Bounding Box Predictions on a Prediction Branch

Import COCO Labels as Predictions

The following code imports COCO labels as predictions to a prediction branch. For more information on importing COCO labels into Encord, refer to our documentation. Replace the values in the # User input section with your own. Each COCO image is matched to a data unit by its video_title or image_title (present in COCO files exported from Encord), or otherwise by its file_name, which must match the data unit title in Encord. confidence_field_name is the name of the field in each COCO annotation that holds your model’s confidence score, for example score.
COCO Import to a Prediction Branch

Verify Prediction Import

After importing your predictions, verify that your predictions imported. The following code prints all labels and predictions on all branches.
Verify Prediction Import

End-to-End Prediction Import Example

We provide an end-to-end example using a Jupyter Notebook here.

2. Analyze the Predictions

Encord must analyze the predictions before you can view the predictions.
  1. Navigate to the Explore tab of your Project.
  2. Navigate to Predictions > Prediction > Manage.
  3. Click Analyze on the prediction set you want to analyze.
  4. Specify whether you want to import Strict Match or Partial Match predictions.
DO NOT click Import on more than one prediction set at a time.
Analyze Predictions

Strict Match Predictions

All attributes are matched. This mode makes the most comprehensive comparison. A prediction is considered as a true positive only if an exact match of all attributes matches with the ground truth. Strict match

Partial Match Predictions

Only attributes provided in the prediction are compared with the ground truth. Any missing attributes in the prediction, but present in the ground truth, have no impact on the outcome of the prediction. Partial Match

3. Select the Predictions

Once analysis completes:
  1. Navigate to Predictions > Prediction.
  2. Select the prediction set you want to view from the dropdown.

Delete Prediction Sets

  1. Navigate to the Explore tab of your Project.
  2. Navigate to Predictions > Prediction > Manage.
  3. Click the ellipsis icon in the Actions column.
  4. Click Delete.