Single-choice radio classification
Radio classifications can be applied at the global level and can be nested within an object-type annotation. Use radio classifications when only one option/answer is possible.
Import
Python SDK
Radio
is a type of ClassificationAnnotation
.
Definition
Radio(answer = ClassificationAnswer(name = "OPTION_NAME"))
Parameter | Value |
---|---|
answer | ClassificationAnswer |
Supported data types
Data type | Supported |
---|---|
Images, Video, Text, HTML, DICOM, Tiled and Document | - Yes for global classifications - Partially yes for nested classifications |
Nested classifications with annotation types
In order to import a nested classification with annotation types, the following conditions must be met:
- Must be nested under an
ObjectAnnotation
- Root
ObjectAnnotation
type must be supported on the respective data typeImporting nested classifications within classifications is currently not supported in the Python SDK. Use NDJSON format instead.
radio_annotation = Radio(answer = ClassificationAnswer(name = "second_radio_answer"))
##Creating a label with radio annotation
ground_truth_list = LabelList()
data = VideoData(uid = datarow.uid)
annotation = ClassificationAnnotation(name="CLASSIFICATION_FEATURE_NAME", value = radio_annotation)
ground_truth_list.append(Label(data = data, annotations = [annotation]))
bbox_with_radio_subclass = ObjectAnnotation(
name="bounding_box_class_name",
value=Rectangle(
start=Point(x=0, y=0), # Top left
end=Point(x=10, y=10), # Bottom right
),
classifications=[
ClassificationAnnotation(
name="radio_class_name",
value=Radio(answer=ClassificationAnswer(name="radio_answer_name"))
)
]
)
NDJSON
NDJSON format is recommended if an annotation type is not yet supported in Python SDK or if you are unable to use the Python environment.
Definition
Parameter | Asset type | Required | Description |
---|---|---|---|
uuid | Image Video Text Audio Document Tiled imagery | Yes | A user-generated UUID for each annotation. If you import an annotation to a Data Row and there is already an imported annotation with the same uuid on that Data Row, the latest import will override the previous one. The uuid must be 128 bits (32 characters). The following formats are supported: - A0EEBC99-9C0B-4EF8-BB6D-6BB9BD380A11 - {a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11} - a0eebc999c0b4ef8bb6d6bb9bd380a11 - a0ee-bc99-9c0b-4ef8-bb6d-6bb9-bd38-0a11 - {a0eebc99-9c0b4ef8-bb6d6bb9-bd380a11} |
schemaId | Image Video Text Audio Document Tiled imagery | Yes | The ID of the schema that contains all of the information needed for rendering your annotation. |
dataRow.id | Image Video Text Audio Document Tiled imagery | Yes | The ID of the Data Row where you want to attach the imported annotations. |
answer.schemaId | Image Video Text Audio Document Tiled imagery | Yes | The ID of the radio answer schema. Radio can only have one correct answer so "answer" is singular. |
frames.start | Video | Yes | The first frame you wish to include in the radio classification. |
frames.end | Video | Yes | The last frame you wish to include in the radio classification. |
Supported data types
Data type | Supported |
---|---|
Images, Video, Text, HTML, DICOM, Tiled and Document | - Yes for global classifications - Partially yes for nested classifications within an object are supported only if the root object annotation type is supported on the respective data type. |
Format
// Global classification
{
"uuid": "1278daa6-ce64-4363-be24-4fa5eadffb17",
"dataRow": {
"id": "ckd11jg6scq9c0cq43vmh6i07"
},
"schemaId": "ckd11j3yk000c0z0u4xn6dc4r", // Radio question
"answer": {
"schemaId": "ckd11j415000u0z0ubu7ee4w2" // Radio answer
}
}
// Nested classification
{
"uuid": "532953e6-746f-4d74-945d-b4a9c2786479",
"schemaId": "ckshluz7h7d9b0yb60biaasya",
"dataRow": {
"id": "ckshkj1vj4rsq0yvubkoe76vi"
},
"bbox": {
"top": 57,
"left": 209,
"height": 216,
"width": 152
},
"classifications": [
{
"schemaId": "ckshluz847d9d0yb65oqhfg65", // Nested radio question
"answer": {
"schemaId": "ckshluz8r7d9j0yb6d9l45o1b" // Nested radio answer
}
}
]
}
// For global classifications, do not include the frames section
{
"schemaId": "ckd1295hc00640z0uapvm1xbd", // question schema id
"uuid": "fb72782d-f6ed-43ba-8677-77b03197392d",
"dataRow": {
"id": "ckd1299m8cqbs0cq43mju1bvp"
},
"answer": {
"schemaId": "ckd1295jn00760z0u01hw4yz5" // answer schema id
},
"frames": [
{
"start": 7,
"end": 13,
},
{
"start": 18,
"end": 19,
}
]
}
// Global classification
{
"uuid": "1278daa6-ce64-4363-be24-4fa5eadffb17",
"dataRow": {
"id": "ckd11jg6scq9c0cq43vmh6i07"
},
"schemaId": "ckd11j3yk000c0z0u4xn6dc4r", // Radio question
"answer": {
"schemaId": "ckd11j415000u0z0ubu7ee4w2" // Radio answer
}
}
// Nested classification
{
"uuid": "532953e6-746f-4d74-945d-b4a9c2786479",
"schemaId": "ckshluz7h7d9b0yb60biaasya",
"dataRow": {
"id": "ckshkj1vj4rsq0yvubkoe76vi"
},
"bbox": {
"top": 57,
"left": 209,
"height": 216,
"width": 152
},
"classifications": [
{
"schemaId": "ckshluz847d9d0yb65oqhfg65", // Nested radio question
"answer": {
"schemaId": "ckshluz8r7d9j0yb6d9l45o1b" // Nested radio answer
}
}
]
}
// Global classification
{
"uuid": "1278daa6-ce64-4363-be24-4fa5eadffb17",
"dataRow": {
"id": "ckd11jg6scq9c0cq43vmh6i07"
},
"schemaId": "ckd11j3yk000c0z0u4xn6dc4r", // Radio question
"answer": {
"schemaId": "ckd11j415000u0z0ubu7ee4w2" // Radio answer
}
}
// Nested classification
{
"uuid": "9fd9a92e-2560-4e77-81d4-b2e955800092",
"schemaId": "ck8kukafkqx1a0880iczbrqym",
"dataRow": {
"id": "ck1s02fqxm8fi0757f0e6qtdc"
},
"location": {
"start": 67,
"end": 128
},
"classifications": [
{
"schemaId": "ckshluz847d9d0yb65oqhfg65", // Nested radio question
"answer": {
"schemaId": "ckshluz8r7d9j0yb6d9l45o1b" // Nested radio answer
}
}
]
}
// Global classification
{
"uuid": "1278daa6-ce64-4363-be24-4fa5eadffb17",
"dataRow": {
"id": "ckd11jg6scq9c0cq43vmh6i07"
},
"schemaId": "ckd11j3yk000c0z0u4xn6dc4r", // Radio question
"answer": {
"schemaId": "ckd11j415000u0z0ubu7ee4w2" // Radio answer
}
}
// Nested classification
{
"uuid": "532953e6-746f-4d74-945d-b4a9c2786479",
"schemaId": "ckshluz7h7d9b0yb60biaasya",
"dataRow": {
"id": "ckshkj1vj4rsq0yvubkoe76vi"
},
"bbox": {
"top": 57,
"left": 209,
"height": 216,
"width": 152
},
"classifications": [
{
"schemaId": "ckshluz847d9d0yb65oqhfg65", // Nested radio question
"answer": {
"schemaId": "ckshluz8r7d9j0yb6d9l45o1b" // Nested radio answer
}
}
]
}
// Global classification
{
"uuid": "1278daa6-ce64-4363-be24-4fa5eadffb17",
"dataRow": {
"id": "ckd11jg6scq9c0cq43vmh6i07"
},
"schemaId": "ckd11j3yk000c0z0u4xn6dc4r", // Radio question
"answer": {
"schemaId": "ckd11j415000u0z0ubu7ee4w2" // Radio answer
}
}
// Nested classification
{
"uuid": "532953e6-746f-4d74-945d-b4a9c2786479",
"schemaId": "ckshluz7h7d9b0yb60biaasya",
"dataRow": {
"id": "ckshkj1vj4rsq0yvubkoe76vi"
},
"bbox": {
"top": 57,
"left": 209,
"height": 216,
"width": 152
},
"classifications": [
{
"schemaId": "ckshluz847d9d0yb65oqhfg65", // Nested radio question
"answer": {
"schemaId": "ckshluz8r7d9j0yb6d9l45o1b" // Nested radio answer
}
}
]
}
Export
When you export your Radio classifications from Labelbox, the export file will contain the following information for each Radio.
Python SDK
The export format of the polygon is similar to the import format.
Learn more about exporting annotations using the SDK here
JSON
You will receive a JSON file when you generate an export from the app.
Parameter | Asset type | Description |
---|---|---|
featureId | Image Video Text Audio Document Tiled imagery Conversation | ID of the classification question in the ontology. |
schemaId | Image Video Text Audio Document Tiled imagery Conversation | ID of the schema that contains all of the structural information for the classification question. |
title | Image Video Text Audio Document Tiled imagery Conversation | Text that appears as the classification question. |
value | Image Video Text Audio Document Tiled imagery Conversation | Name of the classification question in the Labelbox database. |
messageId | Conversation | This only applies to radio classifications configured as "Frame/Pixel based" for conversational assets. This corresponds to the messageId of the conversational file. |
answer.featureId | Image Video Text Audio Document Tiled imagery Conversation | ID of the classification answer in the ontology. |
answer.schemaId | Image Video Text Audio Document Tiled imagery Conversation | ID of the schema that contains the structural information for the classification answer. |
answer.title | Image Video Text Audio Document Tiled imagery Conversation | Text that appears as the classification answer. |
answer.value | Image Video Text Audio Document Tiled imagery Conversation | Name of the classification answer in the Labelbox database. |
answer.keyframe | Video | When keyframe is true , it means that a labeler created or made an adjustment to the annotation on that frame. When keyframe is false , it means the annotation was auto-populated or interpolated on that frame. |
Format
{
"featureId": "ckmuuwmp4000a3g68rmku827s",
"schemaId": "ckmuuvs5p5nj40y629l1570bi",
"title": "Is it daytime?",
"value": "is_it_daytime?",
"answer": {
"featureId": "ckmuuwmp400093g68qof3hnt8",
"schemaId": "ckmuuvs7u5njg0y629iiuc216",
"title": "Yes",
"value": "yes"
}
}
{
"featureId": "cknp365y41fk60y9y7nz7faqt",
"schemaId": "ckmvaijzd2elz0y8h06ribh9b",
"title": "Is it daytime?",
"value": "is_it_daytime?",
"answer": {
"featureId": "cknp365y41fka0y9ydabe7be4",
"schemaId": "ckmvaik0p2eml0y8h12z632kq",
"title": "Yes",
"value": "yes",
"keyframe": false
}
}
{
"featureId": "cknp3d0hw00013g68wkjemi6o",
"schemaId": "cknp3ctst06nq0ycte8icc2l3",
"title": "Is it daytime?",
"value": "is_it_daytime?",
"answer": {
"featureId": "cknp3d0hw00003g685c0nj5c1",
"schemaId": "cknp3cttx06oe0yct3f0d6pmz",
"title": "Yes",
"value": "yes"
}
}
{
"featureId": "ckmuuwmp4000a3g68rmku827s",
"schemaId": "ckmuuvs5p5nj40y629l1570bi",
"title": "Is it daytime?",
"value": "is_it_daytime?",
"answer": {
"featureId": "ckmuuwmp400093g68qof3hnt8",
"schemaId": "ckmuuvs7u5njg0y629iiuc216",
"title": "Yes",
"value": "yes"
}
}
{
"featureId": "cknp3d0hw00013g68wkjemi6o",
"schemaId": "cknp3ctst06nq0ycte8icc2l3",
"title": "Is it daytime?",
"value": "is_it_daytime?",
"answer": {
"featureId": "cknp3d0hw00003g685c0nj5c1",
"schemaId": "cknp3cttx06oe0yct3f0d6pmz",
"title": "Yes",
"value": "yes"
}
}
{
"featureId": "ckmuuwmp4000a3g68rmku827s",
"schemaId": "ckmuuvs5p5nj40y629l1570bi",
"title": "Is it daytime?",
"value": "is_it_daytime?",
"answer": {
"featureId": "ckmuuwmp400093g68qof3hnt8",
"schemaId": "ckmuuvs7u5njg0y629iiuc216",
"title": "Yes",
"value": "yes"
}
}
{
"featureId": "cknp3d0hw00013g68wkjemi6o",
"schemaId": "cknp3ctst06nq0ycte8icc2l3",
"title": "user sentiment",
"value": "user sentiment?",
"messageId": "1",
"answer": {
"featureId": "cknp3d0hw00003g685c0nj5c1",
"schemaId": "cknp3cttx06oe0yct3f0d6pmz",
"title": "Positive",
"value": "Positive"
}
}