Imglabels
A service which allows to create labels on images. All Imglabels endpoints have path prefix /imglabels-service.
Get Items returns a list of items as a list of objects
GET /imglabels-service/items
Parameters
Name | Type | Description |
---|---|---|
authenticateit_identity_ticket | header | Required: Session's ticket |
Example Response
[{
id: 1,
name: 'australian made'
}]
Get Objects returns a list of objects for provided ID, ID is an image file name with extension
GET /imglabels-service/objects/:id
Parameters
Name | Type | Description |
---|---|---|
authenticateit_identity_ticket | header | Required: Session's ticket |
id | string | like 039994a6-9054-47a0-bda1-e4a10c238539.jpg |
Example Response
{
"size": {
"width": 659,
"height": 662,
"depth": 3
},
"objects": [{
"name": "australian made",
"truncated": false,
"difficult": 0,
"bndbox": {
"xmin": 162,
"ymin": 312,
"xmax": 197,
"ymax": 346
}
}, {
"name": "australian made",
"truncated": false,
"difficult": 0,
"bndbox": {
"xmin": 10,
"ymin": 30,
"xmax": 200,
"ymax": 350
}
}
]
}
Post Objects
Create/update image's labels.
POST /imglabels-service/objects/:id
Parameters
Name | Type | Description |
---|---|---|
authenticateit_identity_ticket | header | Required: Session's ticket |
id | string | like 039994a6-9054-47a0-bda1-e4a10c238539.jpg |
Example request body
{
"path": "https://cdn.shping.com/2018/10/9/039994a6-9054-47a0-bda1-e4a10c238539.jpg",
"size": {
"width": 659,
"height": 662,
"depth": 3
},
"objects": [{
"name": "australian made",
"truncated": false,
"difficult": 0,
"bndbox": {
"xmin": 162,
"ymin": 312,
"xmax": 197,
"ymax": 346
}
}, {
"name": "australian made",
"truncated": false,
"difficult": 0,
"bndbox": {
"xmin": 10,
"ymin": 30,
"xmax": 20,
"ymax": 35
}
}
]
}
Example Response
{
"id": "039994a6-9054-47a0-bda1-e4a10c238539.jpg"
}
Get Labels Segment
Returns an archive if images which were updated in provided interval, each image has a same name XML file in the following format.
GET /imglabels-service/:start/:finish
Parameters
Name | Type | Description |
---|---|---|
authenticateit_identity_ticket | header | Required: Session's ticket |
start | string | ISO date: 2018-07-17T00:00:00Z |
finish | string | ISO date: 2018-07-19T23:59:59Z |
Example Response
<annotation>
<filename>039994a6-9054-47a0-bda1-e4a10c238539.jpg</filename>
<path>http://dev-cdn.shping.com/2019/01/01/039994a6-9054-47a0-bda1-e4a10c238539.jpg</path>
<source>
<database>imglabels</database>
</source>
<size>
<width>701</width>
<height>801</height>
<depth>4</depth>
</size>
<segmented>0</segmented>
<object>
<name>australian made</name>
<truncated>false</truncated>
<difficult>2</difficult>
<bndbox>
<xmin>162</xmin>
<ymin>312</ymin>
<xmax>197</xmax>
<ymax>346</ymax>
</bndbox>
</object>
<object>
<name>australian made</name>
<truncated>false</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>10</xmin>
<ymin>30</ymin>
<xmax>20</xmax>
<ymax>35</ymax>
</bndbox>
</object>
</annotation>
Method for image labels service that will return a list of recent image labels by pagination.
GET /imglabels-service/imglabelspage?limit=10&doctype=urn:epc:id:gdti:0000.00000002.455490033609538&key=-1571078756522&include_docs=true
User role should be 'contributors_moderator' or 'contributors_supervisor'
Parameters
Name | Type | Description |
---|---|---|
authenticateit_identity_ticket | header | Required: Session's ticket |
limit | query param | Page size (default 50) |
doctype | query param | Item name in object list |
key | query param | Negative value in milliseconds |
include_docs | query param | Boolean value for include full document in response |
Example Response (include_docs = false)
[
"7f2f42d4-2563-4497-a406-e2b25bdc13cb.jpg",
"86efd4a7-e4ba-461f-bf99-cb8f6aed97e3.jpg"
]
Example Response (include_docs = true)
[
{
"_id": "7f2f42d4-2563-4497-a406-e2b25bdc13cb.jpg",
"_rev": "7-34f501e8b03aa57b3f0a2d8a8f6c5878",
"path": "https://dev-cdn.shping.com/2018/11/19/7f2f42d4-2563-4497-a406-e2b25bdc13cb.jpg",
"size": {
"width": 775,
"height": 519,
"depth": 3
},
"objects": [
{
"difficult": 0,
"truncated": false,
"bndbox": {
"ymin": 96,
"ymax": 331,
"xmin": 472,
"xmax": 754
},
"name": "Australian made",
"title": "Australian made",
"ts": "2019-10-08T04:03:26.259Z",
"creator": "urn:authenticateit:user:email:system@authenticateit.com"
},
{
"difficult": 0,
"truncated": false,
"bndbox": {
"ymin": 304,
"ymax": 408,
"xmin": 88,
"xmax": 202
},
"name": "urn:epc:id:gdti:0000.00000002.455490033609538",
"title": "System RED Certificate",
"ts": "2019-10-08T04:40:33.931Z",
"creator": "urn:authenticateit:user:email:system@authenticateit.com"
},
{
"difficult": 0,
"truncated": false,
"bndbox": {
"ymin": 200,
"xmin": 200,
"xmax": 300,
"ymax": 300
},
"name": "urn:epc:id:gdti:0000.00000002.503535170863805",
"title": "NZ Certificate of origin",
"ts": "2019-10-14T18:45:56.522Z",
"creator": "urn:authenticateit:user:email:system@authenticateit.com"
}
],
"ts": "2019-10-14T18:45:56.522Z"
},
{
"_id": "86efd4a7-e4ba-461f-bf99-cb8f6aed97e3.jpg",
"_rev": "2-d1549a3b952143735218b70371700be1",
"path": "https://dev-cdn.shping.com/2018/7/11/86efd4a7-e4ba-461f-bf99-cb8f6aed97e3.jpg",
"size": {
"width": 780,
"height": 555,
"depth": 3
},
"objects": [
{
"difficult": 0,
"truncated": false,
"bndbox": {
"ymin": 74,
"ymax": 483,
"xmin": 67,
"xmax": 708
},
"name": "urn:epc:id:gdti:0000.00000002.455490033609538",
"title": "System RED Certificate",
"ts": "2019-10-08T04:45:09.177Z",
"creator": "urn:authenticateit:user:email:system@authenticateit.com"
}
],
"ts": "2019-10-08T04:45:09.177Z"
}
]