Exporting your data
Programmatically export your data with the RedBrick AI SDK in one of the following formats:
  1. 1.
    RedBrick AI Format.
    See reference documentation for overview of format.
  2. 2.
    COCO Format.
    Please see COCO documentation for overview of format.
  3. 3.
    Segmentation PNG masks.
    See reference documentation for overview of format.

Code Example

Perform the standard RedBrick AI SDK set-up to create a RBProject object
1
import redbrick
2
3
# Standard Setup
4
api_key = "<TODO>"
5
org_id = "<TODO>"
6
project_id = "<TODO>"
7
8
project = redbrick.get_project(
9
org_id=org_id,
10
project_id=project_id,
11
api_key=api_key
12
)
Copied!

Export in RedBrick AI Format

1
# Export data in RedBrick AI Format
2
result = project.export.redbrick_format(only_ground_truth=True)
3
4
# Export all data with most recent labels, including datapoints
5
# that haven't been reviewed.
6
result = project.export.redbrick_format(only_ground_truth=False)
7
8
# Export only a single task's labels.
9
# Task id can be found in your project Data Tab.
10
result = project.export.redbrick_format(only_ground_truth=False, task_id="TODO")
Copied!

Export in COCO format

1
# Export data in Coco format
2
result = project.export.coco_format(only_ground_truth=False)
Copied!
COCO format is only supported for the following task types:
image bounding box, image polygon, image segmentation.

Export segmentation labels in PNG format

1
# Exports PNG masks to local directory named project_id
2
project.export.redbrick_png(only_ground_truth=False)
Copied!
PNG format is only supported for image segmentation projects.
Last modified 1mo ago
Copy link
Contents
Code Example