When creating a segmentannotation
task, you can provide prelabels in the hypothesis
field, so that workers don't have to start from scratch to annotate the image.
In order to add pre-labels in a task using hypothesis, you’ll need to provide these in the hypothesis
field of the payload when creating the task. The schema of the hypothesis object must match the schema of the task response.
- Verify the task response field schema for the desired task type.
- Review your project taxonomy (label names, attribute conditions, annotation types, etc).
- Generate pre-labels that are formatted to match the aforementioned schema and taxonomy.
- Create a task, including a hypothesis field that contains the pre-labels at the same top-level as other task fields such as project and instructions.
The hypothesis format will largely mirror Scale’s task response format. In this particular task type, annotations.combined.indexedImage
and labelMapping
fields are mandatory inside the hypothesis object for simple annotations.
Hypothesis Example:
{
...
"attachment": "https://example.com/attachment.png",
"hypothesis": {
"labelMapping": {
"car": {
"index": 1
},
"person": [
{
"index": 2,
"color": "#e6194b",
"numPixels": 12784
},
{
"index": 3,
"color": "#fc5174",
"numPixels": 39227
},
{
"index": 4,
"color": "#de3073",
"numPixels": 855
}
]
},
"annotations": {
"combined": {
"indexedImage": "https://example.com/mask.png"
}
}
},
...
}
{
"labels": [
{
"choice": "car"
},
{
"choice": "person",
"instance_label": true
}
],
"allow_unlabeled": true,
"annotation_attributes": {}
}
{
"annotations": {
"combined": {
"image": "https://s3.labeling-data.net/scale-cds-public-us-west-2/632",
"indexedImage": "https://s3.labeling-data.net/scale-cds-public-us-west-2/632",
"extendedIndexedImage": "https://s3.labeling-data.net/scale-cds-public-us-west-2/632"
},
"labeled": {
"car": [
"https://s3.labeling-data.net/scale-cds-public-us-west-2/632"
]
},
"unlabeled": "https://s3.labeling-data.net/scale-cds-public-us-west-2/633"
},
"labelMapping": {
"car": [
{
"index": 1,
"color": "#e6194b",
"attributes": null,
"numPixels": 246470
}
]
},
"global_attributes": {},
"is_customer_fix": false
}
Note: Color is not mandatory, if you want to use a particular color to track a segment you can add it to the hypothesis, if not, Scale will generate one for you.
For Semantic Segmentation, you can also add Global Attributes in the hypothesis object at the same level of annotations in the global_attributes
field.