Export as Python Annotation Types

Open In Colab Open a Colab to go through the exercise of exporting image annotations.

Export as JSON

labels = project.export_labels(download=True)

# Optionally, provide a date range as an optional parameter
# This will export only labels created between the supplied dates
# Date range can be formatted as "YYYY-MM-DD" or "YYYY-MM-DD hh:mm:ss"
labels = project.export_labels(download=True, start="2022-09-28", end="2022-10-04")

Annotation export formats

Bounding box

{
    "featureId": "ck9bmeej61emf0yf5bgjb4tjw",
    "schemaId": "ck9blmq1lnlxw08895jy7zsk4",
    "title": "Blue bird",
    "value": "blue_bird",
    "color": "#FF8000",
    "bbox": {
        "top": 186,
        "left": 192,
        "height": 300,
        "width": 519
    }
}

Cuboid

{
          "featureId": "cl8xbe6ji00013b6jityjn1vjk",
          "schemaId": "cl8xbe09b0tbe07zs3kdna7xa",
          "color": "#1CE6FF",
          "title": "cuboid",
          "value": "cuboid",
          "cuboid": {
            "center": {
              "x": 589.1436087437497,
              "y": 301.76757252135343
            },
            "rotation": {
              "x": -0.23864773605446826,
              "y": 0.30897007369484236,
              "z": 0.6676434268107659
            },
            "size": {
              "x": 25,
              "y": 25,
              "z": 35
            },
            "projection": "orthographic",
            "front": {
              "top_left": {
                "x": 591.3950896879612,
                "y": 290.64520273387444
              },
              "top_right": {
                "x": 609.9605298942264,
                "y": 304.8447036383389
              },
              "bottom_left": {
                "x": 575.442287473622,
                "y": 309.66849343648477
              },
              "bottom_right": {
                "x": 594.0077276798871,
                "y": 323.8679943409492
              }
            },
            "back": {
              "top_left": {
                "x": 584.2794898076123,
                "y": 279.66715070175763
              },
              "top_right": {
                "x": 602.8449300138775,
                "y": 293.8666516062221
              },
              "bottom_left": {
                "x": 568.326687593273,
                "y": 298.69044140436796
              },
              "bottom_right": {
                "x": 586.8921277995382,
                "y": 312.8899423088324
              }
            }
          },
          "instanceURI": "https://api.labelbox.com/masks/feature/cl8xbe6ji00013b6jityjn1vjk?token=eyJhbGciOiJIUzI1NiIsInkgkfjg6IkpXVCJ9.eyJ1c2VySWQiOiJjbDc1Znp0dmszbmljMDd6bjR1Mm1mN3ZrIiwib3JnYW5pemF0aW9uSWQiOiJjbDc1Znp0djkzbmliMDd6bmJndnYwMGw4IiwiaWF0IjoxNjY1MDc2NTI1LCJleHAiOjE2Njc2Njg1MjV9.1BeHjFyzzYCarcELRk6uh1lhioyjghKaej8r4othtKoNM"
        }

Polygon

{
    "featureId": "ck9blnafk1d070yf5bhq4q1fv",
    "schemaId": "ck9blmq1lnlxv0889cu4r18mx",
    "title": "Black bird",
    "value": "black_bird",
    "color": "#006FA6",
    "polygon": [
        {
            "x": 3665.814,
            "y": 351.628
        },
        {
            "x": 3762.93,
            "y": 810.419
        },
        {
            "x": 3042.93,
            "y": 914.233
        },
        {
            "x": 2996.047,
            "y": 864
        },
        {
            "x": 3036.233,
            "y": 753.488
        }
    ],
    "instanceURI": "https://api.labelbox.com/masks/feature/ckmuuwhfh00083g68sdwpwa04?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiJjazUycnZ4MWtxYXpiMDc3MDBtcTI3eDRsIiwib3JnYW5pemF0aW9uSWQiOiJjazUycnZ4MG1wdzRnMDc2NndncXZqdGw5IiwiaWF0IjoxNjE3MDM4NDAwLCJleHAiOjE2MTk2MzA0MDB9.5YaORL6mWpPqgAb6IbWChm4MQo14obOU8LFWbfCEHR0"
}

Polyline

{
    "featureId": "ckmuuwb1p00073g68vg3t615r",
    "schemaId": "ckmuuvs5r5njc0y623c4s1dob",
    "title": "Tree branch",
    "value": "tree_branch",
    "color": "#008941",
    "line": [
        {
            "x": 198.027,
            "y": 1979.196
        },
        {
            "x": 321.472,
            "y": 1801.743
        },
        {
            "x": 465.491,
            "y": 1655.152
        }
    ],
}

Point

