Ango Hub allows administrators and project managers to import existing annotations. More on label import here.
In order to be imported to the platform, existing labels need to be converted to the Ango Hub Import Format. The following article will provide the format’s specifications, as well as examples of import files.
From the dialog that pops up, click on the Sample JSON toggle.
You will see a sample JSON pre-populated with a basic schema of the import file you need, including schema IDs and structure. You may use this sample as structure for your import JSON.
Read below for more information on how to complete the import file.
The assets must be imported to Ango Hub before the annotations.
It is not currently possible to bulk upload both assets and annotations with a single import file.
The external ID of each asset can be viewed from the Assets tab of your project, under the External ID column.
External IDs do not have to be unique. You can have more than one asset with the same external ID.
It is possible to import annotations referencing assets with only their external IDs, as in many exampled below. In this situation, all assets sharing the same external ID will be pre-labeled.
Schema IDs
The Schema ID is a unique identifier for each labeling tool.
If you don't yet know the schema ID of the labeling tool you will use, instead of:
"schemaId": "my_schema_id"
you may use the tool's name (title) like so:
"title": "Name of My Tool"
This, however, is not recommended since Ango Hub will have to guess which tool you meant. If you have more than one tool with the same name, Ango Hub will pick one randomly.
To obtain each tool's schema ID, navigate to the Label Set section of the Settings. You will find it when expanding the details of each tool.
Create and save your project's label set before attempting to import labels.
Ensure the schema IDs in your import file match the ones in the Label Set section of your project's settings.
Nested classifications have their own, separate Schema IDs. They do not inherit the Schema ID of their parent class.
Object ID
By default, all objects (annotations) created on Ango Hub, either directly from the platform or by importing them, get assigned a random Object ID used to identify them uniquely.
You may, however, choose to assign a custom object ID to annotations you are importing. This is useful (and necessary) in a number of cases:
In video annotations, the object ID allows you to move and track the same annotation between frames.
In single and group relations, the Object ID is necessary to relate annotations to one another.
Assigning an object ID manually means that Ango Hub will not create one for the object in question.
Ango Hub will not check nor warn you if you import multiple, different annotations with the same object ID in the same asset or, in the case of videos, in the same frame.
Using the same object ID on more than one object in the same frame can cause unexpected behavior, and may break functionality such as relations.
Unless this is by design, such as tracking an annotation between video frames, always ensure your object IDs are unique to prevent unexpected behaviors.
To add an object ID to any object you are importing, simply add the following line to your object:
"objectId": "<YOUR_OBJECT_ID>"
For example, a PDF area object with a custom object ID would look like this:
The first value being the X distance in pixels from the left, the second the Y distance in pixels from the top, the third the width of the spline at that point, and the fourth whether or not the point was marked or not.
Segmentation
Segmentations are composed of instances, zones, regions, and holes.
An instance may contain more than one zone. One zone contains exactly one region. A region can contain more than one hole.
Each of the points composing the segmentation is represented as an X/Y coordinate pair. For more information on how X/Y pairs work in the Ango Annotation Format, check out this section. For the way Ango Hub exports segmentation labels, check out this page.
All annotations on DICOM files, regardless of whether the DICOMs are single- or multi-frame, need the page property.
For single-frame DICOM annotations, the page property needs to be equal to 0. For example:
bbox_obj = {"schemaId": schema_id,"page":0,"bounding-box": {"x": x,"y": y,"width": w,"height": h }}
Video Labeling
Video labeling is functionally the same as image labeling, with the only difference being that we add an extra page property to indicate the frame to which the annotation belongs.
Additionally, you may add an "interpolationStopped": true object as shown below to make an annotation disappear from the asset at a specific frame. You may then make it reappear by indicating the same objectId and using "interpolationStopped": false.
"interpolationStopped" field is necessary to stop the linear interpolation of the bounding boxes across the video.
Importing annotations for multi-image assets is functionally the same as importing video annotations, with each "image" being a page. Pages start from 0.