Export labels from project

Learn how to export your annotations from a labeling project.

When you export your annotations from Labelbox, you will get a JSON payload containing the annotations for each labeled asset in your dataset. The export will have a JSON payload for skipped assets as skipped assets count as labeled assets. However, the information on 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

There are two date range filters available for project export. You can use start and end to indicate the date range of the submitted labels' creation. You can also use last_activity_start and last_activity_end to captures the creation and modification of labels, metadata, status, comments, and reviews.

They should be formatted as "YYYY-MM-DD" or "YYYY-MM-DD hh:mm:ss", or None.

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)
  
  
#  Export labels that have been updated since a specific date “YYYY-MM-DD”
labels = project.export_labels(last_activity_start = "2023-02-06",last_activity_end="2023-03-06" )

# Updates captured by this filter include: 
# 1. Any label  updated on the data row
# 2. Any label  deleted on the data row 
# 3. Any review  applied to the data row
# 4. Any review through workflow is applied to the data row
# 5. Any issue or comment is created on the data row
# 6. Any issue or comment is updated on the data row
# 7. Any issue or comment is deleted on the data row
# 8. Any time custom metadata is updated on a data row


Retrieving video and DICOM annotations

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.

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.