{
    "featureId": "ck9bmemy91hic10bogwc6sygv",
    "schemaId": "ck9blmq1lnlxy0889stzln2ms",
    "title": "Bird eye",
    "value": "bird_eye",
    "color": "#D4FF00",
    "point": {
        "x": 116,
        "y": 98
    },
    "instanceURI": "https://api.labelbox.com/masks/feature/ckmuuw0st00043g68jfguoplb?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiJjazUycnZ4MWtxYXpiMDc3MDBtcTI3eDRsIiwib3JnYW5pemF0aW9uSWQiOiJjazUycnZ4MG1wdzRnMDc2NndncXZqdGw5IiwiaWF0IjoxNjE3MDM4NDAwLCJleHAiOjE2MTk2MzA0MDB9.5YaORL6mWpPqgAb6IbWChm4MQo14obOU8LFWbfCEHR0"
}

Mask

{
    "featureId": "ck9bmetz800340za5k073bm7w",
    "schemaId": "ck9blmq1lnlxz08892qqlmxto",
    "title": "Orange bird",
    "value": "orange_bird",
    "color": "#2BFF00",
    "instanceURI": "https://api.labelbox.com/masks/feature/ckmuuw2tq00053g68rbwjpoim?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiJjazUycnZ4MWtxYXpiMDc3MDBtcTI3eDRsIiwib3JnYW5pemF0aW9uSWQiOiJjazUycnZ4MG1wdzRnMDc2NndncXZqdGw5IiwiaWF0IjoxNjE3MDM4NDAwLCJleHAiOjE2MTk2MzA0MDB9.5YaORL6mWpPqgAb6IbWChm4MQo14obOU8LFWbfCEHR0"
}

Relationship

"relationships": [
     {
        "featureId":"cl12o1opb000g3g6acccvuqui",
        "schemaId":"cl12nq1ik004g0z4lf84q58rm",
        "data":
            {
            "source":"cl12nurbd00013g6an63jifsv",
            "target":"cl12nv4ab00073g6as6jkwcj3"
        },
        "relationshipType":"unidirectional",
        "version": 1
    }
]

Classification - Radio

{
    "featureId": "ckmuuwmp4000a3g68rmku827s",
    "schemaId": "ckmuuvs5p5nj40y629l1570bi",
    "title": "Is it daytime?",
    "value": "is_it_daytime?",
    "answer": {
        "featureId": "ckmuuwmp400093g68qof3hnt8",
        "schemaId": "ckmuuvs7u5njg0y629iiuc216",
        "title": "Yes",
        "value": "yes"
    }
}

Classification - Checklist

{
  "featureId": "cl89b1d3g00013b6k8388lpol",
  "schemaId": "cl89b186w0xg107xkga0fdf4j",
  "scope": "global",
  "title": "Attributes",
  "value": "attributes",
  "answers": [
    {
      "featureId": "cl89b1dln00033b6ky6j9cb62",
      "schemaId": "cl89b186w0xg407xk4yvkf3o8",
      "title": "Crowded",
      "value": "crowded"
    },
    {
      "featureId": "cl89b1e3z00063b6kll28e559",
      "schemaId": "cl89b186w0xg607xk8ogy304a",
      "title": "Foot traffic",
      "value": "foot_traffic"
    },
    {
      "featureId": "cl89b1ekd000a3b6kbiipqxi7",
      "schemaId": "cl89b186w0xg807xke5kg606w",
      "title": "Vehicle traffic",
      "value": "vehicle_traffic"
    }
  ]
}

Classification - Free-form text

{
    "featureId": "ckmuzkkhw000a3g68xegct9wz",
    "schemaId": "ckmuzjtfa64bq0y839bn8ci4l",
    "title": "Free-form text",
    "value": "free-form_text",
    "answer": "Correct text answer"
}

Sample Label payload - Image

