Labelbox documentation

Legacy vs new editor JSON exports

This document compares the JSON export format of the Legacy editor to the JSON export format of the new Editor (released at the end of 2019).

The JSON exports of the new Editor have the following improvements:

  1. The Label object has been expanded to provide more information for each Feature. Instead of each class name appearing as a key at the root of Labelobjects and classifications are now at the root and the information for each Label is distributed between the two properties.

  2. The new Editor supports sub-pixel placement, meaning coordinate pixel values can have decimals in the export file.

The JSON export will contain the following.

Field

Definition

featureID

ID of the Feature (an instance of an object or classification defined in the ontology).

schemaID

ID of the Feature schema that contains all of the information for rendering a Feature of its type.

title

Name of the object or classification defined the ontology.

value

Object or classification the labeler selected or answered.

color (objects only)

Color of the Feature on the asset.

instanceURI (objects only)

URI where you can access the automatically-generated mask for that Feature.

answer (classifications only)

Labeler response to the classification question.

Bounding box

In the new Editor, Bounding box labels give coordinates for the top left corner as well as height and width measurements.

Where:

  • top is the Ymin value

  • left is the Xmin value

"Label": {
     "objects": [
         {
             "featureId": "ck9bmeej61emf0yf5bgjb4tjw",
             "schemaId": "ck9blmq1lnlxw08895jy7zsk4",
             "title": "Sample Bbox",
             "value": "sample_bbox",
             "color": "#FF8000",
             "bbox": {
                 "top": 186,
                 "left": 192,
                 "height": 300,
                 "width": 519
             },
             "instanceURI": "https://api.labelbox.com/masks/feature/ck9bmeej61emf0yf5bgjb4tjw..."
         }
     ],
    "classifications": []
}

In the legacy Editor, the coordinates are in the clockwise direction and the last coordinate isn’t the same as the first.

"Label": {
     "Sample Bbox": [
         {
             "geometry": [
                {
                     "x": 453,
                     "y": 334
                 },
                 {
                     "x": 453,
                     "y": 796
                 },
                 {
                     "x": 1234,
                     "y": 796
                 },
                 {
                     "x": 1234,
                     "y": 334
                 }
            ]
         }
     ]
}

Polyline

In the new Editor, the coordinates in the geometric key are in clockwise order.

"Label": {
     "objects": [
         {
             "featureId": "ck9bmejeu00c20ya10woo1ml5",
             "schemaId": "ck9blmq1lnlxx088964dfy107",
             "title": "Sample Polyline",
             "value": "sample_polyline",
             "color": "#FFFF00",
             "line": [
                 {
                     "x": 328.535,
                     "y": 308.215
                 },
                 {
                     "x": 613.242,
                     "y": 735.277
                 },
                 {
                     "x": 958.026,
                     "y": 907.668
                 },
                 {
                     "x": 1352.437,
                     "y": 905.056
                 }
             ],
             "instanceURI": "https://api.labelbox.com/masks/feature/ck9bmejeu00c20ya10woo1ml5?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiJjazhwNTVueDYzdG45MDgxMWM3Z3p6dXYyIiwib3JnYW5pemF0aW9uSWQiOiJjamhmbjV5NnMwcGs1MDcwMjRuejFvY3lzIiwiaWF0IjoxNTg3NTc3MTI3LCJleHAiOjE1OTAxNjkxMjd9.U5wynJzDMe3ReL71CTzTZO7aojp1GI2TzaIpNK89XaI"
         }
     ],
    "classifications": []
}

In the Legacy editor, the coordinates are in the clockwise order and the last coordinate isn’t the same as the first.

"Label": {
     "Sample polyline": [
         {
             "geometry": [
                 {
                     "x": 1444,
                     "y": 2329
                 },
                 {
                     "x": 1799,
                     "y": 1567
                 },
                 {
                     "x": 2053,
                     "y": 1000
                 },
                 {
                     "x": 2232,
                     "y": 511
                 }
             ]
         }
     ]
}

Polygon

In the new Editor, the xy coordinates are listed in the order that they were initially created (points added after initial creation will be inserted in the proper position).

"Label": {
     "objects": [
         {
             "featureId": "ck9blnafk1d070yf5bhq4q1fv",
             "schemaId": "ck9blmq1lnlxv0889cu4r18mx",
             "title": "Sample Polygon",
             "value": "sample_polygon",
             "color": "#FF0000",
             "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/ck9..."
         }
     ],
    "classifications": []
}

In the Legacy editor, the coordinates are in clockwise order and the last coordinate is not the same as the first.

"Label": {
     "Sample polygon": [
         {
             "geometry": [
                 {
                     "x": 639,
                     "y": 260
                 },
                 {
                     "x": 1485,
                     "y": 288
                 },
                 {
                     "x": 1728,
                     "y": 569
                 },
                 {
                     "x": 2060,
                     "y": 984
                 }
             ]
         }
     ]
}

Point

This is the format for the new Editor.

"Label": {
     "objects": [
         {
             "featureId": "ck9bmemy91hic10bogwc6sygv",
             "schemaId": "ck9blmq1lnlxy0889stzln2ms",
             "title": "Sample Point",
             "value": "sample_point",
             "color": "#D4FF00",
             "point": {
                 "x": 116,
                 "y": 98
             },
             "instanceURI": "https://api.labelbox.com/masks/feature/..."
         }
     ],
    "classifications": []
}

This is the format for the legacy Editor.

Image segmentation (masks)

This is the format for the new Editor.

"Label": {
     "objects": [
         {
             "featureId": "ck9bmetz800340za5k073bm7w",
             "schemaId": "ck9blmq1lnlxz08892qqlmxto",
             "title": "Red Fish",
             "value": "red_fish",
             "color": "#2BFF00",
             "instanceURI": "https://api.labelbox.com/masks/feature/ck9bme..."
         }
     ],
    "classifications": []
}

