Image Project
To import annotations to a Image Project, you need to import a JSON file of the annotations.
The explanation will be based on the following example:
The annotations JSON in a Image Project contains four main fields: metadata
, instances
, tags
, and comments
.
{
"metadata": {},
"instances": [],
"tags": [],
"comments": []
}
The fields that are marked in bold in the descriptions are mandatory.
Metadata
{
"lastAction": {
"email": "[email protected]",
"timestamp": 1610622159937
},
"width": 1920,
"height": 1080,
"name": "94573794",
"projectId": 9425,
"qaEmail": [email protected],
"annotatorEmail": [email protected],
"status": "Returned",
"pinned": false
}
Description:
- “lastAction”: The user who last edited the image. Edits include changing the class of an instance, adding or deleting attributes, adding point labels, approving or disapproving instances, and moving or scaling instances.
- “email”: string - The email address of the last user who added or edited an instance.
- “timestamp”: number - The date and time when the last instance edit was made.
- "width": integer - The image’s width.
- "height": integer - The image’s height.
- "name": string - The name of the image.
- "projectId": integer - The project ID.
- "qaEmail": string - The QA’s email address.
- "annotatorEmail": string - The annotator's email address.
- "status": string - The image status. It can be:
NotStarted
,InProgress
,QualityCheck
,Returned
,Skipped
, orCompleted
. - "pinned": boolean - If it’s
true
, then the image is pinned. If it’sfalse
, then the image isn’t pinned.
Mandatory fields
- The object
name
is mandatory.- If the object
lastAction
exists, then thetimestamp
are mandatory.
Comments
[{
"correspondence": [
{
"text": "Fix this",
"email": "[email protected]"
}
],
"x": 987.98,
"y": 722.87,
"resolved": false,
"createdAt": "2021-01-14T07:34:00.695Z",
"createdBy": {
"email": "[email protected]",
"role": "Admin"
},
"creationType": "Manual",
"updatedAt": "2021-01-14T07:34:04.783Z",
"updatedBy": {
"email": "[email protected]",
"role": "Admin"
}
}]
Description:
- "correspondence": array of objects - List of messages in the comment.
- "text": string - The comment.
- "email": string - The email address of the user who wrote the comment.
- “x”: number - X position of the comment on the image.
- “y”: number - Y position of the comment on the image.
- “resolved”: boolean - If it’s
true
, then the comment is resolved. If it’sfalse
or not included in the JSON, then the comment is unresolved by default. - “createdAt”: string - The date and time when the comment was created.
- “createdBy”: objects - Information about the user who created the comment.
- “email”: string - The email of the user who created the comment.
- “role”: string - The role of the user who created the comment.
- “creationType”: string - If it’s
Manual
, then the comment was created manually. If it’sPreannotation
, then the comment was imported with Python SDK. - “updatedAt”: string - The time the comment was updated.
- “updatedBy”: objects - Information about the user who last updated the comment.
- “email”: string - The email address of the user who last updated the comment.
- “role”: string - The role of the user who last updated the comment.
Mandatory fields
- The array
correspondence
and its objects are mandatory.- If the array
comment
exists, it can be either empty or it can contain objects with the following fields:correspondence
,x
, andy
.- If the objects
createdBy
andupdatedBy
exist, thenrole
are mandatory.
Tags
[
"free text tag 1",
"free text tag 2",
"etc",
]
Description:
- Each string is a free text tag value.
Instances
Tag
{
"type": "tag",
"id": "1851938",
"classId": 1851938,
"probability": 100,
"attributes": [
{
"id": 5575985,
"groupId": 943946,
"name": "2",
"groupName": "single attribute"
},
{
"groupId": 943951,
"name": "text",
"groupName": "text"
},
{
"groupId": 943950,
"name": 12,
"groupName": "numeric"
}
],
"createdAt": "2024-05-31T05:31:39.982Z",
"createdBy": {
"email": "[email protected]",
"role": "Admin"
},
"updatedAt": "2024-05-31T05:31:42.380Z",
"updatedBy": {
"email": "[email protected]",
"role": "Admin"
},
"className": "Tag single"
}
- "type": string - instance type.
- "id": string - the tag's ID.
- "classId": integer - Class ID (A class ID from the “classes.json” belonging to the instance’s corresponding class, or -1 if the instance is not classified).
- "probability": integer - If the instance was created manually, then the probability value is 100.
- "attributes": array of attributes.
- "id": integer - the attribute's ID.
- "groupId": integer - the attribute group's ID.
- "name": string - the attribute's name.
- "groupName": string - the attribute group's name.
- "createdAt": string - when the tag was created.
- "createdBy": object - the user who created the tag.
- "email": string - the user's email.
- "role": string - the user's role.
- "updatedAt": string - when the tag was updated.
- "updatedBy": object - the user that updated the tag.
- "email": string - the user's email.
- "role": string - the user's role.
- "className": string - the tag's name, as given in the project's Setup tab.
The
name
andgroupName
properties are only required if the tag has any attributes.
Polyline and polygon
{
"id": "1f3e90aa-6f5f-4578-9e29-9ea89ddae38f",
"type": "polygon",
"classId": 5005974,
"className":"pentagon",
"probability": 100,
"points": [
322.18,
249.03,
585.14,
261.22,
377.9,
449.31,
243.81,
410.99
],
"groupId": 0,
"pointLabels": {},
"attributes": [
{
"name":"Green",
"groupName":"Color"
}
],
"error": null,
"locked": false
}
Description:
- “id”: string - Unique instance ID.
- “type”: string - Instance type.
- “classId”: integer - Class ID (A class ID from the “classes.json” belonging to the instance’s corresponding class, or -1 if the instance is not classified).
- "className": string - Class name (one of the class names in “classes.json”, or an empty value if the instance is not classified).
- “probability”: integer - If the instance was created manually, then the probability value is 100.
- “points”: array of objects - Points of the polygon. The list of floats is: [x0, y0, x1, y1, ….. xN, yN].
- “groupId”: integer - Group ID of instances.
- “pointLabels”: string - The keys are from “0” to “N-1” where a polygon has N vertices.
- “attributes”: array of objects - List of attributes for this polygon.
- "name": string - Attribute name
- "groupName": string - Group name
- “error”: boolean - If the instance is approved, then it’s
false
. If it’s disapproved, then it’strue
. If you approve or disapprove an instance then undo the action, then it’snull
. If the instance is neither approved nor disapproved, thenerror
won’t appear in JSON. - “locked”: boolean - If it’s
true
, you won't be able to move the instance. If it’sfalse
, you'll be able to move the instance.
Bounding box and rotated bounding box
{
"id": "1f3e90aa-6f5f-4578-9e29-9ea89ddae38f",
"type": "bbox",
"classId": 5005974,
"className": "Square",
"probability": 100,
"points": {
"x1": 104.73,
"x2": 549.82,
"y1": 137.45,
"y2": 377.45
},
"groupId": 0,
"pointLabels": {},
"attributes": [
{
"name":"Purple",
"groupName":"Color"
}
],
"error": null,
"locked": false
}
Description:
- “id": string - Unique instance ID.
- “type”: string - Instance type.
- “classId”: integer - Class ID (A class ID from the “classes.json” belonging to the instance’s corresponding class, or -1 if the instance is not classified).
- "className": string - Class name (one of the class names in “classes.json”, or an empty value if the instance is not classified).
- “probability”: integer - If the instance was created manually, then the probability value is 100.
- “points”: objects - Points of the bounding box. The list of floats is: "x1, y1" for the left upper corner, and "x2, y2" for the right lower corner.
- “groupId”: integer - Group ID of instances.
- “pointLabels”: objects - The keys are from “0” to “7” for the 8 vertices of the bounding box.
- “attributes”: array of objects - List of attributes for this bounding box.
- "name": string - Attribute name
- "groupName": string - Group name
- “error”: boolean - If the instance is approved, then it’s
false
. If it’s disapproved, then it’strue
. If you approve or disapprove an instance then undo the action, then it’s null. If the instance is neither approved nor disapproved, thenerror
won’t appear in JSON. - “locked”: boolean - If it’s
true
, you won't be able to move the instance. If it’sfalse
, you'll be able to move the instance.
Point
{
"id": "1f3e90aa-6f5f-4578-9e29-9ea89ddae38f",
"type": "point",
"classId": 5005974,
"className": "Point",
"probability": 100,
"x": 1769.45,
"y": 425.45,
"groupId": 0,
"pointLabels": {},
"attributes": [
{
"name": "Blue",
"groupName": "Color"
}
],
"error": null,
"locked": false
}
Description:
- “id”: string - Unique instance ID.
- “type”: string - Instance type.
- “classId”: integer - Class ID (A class ID from the “classes.json” belonging to the instance’s corresponding class, or -1 if the instance is not classified).
- "className": string - Class name (one of the class names in “classes.json”, or an empty value if the instance is not classified).
- “probability”: integer - If the instance was created manually, then the probability value is 100.
- “x”: integer - x-coordinate
- “y”: integer - y-coordinate
- “groupId”: integer - Group ID of instances.
- “pointLabels”: objects - The key is "0".
- “attributes”: array of objects - List of attributes for this polygon.
- "name": string - Attribute name
- "groupName": string - Group name
- “error”: boolean - If the instance is approved, then it’s
false
. If it’s disapproved, then it’strue
. If you approve or disapprove an instance then undo the action, then it’snull
. If the instance is neither approved nor disapproved, thenerror
won’t appear in JSON. - “locked”: boolean - If it’s
true
, you won't be able to move the instance. If it’sfalse
, you'll be able to move the instance.
Ellipse
{
"id": "1f3e90aa-6f5f-4578-9e29-9ea89ddae38f",
"type": "ellipse",
"classId": 5005974,
"className": "Ellipse",
"probability": 100,
"cx": 377.46,
"cy": 806.18,
"rx": 316.36,
"ry": 134.18,
"angle": 0,
"groupId": 0,
"pointLabels": {},
"attributes": [
{
"name": "Red",
"groupName": "Color"
}
],
"error": null,
"locked": false
}
Description:
- “id”: string - Unique instance ID.
- “type”: string - Instance type.
- “classId”: integer - Class ID (A class ID from the “classes.json” belonging to the instance’s corresponding class, or -1 if the instance is not classified).
- "className": string - Class name (one of the class names in “classes.json”, or an empty value if the instance is not classified).
- “probability”: integer - If the instance was created manually, then the probability value is 100.
- “cx”: number - x-coordinate of the center.
- “cy”: number - y-coordinate of the center.
- “rx”: number - x radius.
- “ry”: number - y radius.
- "angle”: integer - rotation angle.
- “groupId”: integer - Group ID of instances.
- “pointLabels”: objects - The keys are numbers that range from "0" to "8", and the values are texts.
- “attributes”: array of objects - List of attributes for this polygon.
- "name": string - Attribute name
- "groupName": string - Group name
- “error”: boolean - If the instance is approved, then it’s
false
. If it’s disapproved, then it’strue
. If you approve or disapprove an instance then undo the action, then it’snull
. If the instance is neither approved nor disapproved, thenerror
won’t appear in JSON. - “locked”: boolean - If it’s
true
, you won't be able to move the instance. If it’sfalse
, you'll be able to move the instance.
Cuboid
{
"id": "1f3e90aa-6f5f-4578-9e29-9ea89ddae38f",
"type": "cuboid",
"classId": 5005974,
"className":"Cuboid",
"probability": 100,
"points": {
"f1": {
"x": 835.63,
"y": 545.46
},
"f2": {
"x": 1232.72,
"y": 846.55
},
"r1": {
"x": 1082.18,
"y": 735.27
},
"r2": {
"x": 1474.91,
"y": 1042.91
}
},
"groupId": 0,
"pointLabels": {},
"attributes": [
{
"name":"Green",
"groupName":"Color"
}
],
"error": null,
"locked": false
}
Description:
- “id”: string - Unique instance ID.
- “type”: string - Instance type.
- “classId”: integer - Class ID (A class ID from the “classes.json” belonging to the instance’s corresponding class, or -1 if the instance is not classified).
- "className": string - Class name (one of the class names in “classes.json”, or an empty value if the instance is not classified).
- “probability”: integer - If the instance was created manually, then the probability value is 100.
- “points”: objects - “f1” and “f2” are front box points with “x” and “y” coordinates, and “r1” and “r2” are rear box points with “x” and “y” coordinates.
- “groupId”: integer - Group ID of instances.
- “pointLabels”: objects - The keys are numbers that range from "0" to "8", and the values are texts.
- “attributes”: array of objects - List of attributes for this cuboid.
- "name": string - Attribute name
- "groupName": string - Group name
- “error”: boolean - If the instance is approved, then it’s
false
. If it’s disapproved, then it’strue
. If you approve or disapprove an instance then undo the action, then it’snull
. If the instance is neither approved nor disapproved, thenerror
won’t appear in JSON. - “locked”: boolean - If it’s
true
, you won't be able to move the instance. If it’sfalse
, you'll be able to move the instance.
Updated 2 months ago