import_labels
imerit_ango.sdk.SDK.
import_labels(project_id, labels)
Import pre-labels into existing project tasks.
You can only import annotations for tasks in the Start stage.
Please ensure the assets you are trying to annotate as in the Start stage of your project before continuing.
Parameters
project_id: string
The unique identifier for the project. You can find the project ID in the user interface or retrieve it using the
list_projectsfunction.
labels: List[dict]
List of labels to import. See more on our label format here: Ango Annotation Format and learn more about importing labels into Ango Hub here.
Example
[
{
"externalId": "example.png",
"objects": [
{
"schemaId": "09f90db83b842d7bf0c2225",
"bounding-box": {
"x": 192,
"y": 166,
"width": 66,
"height": 61
}
},
{
"schemaId": "09f90db83b842d7bf0c2225",
"bounding-box": {
"x": 56,
"y": 56,
"width": 67,
"height": 44
}
}
]
}
]Returns:
output: dict
A dictionary containing the result of the operation.
Including a
statusfield indicating whether the request was successful and adatafield containing the response payload with updated resources produced by the operation.
When using the import_labels function, all existing annotations on the target task are overwritten by the imported annotations. Existing annotation data cannot be recovered after the operation.
How to verify in Ango Hub?
After successfully executing the import_labels function, you can validate the changes directly in Ango Hub.
Navigate to: Projects → [Your Project] → Settings → Assets
Filter assets using their External ID.
Confirm that the selected assets are pre-labeled correctly.
Changes made via the SDK are reflected in Ango Hub in near real-time. If updates are not immediately visible, please refresh the page.
Example
Import Bounding Box
Import Brush
Brush masks must use fully transparent black pixels for the background: [0, 0, 0, 0]. Do not use another RGB value with zero alpha, such as [255, 255, 255, 0], for transparent background pixels.
Import Medical Brush
See also
Last updated