Annotate objects with polygons
-
Create the image job as mentioned in Creating image annotation-task(Job) check the sidebar for a sample input
POST
https://api.playment.io/v0/projects/<project_id>/jobs
Parameters
project_id
: To be passed in the URL
x-api-key
: Secret key to be passed as a header
{
"reference_id": "001",
"data": {
"image_url":"https://dummyimage.com/600x400/000/fff.jpg&text=Dummy+Image+1"
},
"tag": "Sample-task",
"batch_id": "72c888f6-b365-4f27-ad57-d7841da2de0c",
"priority_weight": 5
}
{
"data": {
"job_id": "3f3e8675-ca69-46d7-aa34-96f90fcbb732",
"reference_id": "001",
"tag": "Sample-task"
},
"success": true
}
-
Fetching result as mentioned in Fetching Job Result
GET
https://api.playment.in/v0/projects/<project_id>/jobs/<job_id>
Parameters
project_id
: To be passed in the URL
x-api-key
: Secret key to be passed as a header
{
"data": {
"project_id": "",
"reference_id": "001",
"job_id": "fde54589-ebty-48lp-677a-03a0428ca836",
"batch_id": "b99d241a-bb80-ghyi-po90-c37d4fead593",
"status": "completed",
"tag": "sample_project",
"priority_weight": 5,
"result": "https://playment-data-uploads.s3.ap-south-1.amazonaws.com/sample-result.json"
},
"success": true
}
{
"data": {
"annotations": {
"cuboids": [],
"landmarks": [],
"lines": [],
"polygons": [
{
"_id": "8f8897ad-e07b-4e55-9dbe-61f6b9df85c5",
"attributes": {},
"color": "rgb(136, 47, 136)",
"edges": {
"e1": ["p1", "p2"],
"e10": ["p10","p11"],
"e11": ["p11","p12"],
"e12": ["p12","p1"],
"e2": ["p2","p3"],
"e3": ["p3","p4"],
"e4": ["p4","p5"],
"e5": ["p5","p6"],
"e6": ["p6","p7"],
"e7": ["p7","p8"],
"e8": ["p8","p9"],
"e9": ["p9","p10"]
},
"label": "chute",
"label_id": null,
"points": {
"p1": {"x": 0.286774,"y": 0.892502},
"p10": {"x": 0.356807,"y": 0.896611},
"p11": {"x": 0.345481,
"y": 0.897844
},
"p12": {
"x": 0.286774,
"y": 0.896611
},
"p2": {
"x": 0.285849,
"y": 0.876888
},
"p3": {
"x": 0.286774,
"y": 0.869081
},
"p4": {
"x": 0.288623,
"y": 0.853878
},
"p5": {
"x": 0.345019,
"y": 0.897844
},
"p6": {
"x": 0.395637,
"y": 0.811144
},
"p7": {
"x": 0.436316,
"y": 0.871547
},
"p8": {
"x": 0.45342,
"y": 0.884284
},
"p9": {
"x": 0.453189,
"y": 0.892913
}
},
"state": "editable"
},
{
"_id": "832e7ea8-9c17-4613-a2b6-75b7b3ef4ee7",
"attributes": {},
"color": "rgb(136, 47, 136)",
"edges": {
"e1": [
"p1",
"p2"
],
"e2": [
"p2",
"p3"
],
"e3": [
"p3",
"p4"
],
"e4": [
"p4",
"p5"
],
"e5": [
"p5",
"p6"
],
"e6": [
"p6",
"p7"
],
"e7": [
"p7",
"p8"
],
"e8": [
"p8",
"p9"
],
"e9": [
"p9",
"p1"
]
},
"label": "chute",
"label_id": null,
"points": {
"p1": {
"x": 0.477009,
"y": 0.882302
},
"p2": {
"x": 0.500065,
"y": 0.849462
},
"p3": {
"x": 0.512809,
"y": 0.825531
},
"p4": {
"x": 0.518108,
"y": 0.825022
},
"p5": {
"x": 0.51868,
"y": 0.853789
},
"p6": {
"x": 0.520685,
"y": 0.866264
},
"p7": {
"x": 0.51954,
"y": 0.875938
},
"p8": {
"x": 0.518967,
"y": 0.882302
},
"p9": {
"x": 0.51152,
"y": 0.88332
}
},
"state": "editable"
}
],
"rectangles": []
},
"image_url": "http://dfnq1fss3rnqc.cloudfront.net/play/original/1723e113-e20a-472c-a523-e9dae1142de9"
}
}
Result JSON Structure
Response Key | Description |
---|---|
data | object having annotations object and image_url |
data.annotations | Object having all the types of annotations namely cuboids, landmarks, lines, polygons and rectangles |
data.annotations.polygons | List of all the polygons annotated in this job |
data.annotations.polygons.[i] | one of the Object from polygons list, having _id, label, edges, points and other attributes |
data.annotations.polygons.[i]._id | String id of the annotated polygon |
data.annotations.polygons.[i].label | String class label of the annotated polygon |
data.annotations.polygons.[i].edges | Object having all the edges of the polygon named as e1, e2, e3..... |
data.annotations.polygons.[i].edges.e[j] | List having name of the 2 points of the particular edge |
data.annotations.polygons.[i].points | Object having all the points of the polygon named as p1, p2, p3..... |
data.annotations.polygons.[i].points.p[j] | Object having x and y coordinate of a particular point |
data.annotations.polygons.[i].attributes | Object having all the additional attributes associated with the annotated polygon |
data.image_url | String URL of the image over which polygons were drawn |