Export labels from project

When you export your annotations from Labelbox, you will get a JSON payload containing the annotations for each labeled asset in your dataset.

Due to size, exports for video and DICOM projects will contain a URL for each video that links to an NDJSON file containing the annotations for that video. For more information on retrieving video and DICOM annotations, view the section of this page here.

📘

Skipped and unlabeled assets

The label export will include a JSON payload for skipped assets. In Labelbox, assets that are skipped count as labeled assets, as they were chosen to be skipped at some point in the labeling step.

The information of unlabeled assets will not be included in the label export.

To export your annotations via the Labelbox UI, follow these steps:

  1. Select a project.

  2. Go to the Export tab.

  3. Select the date range you want to export over. This is based on the label created date.

  4. Click the Generate export button.

  5. Download your generated export from the Tasks dropdown. At any time, you can click the bell icon at the top to view your most recent exports. If you want to generate the same export again you'll have to refresh the page.

Label output format

Use this table to find the label output payloads for each asset type.

Export image annotationsSee payload
Export video annotationsSee payload
Export text annotationsSee payload
Export document (PDF) annotationsSee payload
Export geospatial annotationsSee payload
Export audio annotationsSee payload
Export conversational text annotationsSee payload
Export DICOM annotationsSee payload
Export HTML annotationsSee payload

Python SDK

labels = project.label_generator()

## Alternatively you can specify date range to export desired labels from a project
## Date range can be “YYYY-MM-DD” or “YYYY-MM-DD hh:mm:ss”
labels  range can be “YYYY-MM-DD” or “YYYY-MM-DD hh:mm:ss”

labels = project.label_generator(start="2020-01-01", end="2020-01-02")

for label in labels:
  print(label.annotations)
Python TutorialGithubGoogle Colab
Image annotation exportOpen in GithubOpen in Google Colab
Text annotation exportOpen in GithubOpen in Google Colab
Video annotation exportOpen in GithubOpen in Google Colab

Retrieving video and DICOM annotations

API

To access the URL containing the information for the labeled frames, place your API key in the authorization header.

The endpoint this URL points to may return an HTTP 301 response. If this happens, the HTTP response will contain a Location header with the download URL. Each element in the NDJSON file represents each labeled frame in the video or DICOM file (unlabeled frames will not be included).

If the label is skipped and has no data, the endpoint will return an HTTP 204 response.

Bash example

curl -L -H "Authorization: Bearer $API_KEY"  $FRAMES_URL > $FRAMES_FILE_LOCATION

Python example

import requests

headers = {'Authorization': f"Bearer {API_KEY}"}
ndjson_response = requests.get(frames_url, headers=headers)

Postman

You can also access your video annotations using the Postman UI.

Steps:

  1. Open Postman and create a new basic API request.

  2. Copy the URL for frames and paste it as the request URL.

  3. Go to the Headers tab.

  4. Select Authorization as the key.

  5. Paste your API key as the Authorization value.

  6. Click Send.


What’s Next

Click the link below to view the label payload.