This is the format for the legacy Editor.

"Label": {
     "is_this_a_question?": "yes",     "segmentationMaskURL": "https://us-central1-labelbox-193903.cloudfunctions.net/superpixel-label-export/ck9n7f1g107bw0785tw7gjwlu%2Fck9n7gcm0a5cs0805plqd5hxr.lbx?alt=media&token=ea97cb82-6e7b-4526-8d4b-d3de80ff5f25&format=png&visible=true",
     "segmentationMasksByName": {
         "Background": "https://us-central1-labelbox-193903.cloudfunctions.net/superpixel-label-export/ck9n7f1g107bw0785tw7gjwlu%2Fck9n7gcm0a5cs0805plqd5hxr.lbx?alt=media&token=ea97cb82-6e7b-4526-8d4b-d3de80ff5f25&format=png&visible=true&color=[255,255,255,255]",
        "SegmentationClass1": "https://us-central1-labelbox-193903.cloudfunctions.net/superpixel-label-export/ck9n7f1g107bw0785tw7gjwlu%2Fck9n7gcm0a5cs0805plqd5hxr.lbx?alt=media&token=ea97cb82-6e7b-4526-8d4b-d3de80ff5f25&format=png&visible=true&color=[255,0,0,255]"
     }
}

Image classification

The following examples contain all 4 classification types: Radio, Checklist, Text, and Dropdown.

This is the format for the new Editor.

"Label": {
    "objects": [],
    "classifications": [
         {
             "featureId": "ck9bloche1fy910bom8fgji90",
             "schemaId": "ck9blmq1lnlxs0889u7xa8byw",
             "title": "Free text question",
             "value": "free_text_question",
             "answer": "sample text"
         },
         {
             "featureId": "ck9bloham1d1b0yf5870yxzxp",
             "schemaId": "ck9blmq4ifi4b09760b4ur5ih",
             "title": "Radio question",
             "value": "radio_question",
            "answer": {
                 "featureId": "ck9blohbp1d1c0yf523u34azb",
                 "schemaId": "ck9blmq1lnlxo0889u50lm3dx",
                 "title": "Yes",
                 "value": "yes"
             }
         },
         {
             "featureId": "ck9bloipe005h10evp9txzhi6",
             "schemaId": "ck9blmq4jfi4c0976jzdlk2fw",
             "title": "Checklist question",
             "value": "checklist_question",
             "answers": [
                 {
                     "featureId": "ck9bloiqc005i10evlzlv90v5",
                     "schemaId": "ck9blmq1lnlxq0889oy9h5596",
                     "title": "Red",
                     "value": "red"
                 },
                 {
                     "featureId": "ck9blojbm1doo0zdga69rzqdj",
                     "schemaId": "ck9blmq1lnlxr08893iamqxcz",
                     "title": "Blue",
                     "value": "blue"
                 }
             ]
         },
         {
             "featureId": "ck9nedyfw05v91276aqbzfsnj",
             "schemaId": "ck9nedt5a1kgw0y6tnj17m2i2",
             "title": "Dropdown question",
             "value": "dropdown_question",
             "answer": [
                 {
                     "featureId": "ck9nedyhm05va127627ypedfy",
                     "schemaId": "ck9nedt701kh20y6tqoxgndvv",
                     "title": "Answer",
                     "value": "answer"
                 },
                 {
                     "featureId": "ck9nedyi305vb12764xxeuypd",
                     "schemaId": "ck9nedt8a1khb0y6t37ylx1rb",
                     "title": "Nested answer",
                     "value": "nested_answer"
                 }
             ]
         }
    ]
}

This is the format in the Legacy editor.

"Label": {
     "Radio question": "r1",
     "Checklist question": [
         "c1",
         "c2"
     ],
     "Dropdown question": [
         "d1",
         "d1a"
     ],
     "text question": "text answer"
}

Objects with nested classifications

This is the format in the new Editor.

"Label": {
     "objects": [
         {
             "featureId": "ck9nkjj6j03341081z1d9dpd4",
             "schemaId": "ck9nkgekg00vz109la501ywx2",
             "title": "Sample Polygon",
             "value": "sample_polygon",
             "color": "#FF0000",
             "instanceURI": "https://api.labelbox.com/masks/feature/ck9nkjj6j03341081z1d9dpd4?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiJjazUycnZ4MWtxYXpiMDc3MDBtcTI3eDRsIiwib3JnYW5pemF0aW9uSWQiOiJjazUycnZ4MG1wdzRnMDc2NndncXZqdGw5IiwiaWF0IjoxNTg4Mjk5NTY3LCJleHAiOjE1OTA4OTE1Njd9.vlI_0QUG-wJHZwdk3IZX1E59VAiTkMiF41-QyD1jIGs",
            "classifications": [
                 {
                     "featureId": "ck9nkjl5d03iu0z945fhjo1gb",
                     "schemaId": "ck9nkjdm703bl1064fn42xtn5",
                     "title": "Nested classification",
                     "value": "nested_classification",
                     "answer": {
                         "featureId": "ck9nkjl6f03iv0z94ewv0s74j",
                         "schemaId": "ck9nkjdnq03bu1064oy6qimtn",
                         "title": "Answer 1",
                         "value": "answer_1"
                     }
                 }
             ]
         }
     ]
}

This is the format in the legacy Editor.

"Label": {
     "Sample polygon": [
         {
             "nested_classification": "answer_1",
             "geometry": [
                 {
                     "x": 2031,
                     "y": 1075
                 },
                 {
                     "x": 2325,
                     "y": 2490
                 },
                 {
                     "x": 1553,
                     "y": 2647
                 }
             ]
         }
     ]
}