[
    {
        "ID": "ckn95nnx000073g68fufpnw7a",
        "DataRow ID": "ckn93aswv1nfw0rfz18rq00mt",
        "Labeled Data": "https://storage.labelbox.com/ck2yve0h0005b07274s4f0v02%2Fca0697fd-a922-a004-3dfd-4c572921ab2a-eva-waardenburg-v-3NQ3pmWkY-unsplash.jpg?Expires=1598717540394&KeyName=labelbox-assets-key-1&Signature=ozyDhfwJNhP_Yijj4rZIan05nS8",
        "Label": {
            "objects": [
                {
                    "featureId": "ckn94on8s00013g68cgjl632a",
                    "schemaId": "ckn94hhay0opt0y6993fb64bl",
                    "title": "Sample object 1",
                    "value": "sample_object_1",
                    "color": "#ffb31c",
                    "bbox": {
                        "top": 1099,
                        "left": 2010,
                        "height": 690,
                        "width": 591
                    },
                    "instanceURI": "https://api.labelbox.com/masks/feature/ckn94on8s00013g68cgjl632a?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiJjazUycnZ4MWtxYXpiMDc3MDBtcTI3eDRsIiwib3JnYW5pemF0aW9uSWQiOiJjazUycnZ4MG1wdzRnMDc2NndncXZqdGw5IiwiaWF0IjoxNjE3OTAzMDU5LCJleHAiOjE2MjA0OTUwNTl9.r6Qw2Qx_wbtflEwnZm-7XzPP-AbZn5VuIQ4_ETjBqJc"
                },
                {
                    "featureId": "ckn94pfs700033g68hidmdqsg",
                    "schemaId": "ckn94hhay0opv0y69fbpg76bs",
                    "title": "Sample object 2",
                    "value": "sample_object_2",
                    "color": "#FF34FF",
                    "instanceURI": "https://api.labelbox.com/masks/feature/ckn94pfs700033g68hidmdqsg?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiJjazUycnZ4MWtxYXpiMDc3MDBtcTI3eDRsIiwib3JnYW5pemF0aW9uSWQiOiJjazUycnZ4MG1wdzRnMDc2NndncXZqdGw5IiwiaWF0IjoxNjE3OTAzMDU5LCJleHAiOjE2MjA0OTUwNTl9.r6Qw2Qx_wbtflEwnZm-7XzPP-AbZn5VuIQ4_ETjBqJc"
                }
            ],
            "classifications": [
                {
                    "featureId": "ckn95n44p00063g682vrko4pp",
                    "schemaId": "ckn94hhax0opr0y6936u2db78",
                    "title": "Is it daytime?",
                    "value": "is_it_daytime?",
                    "answer": {
                        "featureId": "ckn95n44o00053g68a1dckji7",
                        "schemaId": "ckn94hhbn0opx0y69bwh6b3je",
                        "title": "yes",
                        "value": "yes"
                    }
                }
            ]
        },
        "Created By": "[email protected]",
        "Project Name": "Beginner tutorial project",
        "Created At": "2021-04-08T17:29:33.000Z",
        "Updated At": "2021-04-08T17:30:34.000Z",
        "Seconds to Label": 149.852,
        "External ID": "layers-testing",
        "Agreement": -1,
        "Benchmark Agreement": -1,
        "Benchmark ID": null,
        "Dataset Name": "image-layers-sample.json",
        "Reviews": [],
        "View Label": "https://editor.labelbox.com?project=ckn889kbvt35m0789527t5rr5&label=ckn95nnx000073g68fufpnw7a",
        "Has Open Issues": 0,
        "Skipped": false,
        "DataRow Workflow Info": {
            "taskName": "Done",
            "Workflow History": [
              {
                "actorId": "cl3lobugu14pw0796fau0dgad",
                "action": "APPROVE",
                "createdAt": "2022-09-29T15:46:23.269Z",
                "previousTaskId": "0ae49522-97f0-4a07-96c6-bd4d50963acd",
                "previousTaskName": "Initial review task"
              },
              {
                "actorId": "cl3lobugu14pw0796fau0dgad",
                "action": "REWORK",
                "createdAt": "2022-09-29T14:23:59.735Z",
                "previousTaskId": "4a0d7f40-0c3f-0cc8-adc4-fd818684facd",
                "previousTaskName": "Rework (all rejected)",
                "nextTaskId": "0ae49522-97f0-4a07-96c6-bd4d50963acd",
                "nextTaskName": "Initial review task"
              },
              {
                "actorId": "cl1qe5naj3g460z6e0owr6mwj",
                "action": "REJECT",
                "createdAt": "2022-09-29T13:39:01.077Z",
                "previousTaskId": "0ae49522-97f0-4a07-96c6-bd4d50963acd",
                "previousTaskName": "Initial review task",
                "nextTaskId": "4a0d7f40-0c3f-0cc8-adc4-fd818684facd",
                "nextTaskName": "Rework (all rejected)"
              },
              {
                "actorId": "cl3ucfsj22j8l073xaitnh1xe",
                "action": "MOVE",
                "createdAt": "2022-09-28T18:06:16.881Z",
                "previousTaskId": "ea78e526-e429-002e-8b80-b72c4b591152",
                "previousTaskName": "Initial labeling task",
                "nextTaskId": "0ae49522-97f0-4a07-96c6-bd4d50963acd",
                "nextTaskName": "Initial review task"
              },
              {
                "actorId": "cl3ucfsj22j8l073xaitnh1xe",
                "action": "MOVE",
                "createdAt": "2022-09-28T18:06:16.859Z",
                "nextTaskId": "ea78e526-e429-002e-8b80-b72c4b591152",
                "nextTaskName": "Initial labeling task"
              }
            ]
        }
    }
]