The Playment Developer Hub

Welcome to the Playment developer hub.
Here, You'll find comprehensive documentation & examples to help you start working with Playment as quickly as possible, and get support if you get stuck.

Get Started

API Reference

Playment's API helps you setup various data annotation tasks that are solved with Playment's state of the art annotation tools by our highly trained annotators.

 

Playment offers fully managed enterprise-grade solutions to build high quality training data for computer vision and vehicle perception models at scale. You just need to send us the raw data the defined format and we'll take care of everything else.

Contact us at hello@playment.in to get started.

Security & Authentication

Your data is safe with us.

 

The following measures are in place to securing the two way communication with Playment servers

Authentication:

While creating a task authenticate your account by including your secret key in API requests.
The secret x-client-key ensures that only you are able to access your projects.
We expect the API key to be included in all API requests sent to our server.

Callback Authorization:

Playment can also provide to you the final annotation data via API by subscribing to our callback APIs.
If you’d like to authenticate our callbacks, Playment can send a x-playment-key header with each callback. You will need to share the key with us via a secure channel.

Network Security:

To ensure network security, you can whitelist our IP addresses so that you accept callback requests originating only from our servers

Creating a request

Each request represents one unit of data that you would want annotated.
In case of a non-sequential data it would be one image or point cloud data.
In case of sequential data it would be an array of data links corresponding to the annotation task of interest

 

When you send a POST request to our Feedline API to create a request, we create what is called as a FLU or Feed Line Unit

Create Feed Line Unit

POST https://api.playment.in/v1/project/ project_id/feedline

Path Parameters

project_id : This is a unique ID for a given annotation requirement and sensor setup.

Header Parameters

x-client-key : Secret key used for authentication to be passed as a header

* Playment will share the project_id and x-client-key separately with you via a secure channel.

Contact us at hello@playment.in to get started.

Payload

{  
   "reference_id":"001",
   "data":{  
      "depends on the type of task"
   },
   "tag":"categorise_image",
}

Check out the examples below to see different types of request structures.

Request Key
Request Value

reference_id

reference_id is a unique identifier for a request. We'll fail a request if you've sent another request with the same reference_id previously. This helps us ensure that we don't charge you for work which we've already done for you.

tag

Each request should have a tag which tells us what operation needs to be performed on that request. We'll share this tag with you during the integration process.

data

This has the complete data that is to be annotated as per the examples below

QPS

Playment's feedline POST API currently supports up to 20 requests per second.

Error Codes

Error

FS_0001

Duplicate Reference Id

FS_0002

Reference Id Missing

FS_0003

Invalid Data Passed

FS_0004

Data missing

FS_0005

Tag Missing

FS_0006

Feed Line Unit not found

FS_0007

Image urls not valid

GE_0001

Malformed JSON/Invalid UUID passed

GE_0002

Parameter missing

Error codes

The following describe the possible issues with the request data when sending a POST request to Playment's feedline API

 
Error Code
Reason

FS_0001

Duplicate reference_id. Note: For each unique FLU/sequence you must use a unique reference_id

FS_0002

reference_id missing

FS_0003

  • Data URL invalid
  • Duplicate frame_id detected in case of sequential data.
  • Invalid string for frame_id detected in case of sequential data.

FS_0004

Data missing

FS_0005

tag missing

FS_0006

Feed Line Unit not found

FS_0007

Image URLs not valid

GE_0001

Malformed JSON/Invalid UUID passed

GE_0002

Parameter missing

Bounding Boxes

 

Bounding boxes for object detection and localization in images

Detect Facial attributes

Detect Facial attributes

Note:

Note for existing customers: This will be Playment's new data structure. The old data structure will be deprecated and non-functional from September 1st, 2018.

{  
   "reference_id":"001",
   "data":{
     "image_url":"https://dummyimage.com/600x400/000/fff.jpg&text=Dummy+Image+1"
   },
   "tag":"draw_bounding_boxes"
}
curl -X POST \
  https://api.playment.in/v1/project/:projectId/feedline \
  -H 'Content-Type: application/json' \
  -H 'cache-control: no-cache' \
  -H 'x-client-key: <your x-client-key here>' \
  -d '{  
   "reference_id":"001",
   "data":{
     "image_url":"https://dummyimage.com/600x400/000/fff.jpg&text=Dummy+Image+1"
   },
   "tag":"draw_bounding_boxes"
}'
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io/ioutil"
)

func main() {

  url := "https://api.playment.in/v1/project/:projectId/feedline"

	payload := strings.NewReader("{  \n   \"reference_id\":\"001\",\n   \"data\":{\n     \"image_url\":\"https://dummyimage.com/600x400/000/fff.jpg&text=Dummy+Image+1\"\n   },\n   \"tag\":\"draw_bounding_boxes\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("x-client-key", "<your x-client-key here>")
	req.Header.Add("Content-Type", "application/json")
	req.Header.Add("cache-control", "no-cache")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
import http.client

conn = http.client.HTTPConnection("api,playment,in")

payload = "{  \n   \"reference_id\":\"001\",\n   \"data\":{\n     \"image_url\":\"https://dummyimage.com/600x400/000/fff.jpg&text=Dummy+Image+1\"\n   },\n   \"tag\":\"draw_bounding_boxes\"\n}"

headers = {
    'x-client-key': "<your x-client-key here>",
    'Content-Type': "application/json",
    'cache-control': "no-cache"
    }

conn.request("POST", "v1,project,:projectId,feedline", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
var request = require("request");

var options = { method: 'POST',
  url: 'https://api.playment.in/v1/project/:projectId/feedline',
  headers: 
   { 'cache-control': 'no-cache',
     'Content-Type': 'application/json',
     'x-client-key': '<your x-client-key here>' },
  body: 
   { reference_id: '001',
     data: { image_url: 'https://dummyimage.com/600x400/000/fff.jpg&text=Dummy+Image+1' },
     tag: 'draw_bounding_boxes' },
  json: true };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
{
    "feed_line_units": [{
   	 "reference_id": "001",
   	 "flu_id": "33abc3fe-9fbc-4d7c-b951-a1d1bfb6f840",
   	 "status": "COMPLETED",
   	 "tag": "draw_bounding_boxes",
   	 "result": [
       {
         "label": "television",
         "coordinates": [
           {"x": 0.38, "y": 0.19}, 
           {"x": 0.57, "y": 0.19}, 
           {"x": 0.57, "y": 0.44}, 
           {"x": 0.38, "y": 0.44}]
       },
       {
         "label": "plant",
         "coordinates": [
           {"x": 0.38, "y": 0.19}, 
           {"x": 0.57, "y": 0.19}, 
           {"x": 0.57, "y": 0.44}, 
           {"x": 0.38, "y": 0.44}]
       }
       ...
     ]
    ]
}

LiDAR Annotation

 

An endpoint to annotate cuboids in LiDAR data and track them across frames

Two cycles on top on the car

Two cycles on top on the car

The coordinate system for the point cloud are described below:

  • positive x-axis : Red(in direction of the ego-car motion)
  • positive y-axis : Green(towards the left side of the ego-car)
  • positive z-axis : Blue(vertically upwards, follows the right-hand rule)

Notes:

  • R|T matrices (in the calibration key) should be with respect to the origin of the point cloud data(i..e LiDAR)
  • Calibration and IMU are optional fields.
  • Reference: Calibration

Requirement:

Camera matrix

Camera matrix

Rotation Matrix

Rotation Matrix

Camera Matrix = [[fx, 0, cx],
[0, fy, cy],
[0, 0, 1]]
Rotation Matrix = [[r11,r12,r13,0],
[r21,r22,r23,0],
[r31,r32,r33,0],
[0, 0, 0, 1]]
Translation Matrix = [[1,0,0,tx],
[0,0,0,ty],
[0,0,0,tz],
[0,0,0,1]]
Distortion Coefficients - [k1,k2,p1,p2, k3]; if not mentioned, assumed to be zeros.

  • Definitions:
    • (fx, fy) - focal lengths expressed in pixel units.
    • (cx, cy) - principal point that is usually at the image center.
    • 'rij's - rotation components between LiDAR and camera in LiDAR frame of reference.
    • (tx, ty, tz)-translation between LiDAR and camera in LiDAR frame of reference.
    • 'k' - radial distortion coefficients.
    • 'p' - tangential distortion coefficients.
{  
   "reference_id":"001",
   "data":{
     "sensor_data": {
        "frames": [
			{
         		"cameras": [
		           {
		             "camera_id": "0",
		             "image_url": "https://s3.amazonaws.com/bucket/____.JPG"
		           }
         		],
         		"frame_id": "000000001",
         		"point_cloud": "https://s3.amazonaws.com/bucket/____.PCD"
       		},
            {
         		"cameras": [
		           {
		             "camera_id": "0",
		             "image_url": "https://s3.amazonaws.com/bucket/____.JPG"
		           }
         		],
         		"frame_id": "000000002",
         		"point_cloud": "https://s3.amazonaws.com/bucket/____.PCD"
       		}, 
            {}
     ],    
        "calibration": {
       		"cameras": [
	         {
	           "id": 0,
	           "rotation_matrix": [
	             [r11, r12, r12, 0],
	             [r21, r22, r23, 0],
	             [r31, r32, r33, 0],
	             [0,   0,   0,   1]
	           ],
	           "camera_origin_3D": [x0,y0,z0],  //camera-origin in 3D world
	           "projection_matrix": [
	             [fx, 0,  cx,  0],
	             [0,  fy, cy,  0],
	             [0,  0,  1,   0]
	           ],
	           "translation_matrix": [
	             [1,  0,  0, -tx],
	             [0,  1,  0, -ty],
	             [0,  0,  1, -tz],
	             [0,  0,  0,  1 ]
	           ]
	         }
       		],
       		"point_cloud": [
		         {
		           "type": "pcd",
		           "format": [
		             {
		               "key": "x",
		               "datatype": "float32"
		             },
		             {
		               "key": "y",
		               "datatype": "float32"
		             },
		             {
		               "key": "z",
		               "datatype": "float32"
		             },
		             {
		               "key": "intensity",
		               "datatype": "float32"
		             }
		           ],
		           "hardware": "Velodyne32"
		         }
       		]
     	}
     }
   },
   "tag":"lidar_track_cuboids"
}
curl -X POST \
  https://api.playment.in/v1/project/:projectId/feedline \
  -H 'Content-Type: application/json' \
  -H 'cache-control: no-cache' \
  -H 'x-client-key: <your x-client-key here>' \
  -d '{  
   "reference_id":"001",
   "data":{
     "frames": [
       {
         "imu": {
           "delX": 0,
           "delY": 0,
           "delZ": 0,
           "del_rotX": 0,  //value in radians 
           "del_rotY": 0,
           "del_rotZ": 0
         },
         "cameras": [
           {
             "camera_id": "0",
             "image_url": "https://s3.amazonaws.com/bucket/____.JPG"
           }
         ],
         "frame_id": 0,
         "point_cloud": "https://s3.amazonaws.com/bucket/____.PCD"
       },
       {}, 
       {}
     ],    
     "calibration": {
       "cameras": [
         {
           "id": 0,
           "rotation_matrix": [
             [r11, r12, r12, 0],
             [r21, r22, r23, 0],
             [r31, r32, r33, 0],
             [0,   0,   0,   1]
           ],
           "camera_origin_3D": [x0,y0,z0],  //camera-origin in 3D world
           "projection_matrix": [
             [fx, 0,  cx,  0],
             [0,  fy, cy,  0],
             [0,  0,  1,   0]
           ],
           "translation_matrix": [
             [1,  0,  0, -tx],
             [0,  1,  0, -ty],
             [0,  0,  1, -tz],
             [0,  0,  0,  1 ]
           ]
         }
       ],
       "point_cloud": [
         {
           "type": "pcd",
           "format": [
             {
               "key": "x",
               "datatype": "float32"
             },
             {
               "key": "y",
               "datatype": "float32"
             },
             {
               "key": "z",
               "datatype": "float32"
             },
             {
               "key": "intensity",
               "datatype": "float32"
             }
           ],
           "hardware": "lidar"
         }
       ]
     }
   },
   "tag":"lidar_track_cuboids"
}'
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://api.playment.in/v1/project/:projectId/feedline"

	payload := strings.NewReader("{  \n   \"reference_id\":\"001\",\n   \"data\":{\n     \"frames\": [\n       {\n         \"imu\": {\n           \"delX\": 0,\n           \"delY\": 0,\n           \"delZ\": 0,\n           \"del_rotX\": 0,  //value in radians \n           \"del_rotY\": 0,\n           \"del_rotZ\": 0\n         },\n         \"cameras\": [\n           {\n             \"camera_id\": \"0\",\n             \"image_url\": \"https://s3.amazonaws.com/bucket/____.JPG\"\n           }\n         ],\n         \"frame_id\": 0,\n         \"point_cloud\": \"https://s3.amazonaws.com/bucket/____.PCD\"\n       },\n       {}, \n       {}\n     ],    \n     \"calibration\": {\n       \"cameras\": [\n         {\n           \"id\": 0,\n           \"rotation_matrix\": [\n             [r11, r12, r12, 0],\n             [r21, r22, r23, 0],\n             [r31, r32, r33, 0],\n             [0,   0,   0,   1]\n           ],\n           \"camera_origin_3D\": [x0,y0,z0],  //camera-origin in 3D world\n           \"projection_matrix\": [\n             [fx, 0,  cx,  0],\n             [0,  fy, cy,  0],\n             [0,  0,  1,   0]\n           ],\n           \"translation_matrix\": [\n             [1,  0,  0, -tx],\n             [0,  1,  0, -ty],\n             [0,  0,  1, -tz],\n             [0,  0,  0,  1 ]\n           ]\n         }\n       ],\n       \"point_cloud\": [\n         {\n           \"type\": \"pcd\",\n           \"format\": [\n             {\n               \"key\": \"x\",\n               \"datatype\": \"float32\"\n             },\n             {\n               \"key\": \"y\",\n               \"datatype\": \"float32\"\n             },\n             {\n               \"key\": \"z\",\n               \"datatype\": \"float32\"\n             },\n             {\n               \"key\": \"intensity\",\n               \"datatype\": \"float32\"\n             }\n           ],\n           \"hardware\": \"lidar\"\n         }\n       ]\n     }\n   },\n   \"tag\":\"lidar_track_cuboids\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("x-client-key", "<your x-client-key here>")
	req.Header.Add("Content-Type", "application/json")
	req.Header.Add("cache-control", "no-cache")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
import http.client

conn = http.client.HTTPConnection("api,playment,in")

payload = "{  \n   \"reference_id\":\"001\",\n   \"data\":{\n     \"frames\": [\n       {\n         \"imu\": {\n           \"delX\": 0,\n           \"delY\": 0,\n           \"delZ\": 0,\n           \"del_rotX\": 0,  //value in radians \n           \"del_rotY\": 0,\n           \"del_rotZ\": 0\n         },\n         \"cameras\": [\n           {\n             \"camera_id\": \"0\",\n             \"image_url\": \"https://s3.amazonaws.com/bucket/____.JPG\"\n           }\n         ],\n         \"frame_id\": 0,\n         \"point_cloud\": \"https://s3.amazonaws.com/bucket/____.PCD\"\n       },\n       {}, \n       {}\n     ],    \n     \"calibration\": {\n       \"cameras\": [\n         {\n           \"id\": 0,\n           \"rotation_matrix\": [\n             [r11, r12, r12, 0],\n             [r21, r22, r23, 0],\n             [r31, r32, r33, 0],\n             [0,   0,   0,   1]\n           ],\n           \"camera_origin_3D\": [x0,y0,z0],  //camera-origin in 3D world\n           \"projection_matrix\": [\n             [fx, 0,  cx,  0],\n             [0,  fy, cy,  0],\n             [0,  0,  1,   0]\n           ],\n           \"translation_matrix\": [\n             [1,  0,  0, -tx],\n             [0,  1,  0, -ty],\n             [0,  0,  1, -tz],\n             [0,  0,  0,  1 ]\n           ]\n         }\n       ],\n       \"point_cloud\": [\n         {\n           \"type\": \"pcd\",\n           \"format\": [\n             {\n               \"key\": \"x\",\n               \"datatype\": \"float32\"\n             },\n             {\n               \"key\": \"y\",\n               \"datatype\": \"float32\"\n             },\n             {\n               \"key\": \"z\",\n               \"datatype\": \"float32\"\n             },\n             {\n               \"key\": \"intensity\",\n               \"datatype\": \"float32\"\n             }\n           ],\n           \"hardware\": \"lidar\"\n         }\n       ]\n     }\n   },\n   \"tag\":\"lidar_track_cuboids\"\n}"

headers = {
    'x-client-key': "<your x-client-key here>",
    'Content-Type': "application/json",
    'cache-control': "no-cache",
    }

conn.request("POST", "v1,project,:projectId,feedline", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
var request = require("request");

var options = { method: 'POST',
  url: 'https://api.playment.in/v1/project/:projectId/feedline',
  headers: 
   { 'cache-control': 'no-cache',
     'Content-Type': 'application/json',
     'x-client-key': '<your x-client-key here>' },
  body: '{  \n   "reference_id":"001",\n   "data":{\n     "frames": [\n       {\n         "imu": {\n           "delX": 0,\n           "delY": 0,\n           "delZ": 0,\n           "del_rotX": 0,  //value in radians \n           "del_rotY": 0,\n           "del_rotZ": 0\n         },\n         "cameras": [\n           {\n             "camera_id": "0",\n             "image_url": "https://s3.amazonaws.com/bucket/____.JPG"\n           }\n         ],\n         "frame_id": 0,\n         "point_cloud": "https://s3.amazonaws.com/bucket/____.PCD"\n       },\n       {}, \n       {}\n     ],    \n     "calibration": {\n       "cameras": [\n         {\n           "id": 0,\n           "rotation_matrix": [\n             [r11, r12, r12, 0],\n             [r21, r22, r23, 0],\n             [r31, r32, r33, 0],\n             [0,   0,   0,   1]\n           ],\n           "camera_origin_3D": [x0,y0,z0],  //camera-origin in 3D world\n           "projection_matrix": [\n             [fx, 0,  cx,  0],\n             [0,  fy, cy,  0],\n             [0,  0,  1,   0]\n           ],\n           "translation_matrix": [\n             [1,  0,  0, -tx],\n             [0,  1,  0, -ty],\n             [0,  0,  1, -tz],\n             [0,  0,  0,  1 ]\n           ]\n         }\n       ],\n       "point_cloud": [\n         {\n           "type": "pcd",\n           "format": [\n             {\n               "key": "x",\n               "datatype": "float32"\n             },\n             {\n               "key": "y",\n               "datatype": "float32"\n             },\n             {\n               "key": "z",\n               "datatype": "float32"\n             },\n             {\n               "key": "intensity",\n               "datatype": "float32"\n             }\n           ],\n           "hardware": "lidar"\n         }\n       ]\n     }\n   },\n   "tag":"lidar_track_cuboids"\n}' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
{
  "feed_line_units": [
    {
      "reference_id": "001",
      "flu_id": "3bcbc3fe-9fbc-4d7c-b951-a1d1bfb6f840",
      "status": "COMPLETED",
      "tag": "lidar_track_cuboids",
      "result": {
        "annotations": [
          {
            "tracking_id": "85164320-42cb-47b7-9f3d-de004d6a5aba",
            "type": "cuboid3d",
            "label": "Obstruction",
            "frames": {
              "000000001": {
                "center": {
                  "x": 34.915330335708234,
                  "y": -2.1073208887785713,
                  "z": -1.2032084902657283
                },
                "rotation": {
                  "x": 0,
                  "y": 0,
                  "z": 1
                },
                "dimensions": {
                  "width": 0.2260065451,
                  "height": 0.7935830195,
                  "length": 0.2046092338
                },
                "attributes": {
                  "Object State": {
                    "value": "Moving"
                  },
                  "Occlusion State": {
                    "value": "Not Occluded"
                  }
                }
              },
              "000000002": {
                "center": {
                  "x": 34.915330335708234,
                  "y": -2.1073208887785713,
                  "z": -1.2032084902657283
                },
                "rotation": {
                  "x": 0,
                  "y": 0,
                  "z": 1.1
                },
                "dimensions": {
                  "width": 0.2260065451,
                  "height": 0.7935830195,
                  "length": 0.2046092338
                },
                "attributes": {
                  "Object State": {
                    "value": "Moving"
                  },
                  "Occlusion State": {
                    "value": "Not Occluded"
                  }
                }
              },
              "000000003": {
                "center": {
                  "x": 34.915330335708234,
                  "y": -2.1073208887785713,
                  "z": -1.2032084902657283
                },
                "rotation": {
                  "x": 0,
                  "y": 0,
                  "z": 1.2
                },
                "dimensions": {
                  "width": 0.2260065451,
                  "height": 0.7935830195,
                  "length": 0.2046092338
                },
                "attributes": {
                  "Object State": {
                    "value": "Moving"
                  },
                  "Occlusion State": {
                    "value": "Not Occluded"
                  }
                }
              }
            }
          }
        ]
      }
    }
  ]
}

Video Annotation

 

API Request Body

Key
Description

reference_id

The unique identifier for each FLU.
The final response will also be provided WRT the corresponding reference_id.

tag

This defines the process to be followed to complete the annotation process.
This is a value that will be provided by Playment.

data.video_data.frames

This contains a list of frames each for a particular timestamp in the order of annotation.

data.video_data.frames.frame_id

This is a unique string identifier for each frame in the sequence.
NOTE: You cannot send multiple frames with the same ID.

Annotation Response

Key
Description

reference_id

The unique identifier with which the FLU was created. If you have integrated with Playment's Feedline API you will receive the response corresponding to the same reference_id

flu_id

A Playment level UUID identifier for each FLU

status

PENDING: The data is currently being processed
COMPLETED: All the data has been processed and is ready for consumption for training your models.

tag

The string that denotes the process in which the annotation took place. This will be shared by Playment during the integration process.

result

The list of trackers/annotations in the corresponding FLU.

TrackerData

This is an object that defines the complete data across frames for a given object grouped by tracking id each object will have a key called frames which is a dictionary with key as the frame_id and the value as the annotation details.

Object Tracking with Bounding Boxes

Playment can help you annotate 2D bounding boxes on the image while maintaining the tracking id for objects across frames.

Bounding Box

Key
Description

_id

The unique tracking ID for an instance of an object across the sequential data.

label

The label for the unique annotation instance.

type

This defines the type of annotation rectangles

frames

A dictionary with the frame id key and annotation details as the value

frames.<frame_id>.coordinates

The coordinates of the 2D bounding box in the order from left top in the clockwise direction.

frames.<frame_id>._id

The unique ID for a frame instance of a tracker ie. an annotation

frames.<frame_id>.attributes

Frame level attribute dictionary for the given annotation

Object tracking with Cuboids

Cuboids

_id

The unique tracking ID for an instance of an object across the sequential data.

label

The label for the unique annotation instance.

type

This defines the type of annotation rectangles

frames

A dictionary with the frame id key and annotation details as the value

frames.<frame_id>._id

The unique ID for a frame instance of a tracker ie. an annotation

frames.<frame_id>.points

The normalized coordinates dictionary of the points that correspond to the annotated cuboid.

frames.<frame_id>.front

The list of points that correspond to the front face of the cuboid

frames.<frame_id>.side

The list of points that correspond to the side face of the cuboid.

frames.<frame_id>.back

The list of points that correspond to the ba face of the cuboid.

frames.<frame_id>.attributes

Frame level attribute dictionary for the given annotation.

Object Tracking with Lines

Key
Description

_id

The unique tracking ID for an instance of an object across the sequential data.

label

The label for the unique annotation instance.

type

This defines the type of annotation rectangles

frames

A dictionary with the frame id key and annotation details as the value

frames.<frame_id>.points

The normalized coordinates dictionary of the points that correspond to the annotated line. The order of points is p1→p2→p3... so on.

frames.<frame_id>._id

The unique ID for a frame instance of a tracker ie. an annotation

frames.<frame_id>.attributes

Frame level attribute dictionary for the given annotation

{
  "feed_line_units": [
    {
      "reference_id": "001",
      "_id": "cf8ba34a-78ab-402b-b386-daa607cda443"
      "flu_id": "sample_reference_id",
      "status": "COMPLETED",
      "tag": "line_tracking",
      "result": [
        {
          "type": "line",
          "label": "Lane",
          "frames": {
            "frame001": {
              "_id": "555397a8-d916-443d-a973-e04300bb3d59",
              "points": {
                "p1": {"x": 0.5976247,"y": 0.776666},
                "p2": {"x": 0.5040257,"y": 0.5233333}
              },
              "attributes": {
                "Occlusion": {"value": "10%"}
              }
            },
            "frame002": {
              "_id": "057cf1f5-6c15-4f29-9775-940cf27643f4",
              "points": {
                "p1": {"x": 0.5976247,"y": 0.77333333},
                "p2": {"x": 0.5040257,"y": 0.5233333}
              },
              "attributes": {
                "Occlusion": {"value": "50%"}
              }
            },
            "frame003": {
							"_id": "057cf1f5-6c15-4f29-9775-940cf27643f4",
              "points": {
                "p1": {"x": 0.5976247,"y": 0.7766666},
                "p2": {"x": 0.5040257,"y": 0.5233333}
              },
              "attributes": {
                "Occlusion": {"value": "10%"}
              }
            }
          }
        }
      ]
    }
  ]
}

Object Tracking with Landmarks

Key
Description

_id

The unique tracking ID for an instance of an object across the sequential data.

label

The label for the unique annotation instance.

type

This defines the type of annotation rectangles

frames

A dictionary with the frame id key and annotation details as the value

frames.<frame_id>.points

The normalized coordinates dictionary of the points that correspond to the annotated line. Each point also has a label associated with it which defines the order of the points.

frames.<frame_id>._id

The unique ID for a frame instance of a tracker ie. an annotation

frames.<frame_id>.attributes

Frame level attribute dictionary for the given annotation

{
	"feed_line_units": [{
		"reference_id": "002",
		"flu_id": "3bcbc3fe-9fbc-4d7c-b951-a1d1bfb6f840",
		"status": "COMPLETED",
		"tag": "draw_landmarks",
		"result": [
        {
          "type": "landmarks",
          "label": "Left Eye",
          "frames": {
            "frame001": {
              "points": {
				        "p1": { "x": 0.17, "y": 0.58, "label": 7 },
				        "p2": { "x": 0.26, "y": 0.63, "label": 8 },
				        "p3": { "x": 0.27, "y": 0.63, "label": 9 },
				        "p4": { "x": 0.29, "y": 0.59, "label": 10 },
				        "p5": { "x": 0.25, "y": 0.46, "label": 11 }	
              "attributes": {
                "Occlusion": {"value": "10%"}
              }
            },
            "frame002": {
              "points": {
								"p1": { "x": 0.18, "y": 0.59, "label": 7 },
				        "p2": { "x": 0.26, "y": 0.63, "label": 8 },
				        "p3": { "x": 0.28, "y": 0.62, "label": 9 },
				        "p4": { "x": 0.29, "y": 0.59, "label": 10 },
				        "p5": { "x": 0.25, "y": 0.46, "label": 11 }	
              },
              "attributes": {
                "Occlusion": {"value": "50%"}
              }
            },
            "frame003": {
              "points": {
                "p1": { "x": 0.19, "y": 0.62, "label": 7 },
				        "p2": { "x": 0.28, "y": 0.63, "label": 8 },
				        "p3": { "x": 0.30, "y": 0.61, "label": 9 },
				        "p4": { "x": 0.24, "y": 0.55, "label": 10 },
				        "p5": { "x": 0.22, "y": 0.43, "label": 11 }	
              },
              "attributes": {
                "Occlusion": {"value": "10%"}
              }
            }
          }
        }
      ]
	}]
}

Object Tracking with Polygons

Key
Description

_id

The unique tracking ID for an instance of an object across the sequential data.

label

The label for the unique annotation instance.

frames.<frame_id>.points

The normalized coordinates dictionary of the points that correspond to the annotated line.

frames.<frame_id>.edges

This gives a list of pairs of points which correspond to the order in which the points are joined to make the final polygon.

type

This defines the type of annotation rectangles

frames

A dictionary with the frame id key and annotation details as the value

frames.<frame_id>._id

The unique ID for a frame instance of a tracker ie. an annotation

frames.<frame_id>.attributes

Frame level attribute dictionary for the given annotation

{
	"feed_line_units": [{
		"reference_id": "001",
		"flu_id": "3bcbc3fe-9fbc-4d7c-b951-a1d1bfb6f840",
		"status": "COMPLETED",
		"tag": "draw_polygons",
		"result": [
			{
			  "_id": "563bc3fe-9fbc-4d7c-b951-a13bcbc3fe",
			  "type":"polygons",
			  "label": "Cyclist",
			  "frames":{
			    "frame_1": {
			      "_id": "563bc3fe-9fbc-4d7c-b951-a13bcbc3fe",
			      "points": {
					    "p1": {"x": 0.17,"y": 0.58},
					    "p2": {"x": 0.26,"y": 0.63},
					    "p3": {"x": 0.27,"y": 0.63},
					    "p4": {"x": 0.29,"y": 0.59},
					    "p5": {"x": 0.25,"y": 0.46},
					    "p6": {"x": 0.22,"y": 0.42}
				    },
				    "edges": {
					    "e1": ["p1","p2"],
					    "e2": ["p2","p3"],
					    "e3": ["p3","p4"],
					    "e4": ["p4","p5"],
					    "e5": ["p5","p6"],
					    "e6": ["p6","p7"],
					    "e7": ["p8","p9"]
				    },
				    "attributes":{
				      "Occlusion":{
				        "value": "50%"
				      }
				    }
			    },
			    "frame_2": {
			      "_id": "3bcbc3fe-9fbc-4d7c-b951-a1d1bfb6f840",
			      "points": {
					    "p1": {"x": 0.18,"y": 0.45},
					    "p2": {"x": 0.24,"y": 0.58},
					    "p3": {"x": 0.23,"y": 0.60},
					    "p4": {"x": 0.26,"y": 0.55},
					    "p5": {"x": 0.21,"y": 0.43},
					    "p6": {"x": 0.22,"y": 0.42}
				    },
				    "edges": {
					    "e1": ["p1","p2"],
					    "e2": ["p2","p3"],
					    "e3": ["p3","p4"],
					    "e4": ["p4","p5"],
					    "e5": ["p5","p6"],
					    "e6": ["p6","p7"],
					    "e7": ["p8","p9"]
				    },
				    "attributes":{
				      "Occlusion":{
				        "value": "60%"
				      }
				    }
			    }
			  }
		  }
		]
  }]
}
{
  "reference_id": "sample_reference_id",
  "data": {
    "video_data": {
      "frames": [
        {
          "frame_id": "frame001",
          "src": "https://dummyimage.com/600x400/000/fff.jpg&text=Dummy+Image+1"
        },
        {
          "frame_id": "frame002",
          "src": "https://dummyimage.com/600x400/000/fff.jpg&text=Dummy+Image+2"
        },
        {
          "frame_id": "frame003",
          "src": "https://dummyimage.com/600x400/000/fff.jpg&text=Dummy+Image+3"
        },
        {
          "frame_id": "frame004",
          "src": "https://dummyimage.com/600x400/000/fff.jpg&text=Dummy+Image+4"
        },
        {
          "frame_id": "frame005",
          "src": "https://dummyimage.com/600x400/000/fff.jpg&text=Dummy+Image+5"
        }
      ],
    }
  },
  "tag": "object_tracking"
}
curl -X POST \
  https://api.playment.in/v1/project/:projectId/feedline \
  -H 'Content-Type: application/json' \
  -H 'cache-control: no-cache' \
  -H 'x-client-key: <your x-client-key here>' \
  -d '{
  "reference_id": "sample_reference_id",
  "data": {
    "frames": [
      {
        "frame_id": "frame001",
        "src": "https://dummyimage.com/600x400/000/fff.jpg&text=Dummy+Image+1"
      },
      {
        "frame_id": "frame002",
        "src": "https://dummyimage.com/600x400/000/fff.jpg&text=Dummy+Image+2"
      },
      {
        "frame_id": "frame003",
        "src": "https://dummyimage.com/600x400/000/fff.jpg&text=Dummy+Image+3"
      },
      {
        "frame_id": "frame004",
        "src": "https://dummyimage.com/600x400/000/fff.jpg&text=Dummy+Image+4"
      },
      {
        "frame_id": "frame005",
        "src": "https://dummyimage.com/600x400/000/fff.jpg&text=Dummy+Image+5"
      }
    ],
    
  },
  "tag": "object_tracking"
}'
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://api.playment.in/v1/project/:projectId/feedline"

	payload := strings.NewReader("{\n  \"reference_id\": \"sample_reference_id\",\n  \"data\": {\n    \"frames\": [\n      {\n        \"frame_id\": \"frame001\",\n        \"src\": \"https://dummyimage.com/600x400/000/fff.jpg&text=Dummy+Image+1\"\n      },\n      {\n        \"frame_id\": \"frame002\",\n        \"src\": \"https://dummyimage.com/600x400/000/fff.jpg&text=Dummy+Image+2\"\n      },\n      {\n        \"frame_id\": \"frame003\",\n        \"src\": \"https://dummyimage.com/600x400/000/fff.jpg&text=Dummy+Image+3\"\n      },\n      {\n        \"frame_id\": \"frame004\",\n        \"src\": \"https://dummyimage.com/600x400/000/fff.jpg&text=Dummy+Image+4\"\n      },\n      {\n        \"frame_id\": \"frame005\",\n        \"src\": \"https://dummyimage.com/600x400/000/fff.jpg&text=Dummy+Image+5\"\n      }\n    ],\n    \n  },\n  \"tag\": \"object_tracking\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("x-client-key", "<your x-client-key here>")
	req.Header.Add("Content-Type", "application/json")
	req.Header.Add("cache-control", "no-cache")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
import http.client

conn = http.client.HTTPConnection("api,playment,in")

payload = "{\n  \"reference_id\": \"sample_reference_id\",\n  \"data\": {\n    \"frames\": [\n      {\n        \"frame_id\": \"frame001\",\n        \"src\": \"https://dummyimage.com/600x400/000/fff.jpg&text=Dummy+Image+1\"\n      },\n      {\n        \"frame_id\": \"frame002\",\n        \"src\": \"https://dummyimage.com/600x400/000/fff.jpg&text=Dummy+Image+2\"\n      },\n      {\n        \"frame_id\": \"frame003\",\n        \"src\": \"https://dummyimage.com/600x400/000/fff.jpg&text=Dummy+Image+3\"\n      },\n      {\n        \"frame_id\": \"frame004\",\n        \"src\": \"https://dummyimage.com/600x400/000/fff.jpg&text=Dummy+Image+4\"\n      },\n      {\n        \"frame_id\": \"frame005\",\n        \"src\": \"https://dummyimage.com/600x400/000/fff.jpg&text=Dummy+Image+5\"\n      }\n    ],\n    \n  },\n  \"tag\": \"object_tracking\"\n}"

headers = {
    'x-client-key': "<your x-client-key here>",
    'Content-Type': "application/json",
    'cache-control': "no-cache",
    }

conn.request("POST", "v1,project,:projectId,feedline", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
var request = require("request");

var options = { method: 'POST',
  url: 'https://api.playment.in/v1/project/:projectId/feedline',
  headers: 
   { 'cache-control': 'no-cache',
     'Content-Type': 'application/json',
     'x-client-key': '<your x-client-key here>' },
  body: '{\n  "reference_id": "sample_reference_id",\n  "data": {\n    "frames": [\n      {\n        "frame_id": "frame001",\n        "src": "https://dummyimage.com/600x400/000/fff.jpg&text=Dummy+Image+1"\n      },\n      {\n        "frame_id": "frame002",\n        "src": "https://dummyimage.com/600x400/000/fff.jpg&text=Dummy+Image+2"\n      },\n      {\n        "frame_id": "frame003",\n        "src": "https://dummyimage.com/600x400/000/fff.jpg&text=Dummy+Image+3"\n      },\n      {\n        "frame_id": "frame004",\n        "src": "https://dummyimage.com/600x400/000/fff.jpg&text=Dummy+Image+4"\n      },\n      {\n        "frame_id": "frame005",\n        "src": "https://dummyimage.com/600x400/000/fff.jpg&text=Dummy+Image+5"\n      }\n    ],\n    \n  },\n  "tag": "object_tracking"\n}' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
{
  "feed_line_units": [
    {
      "reference_id": "001",
      "flu_id": "sample_reference_id",
      "status": "COMPLETED",
      "tag": "object_tracking",
      "result": [
        {
          "_id": "555397a8-d916-443d-a973-e04300bb3d59",
          "type": "rectangle",
          "label": "traffic_light",
          "frames": {
            "frame001": {
              "_id": "555397a8-d916-443d-a973-e04300bb3d59",
              "type": "rectangle",
              "label": "traffic_light",
              "attributes": {
                "color": {
                  "value": "red"
                }
              },
              "coordinates": [
                {
                  "x": 0.5435780444531554,
                  "y": 0.3925569183910122
                },
                {
                  "x": 0.5477217039572666,
                  "y": 0.3925569183910122
                },
                {
                  "x": 0.5477217039572666,
                  "y": 0.41283176820041856
                },
                {
                  "x": 0.5435780444531554,
                  "y": 0.41283176820041856
                }
              ]
            },
            "frame002": {
              "_id": "555397a8-d916-443d-a973-e04300bb3d59",
              "type": "rectangle",
              "label": "traffic_light",
              "attributes": {
                "color": {
                  "value": "green"
                }
              },
              "coordinates": [
                {
                  "x": 0.5464092560993109,
                  "y": 0.4103705019588349
                },
                {
                  "x": 0.5508899646089167,
                  "y": 0.4103705019588349
                },
                {
                  "x": 0.5508899646089167,
                  "y": 0.4327607148169202
                },
                {
                  "x": 0.5464092560993109,
                  "y": 0.4327607148169202
                }
              ]
            }
          }
        },
        {
          "_id": "057cf1f5-6c15-4f29-9775-940cf27643f4",
          "type": "rectangle",
          "label": "traffic_light",
          "frames": {
            "frame002": {
              "_id": "057cf1f5-6c15-4f29-9775-940cf27643f4",
              "type": "rectangle",
              "label": "traffic_light",
              "attributes": {
                "color": {
                  "value": "off"
                }
              },
              "coordinates": [
                {
                  "x": 0.3480726842916043,
                  "y": 0.5059539147455372
                },
                {
                  "x": 0.3526237778854049,
                  "y": 0.5059539147455372
                },
                {
                  "x": 0.3526237778854049,
                  "y": 0.5252503794751654
                },
                {
                  "x": 0.3480726842916043,
                  "y": 0.5252503794751654
                }
              ]
            },
            "frame003": {
              "_id": "057cf1f5-6c15-4f29-9775-940cf27643f4",
              "type": "rectangle",
              "label": "traffic_light",
              "attributes": {
                "color": {
                  "value": "off"
                }
              },
              "coordinates": [
                {
                  "x": 0.3418031924762347,
                  "y": 0.5049184373876437
                },
                {
                  "x": 0.3465110233654195,
                  "y": 0.5049184373876437
                },
                {
                  "x": 0.3465110233654195,
                  "y": 0.5252503794751653
                },
                {
                  "x": 0.3418031924762347,
                  "y": 0.5252503794751653
                }
              ]
            }
          }
        }
      ]
    }
  ]
}
{
	"feed_line_units": [{
		"reference_id": "002",
		"flu_id": "3bcbc3fe-9fbc-4d7c-b951-a1d1bfb6f840",
		"status": "COMPLETED",
		"tag": "draw_cuboids",
		"result": [
			{
			  "_id": "555397a8-d916-443d-a973-e04300bb3d59",
			  "type": "rectangles",
		    "label": "Car",
        "frames":{
          "frame_001":{
            "_id": "057cf1f5-6c15-4f29-9775-940cf27643f4",
            "points": {
					    "p1": {"x": 0.17,"y": 0.58},
					    "p2": {"x": 0.26,"y": 0.58},
					    "p3": {"x": 0.26,"y": 0.49},
					    "p4": {"x": 0.17,"y": 0.49},
					    "p5": {"x": 0.24,"y": 0.51},
					    "p6": {"x": 0.35,"y": 0.52},
					    "p7": {"x": 0.35,"y": 0.36},
              "p8": {"x": 0.25,"y": 0.37}
				    },
				    "front": {
					    "coordinates": ["p1","p2","p3","p4"]
				    },
				    "side": {
					    "coordinates": ["p2","p3","p5","p6"]
				    },
				    "back": {
					    "coordinates": ["p7","p8","p5","p6"]
				    },
				    "attributes":{
              "model_type" : {"value": "Sedan"},
					    "faces_visible": {"value": ["right","back"]}
				    }
          },
          "frame_002":{
            "_id": "33abc3fe-9fbc-4d7c-b951-a1d1bfb6f840",
            "points": {
					    "p1": {"x": 0.19,"y": 0.58},
					    "p2": {"x": 0.24,"y": 0.56},
					    "p3": {"x": 0.23,"y": 0.49},
					    "p4": {"x": 0.12,"y": 0.44},
					    "p5": {"x": 0.27,"y": 0.52},
					    "p6": {"x": 0.33,"y": 0.52},
					    "p7": {"x": 0.38,"y": 0.38},
              "p8": {"x": 0.21,"y": 0.32}
				    },
				    "front": {
					    "coordinates": ["p1","p2","p3","p4"]
				    },
				    "side": {
					    "coordinates": ["p2","p3","p5","p6"]
				    },
				    "back": {
					    "coordinates": ["p7","p8","p5","p6"]
				    },
				    "attributes":{
              "model_type" : {"value": "Sedan"},
					    "faces_visible": {"value": ["right","back"]}
				    }
          }
        }
			}
		]
	}]
}

Line Tracking

 

Lines for object tracking in video across frames.

{
  "reference_id": "sample_reference_id",
  "data": {
    "video_data": {
      "frames": [
        {
          "frame_id": "frame001",
          "src": "https://dummyimage.com/600x400/000/fff.jpg&text=Dummy+Image+1"
        },
        {
          "frame_id": "frame002",
          "src": "https://dummyimage.com/600x400/000/fff.jpg&text=Dummy+Image+2"
        },
        {
          "frame_id": "frame003",
          "src": "https://dummyimage.com/600x400/000/fff.jpg&text=Dummy+Image+3"
        },
        {
          "frame_id": "frame004",
          "src": "https://dummyimage.com/600x400/000/fff.jpg&text=Dummy+Image+4"
        },
        {
          "frame_id": "frame005",
          "src": "https://dummyimage.com/600x400/000/fff.jpg&text=Dummy+Image+5"
        }
      ],
    }
  },
  "tag": "polygon_tracking"
}
curl -X POST \
  https://api.playment.in/v1/project/:projectId/feedline \
  -H 'Content-Type: application/json' \
  -H 'cache-control: no-cache' \
  -H 'x-client-key: <your x-client-key here>' \
  -d '{
  "reference_id": "sample_reference_id",
  "data": {
    "frames": [
      {
        "frame_id": "frame001",
        "src": "https://dummyimage.com/600x400/000/fff.jpg&text=Dummy+Image+1"
      },
      {
        "frame_id": "frame002",
        "src": "https://dummyimage.com/600x400/000/fff.jpg&text=Dummy+Image+2"
      },
      {
        "frame_id": "frame003",
        "src": "https://dummyimage.com/600x400/000/fff.jpg&text=Dummy+Image+3"
      },
      {
        "frame_id": "frame004",
        "src": "https://dummyimage.com/600x400/000/fff.jpg&text=Dummy+Image+4"
      },
      {
        "frame_id": "frame005",
        "src": "https://dummyimage.com/600x400/000/fff.jpg&text=Dummy+Image+5"
      }
    ],
    
  },
  "tag": "polygon_tracking"
}'
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://api.playment.in/v1/project/:projectId/feedline"

	payload := strings.NewReader("{\n  \"reference_id\": \"sample_reference_id\",\n  \"data\": {\n    \"frames\": [\n      {\n        \"frame_id\": \"frame001\",\n        \"src\": \"https://dummyimage.com/600x400/000/fff.jpg&text=Dummy+Image+1\"\n      },\n      {\n        \"frame_id\": \"frame002\",\n        \"src\": \"https://dummyimage.com/600x400/000/fff.jpg&text=Dummy+Image+2\"\n      },\n      {\n        \"frame_id\": \"frame003\",\n        \"src\": \"https://dummyimage.com/600x400/000/fff.jpg&text=Dummy+Image+3\"\n      },\n      {\n        \"frame_id\": \"frame004\",\n        \"src\": \"https://dummyimage.com/600x400/000/fff.jpg&text=Dummy+Image+4\"\n      },\n      {\n        \"frame_id\": \"frame005\",\n        \"src\": \"https://dummyimage.com/600x400/000/fff.jpg&text=Dummy+Image+5\"\n      }\n    ],\n    \n  },\n  \"tag\": \"polygon_tracking\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("x-client-key", "<your x-client-key here>")
	req.Header.Add("Content-Type", "application/json")
	req.Header.Add("cache-control", "no-cache")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
import http.client

conn = http.client.HTTPConnection("api,playment,in")

payload = "{\n  \"reference_id\": \"sample_reference_id\",\n  \"data\": {\n    \"frames\": [\n      {\n        \"frame_id\": \"frame001\",\n        \"src\": \"https://dummyimage.com/600x400/000/fff.jpg&text=Dummy+Image+1\"\n      },\n      {\n        \"frame_id\": \"frame002\",\n        \"src\": \"https://dummyimage.com/600x400/000/fff.jpg&text=Dummy+Image+2\"\n      },\n      {\n        \"frame_id\": \"frame003\",\n        \"src\": \"https://dummyimage.com/600x400/000/fff.jpg&text=Dummy+Image+3\"\n      },\n      {\n        \"frame_id\": \"frame004\",\n        \"src\": \"https://dummyimage.com/600x400/000/fff.jpg&text=Dummy+Image+4\"\n      },\n      {\n        \"frame_id\": \"frame005\",\n        \"src\": \"https://dummyimage.com/600x400/000/fff.jpg&text=Dummy+Image+5\"\n      }\n    ],\n    \n  },\n  \"tag\": \"polygon_tracking\"\n}"

headers = {
    'x-client-key': "<your x-client-key here>",
    'Content-Type': "application/json",
    'cache-control': "no-cache",
    }

conn.request("POST", "v1,project,:projectId,feedline", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
var request = require("request");

var options = { method: 'POST',
  url: 'https://api.playment.in/v1/project/:projectId/feedline',
  headers: 
   { 'cache-control': 'no-cache',
     'Content-Type': 'application/json',
     'x-client-key': '<your x-client-key here>' },
  body: '{\n  "reference_id": "sample_reference_id",\n  "data": {\n    "frames": [\n      {\n        "frame_id": "frame001",\n        "src": "https://dummyimage.com/600x400/000/fff.jpg&text=Dummy+Image+1"\n      },\n      {\n        "frame_id": "frame002",\n        "src": "https://dummyimage.com/600x400/000/fff.jpg&text=Dummy+Image+2"\n      },\n      {\n        "frame_id": "frame003",\n        "src": "https://dummyimage.com/600x400/000/fff.jpg&text=Dummy+Image+3"\n      },\n      {\n        "frame_id": "frame004",\n        "src": "https://dummyimage.com/600x400/000/fff.jpg&text=Dummy+Image+4"\n      },\n      {\n        "frame_id": "frame005",\n        "src": "https://dummyimage.com/600x400/000/fff.jpg&text=Dummy+Image+5"\n      }\n    ],\n    \n  },\n  "tag": "polygon_tracking"\n}' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
{
  "feed_line_units": [
    {
      "reference_id": "001",
      "flu_id": "sample_reference_id",
      "status": "COMPLETED",
      "tag": "polygon_tracking",
      "result": [
        {
          "type": "line",
          "label": "Lane",
          "frames": {
            "frame001": {
              "points": {
                "p1": {
                  "x": 0.5976247987117552,
                  "y": 0.7766666666666666
                },
                "p2": {
                  "x": 0.5040257648953301,
                  "y": 0.5233333333333333
                }
              },
              "attributes": {
                "Occlusion": {
                  "value": "10%"
                }
              }
            },
            "frame002": {
              "points": {
                "p1": {
                  "x": 0.5976247987117552,
                  "y": 0.7733333333333332
                },
                "p2": {
                  "x": 0.5040257648953301,
                  "y": 0.52
                }
              },
              "attributes": {
                "Occlusion": {
                  "value": "50%"
                }
              }
            },
            "frame003": {
              "points": {
                "p1": {
                  "x": 0.5976247987117552,
                  "y": 0.7766666666666666
                },
                "p2": {
                  "x": 0.5040257648953301,
                  "y": 0.5233333333333333
                }
              },
              "attributes": {
                "Occlusion": {
                  "value": "10%"
                }
              }
            },
            "frame004": {
              "points": {
                "p1": {
                  "x": 0.5976247987117552,
                  "y": 0.7766666666666666
                },
                "p2": {
                  "x": 0.5040257648953301,
                  "y": 0.5233333333333333
                }
              },
              "attributes": {
                "Occlusion": {
                  "value": "10%"
                }
              }
            },
            "frame005": {
              "points": {
                "p1": {
                  "x": 0.5976247987117552,
                  "y": 0.7766666666666666
                },
                "p2": {
                  "x": 0.5040257648953301,
                  "y": 0.5233333333333333
                }
              },
              "attributes": {
                "Occlusion": {
                  "value": "40%"
                }
              }
            }
          },
          "tracker_id": "cf8ba34a-78ab-402b-b386-daa607cda443"
        }
      ]
    }
  ]
}

Cuboid Tracking

 

2D Cuboids for object tracking in image videos across frames.

{
  "reference_id": "sample_reference_id",
  "data": {
    "video_data": {
      "frames": [
        {
          "frame_id": "frame001",
          "src": "https://dummyimage.com/600x400/000/fff.jpg&text=Dummy+Image+1"
        },
        {
          "frame_id": "frame002",
          "src": "https://dummyimage.com/600x400/000/fff.jpg&text=Dummy+Image+2"
        },
        {
          "frame_id": "frame003",
          "src": "https://dummyimage.com/600x400/000/fff.jpg&text=Dummy+Image+3"
        },
        {
          "frame_id": "frame004",
          "src": "https://dummyimage.com/600x400/000/fff.jpg&text=Dummy+Image+4"
        },
        {
          "frame_id": "frame005",
          "src": "https://dummyimage.com/600x400/000/fff.jpg&text=Dummy+Image+5"
        }
      ],
    }
  },
  "tag": "cuboid_tracking"
}
curl -X POST \
  https://api.playment.in/v1/project/:projectId/feedline \
  -H 'Content-Type: application/json' \
  -H 'cache-control: no-cache' \
  -H 'x-client-key: <your x-client-key here>' \
  -d '{
  "reference_id": "sample_reference_id",
  "data": {
    "frames": [
      {
        "frame_id": "frame001",
        "src": "https://dummyimage.com/600x400/000/fff.jpg&text=Dummy+Image+1"
      },
      {
        "frame_id": "frame002",
        "src": "https://dummyimage.com/600x400/000/fff.jpg&text=Dummy+Image+2"
      },
      {
        "frame_id": "frame003",
        "src": "https://dummyimage.com/600x400/000/fff.jpg&text=Dummy+Image+3"
      },
      {
        "frame_id": "frame004",
        "src": "https://dummyimage.com/600x400/000/fff.jpg&text=Dummy+Image+4"
      },
      {
        "frame_id": "frame005",
        "src": "https://dummyimage.com/600x400/000/fff.jpg&text=Dummy+Image+5"
      }
    ],
    
  },
  "tag": "cuboid_tracking"
}'
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://api.playment.in/v1/project/:projectId/feedline"

	payload := strings.NewReader("{\n  \"reference_id\": \"sample_reference_id\",\n  \"data\": {\n    \"frames\": [\n      {\n        \"frame_id\": \"frame001\",\n        \"src\": \"https://dummyimage.com/600x400/000/fff.jpg&text=Dummy+Image+1\"\n      },\n      {\n        \"frame_id\": \"frame002\",\n        \"src\": \"https://dummyimage.com/600x400/000/fff.jpg&text=Dummy+Image+2\"\n      },\n      {\n        \"frame_id\": \"frame003\",\n        \"src\": \"https://dummyimage.com/600x400/000/fff.jpg&text=Dummy+Image+3\"\n      },\n      {\n        \"frame_id\": \"frame004\",\n        \"src\": \"https://dummyimage.com/600x400/000/fff.jpg&text=Dummy+Image+4\"\n      },\n      {\n        \"frame_id\": \"frame005\",\n        \"src\": \"https://dummyimage.com/600x400/000/fff.jpg&text=Dummy+Image+5\"\n      }\n    ],\n    \n  },\n  \"tag\": \"cuboid_tracking\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("x-client-key", "<your x-client-key here>")
	req.Header.Add("Content-Type", "application/json")
	req.Header.Add("cache-control", "no-cache")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
import http.client

conn = http.client.HTTPConnection("api,playment,in")

payload = "{\n  \"reference_id\": \"sample_reference_id\",\n  \"data\": {\n    \"frames\": [\n      {\n        \"frame_id\": \"frame001\",\n        \"src\": \"https://dummyimage.com/600x400/000/fff.jpg&text=Dummy+Image+1\"\n      },\n      {\n        \"frame_id\": \"frame002\",\n        \"src\": \"https://dummyimage.com/600x400/000/fff.jpg&text=Dummy+Image+2\"\n      },\n      {\n        \"frame_id\": \"frame003\",\n        \"src\": \"https://dummyimage.com/600x400/000/fff.jpg&text=Dummy+Image+3\"\n      },\n      {\n        \"frame_id\": \"frame004\",\n        \"src\": \"https://dummyimage.com/600x400/000/fff.jpg&text=Dummy+Image+4\"\n      },\n      {\n        \"frame_id\": \"frame005\",\n        \"src\": \"https://dummyimage.com/600x400/000/fff.jpg&text=Dummy+Image+5\"\n      }\n    ],\n    \n  },\n  \"tag\": \"cuboid_tracking\"\n}"

headers = {
    'x-client-key': "<your x-client-key here>",
    'Content-Type': "application/json",
    'cache-control': "no-cache",
    }

conn.request("POST", "v1,project,:projectId,feedline", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
var request = require("request");

var options = { method: 'POST',
  url: 'https://api.playment.in/v1/project/:projectId/feedline',
  headers: 
   { 'cache-control': 'no-cache',
     'Content-Type': 'application/json',
     'x-client-key': '<your x-client-key here>' },
  body: '{\n  "reference_id": "sample_reference_id",\n  "data": {\n    "frames": [\n      {\n        "frame_id": "frame001",\n        "src": "https://dummyimage.com/600x400/000/fff.jpg&text=Dummy+Image+1"\n      },\n      {\n        "frame_id": "frame002",\n        "src": "https://dummyimage.com/600x400/000/fff.jpg&text=Dummy+Image+2"\n      },\n      {\n        "frame_id": "frame003",\n        "src": "https://dummyimage.com/600x400/000/fff.jpg&text=Dummy+Image+3"\n      },\n      {\n        "frame_id": "frame004",\n        "src": "https://dummyimage.com/600x400/000/fff.jpg&text=Dummy+Image+4"\n      },\n      {\n        "frame_id": "frame005",\n        "src": "https://dummyimage.com/600x400/000/fff.jpg&text=Dummy+Image+5"\n      }\n    ],\n    \n  },\n  "tag": "cuboid_tracking"\n}' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
{
  "feed_line_units": [
    {
      "reference_id": "001",
      "flu_id": "sample_reference_id",
      "status": "COMPLETED",
      "tag": "polygon_tracking",
      "result": [
        {
          "type": "cuboid",
          "label": "Car",
          "frames": {
            "frame001": {
              "points": {
                "p1": {
                  "x": 0.15982286634460555,
                  "y": 0.54
                },
                "p2": {
                  "x": 0.267512077294686,
                  "y": 0.54
                },
                "p3": {
                  "x": 0.267512077294686,
                  "y": 0.8
                },
                "p4": {
                  "x": 0.15982286634460555,
                  "y": 0.8
                },
                "p5": {
                  "x": 0.3852657004830917,
                  "y": 0.48833333333333334
                },
                "p6": {
                  "x": 0.3852657004830917,
                  "y": 0.7283333333333334
                },
                "p7": {
                  "x": 0.28586027499070976,
                  "y": 0.48833333333333334
                },
                "p8": {
                  "x": 0.28586027499070976,
                  "y": 0.7283333333333334
                }
              },
              "attributes": {
                "Lane": {
                  "value": "Same as ego car"
                }
              },
              "front": {
                "coordinates": [
                  "p1",
                  "p2",
                  "p3",
                  "p4"
                ]
              },
              "side": {
                "coordinates": [
                  "p2",
                  "p5",
                  "p6",
                  "p3"
                ]
              },
              "back": {
                "coordinates": [
                  "p5",
                  "p7",
                  "p8",
                  "p6"
                ]
              }
            },
            "frame002": {
              "points": {
                "p1": {
                  "x": 0.11352657004830924,
                  "y": 0.56
                },
                "p2": {
                  "x": 0.22121578099838982,
                  "y": 0.56
                },
                "p3": {
                  "x": 0.22121578099838982,
                  "y": 0.82
                },
                "p4": {
                  "x": 0.11352657004830924,
                  "y": 0.82
                },
                "p5": {
                  "x": 0.33896940418679555,
                  "y": 0.5083333333333332
                },
                "p6": {
                  "x": 0.33896940418679555,
                  "y": 0.7483333333333332
                },
                "p7": {
                  "x": 0.23956397869441343,
                  "y": 0.5083333333333332
                },
                "p8": {
                  "x": 0.23956397869441343,
                  "y": 0.7483333333333332
                }
              },
              "attributes": {
                "Lane": {
                  "value": "Same as ego car"
                }
              },
              "front": {
                "coordinates": [
                  "p1",
                  "p2",
                  "p3",
                  "p4"
                ]
              },
              "side": {
                "coordinates": [
                  "p2",
                  "p5",
                  "p6",
                  "p3"
                ]
              },
              "back": {
                "coordinates": [
                  "p5",
                  "p7",
                  "p8",
                  "p6"
                ]
              }
            },
            "frame003": {
              "points": {
                "p1": {
                  "x": 0.036030595813204405,
                  "y": 0.5966666666666667
                },
                "p2": {
                  "x": 0.14371980676328497,
                  "y": 0.5966666666666667
                },
                "p3": {
                  "x": 0.14371980676328497,
                  "y": 0.8566666666666667
                },
                "p4": {
                  "x": 0.036030595813204405,
                  "y": 0.8566666666666667
                },
                "p5": {
                  "x": 0.26147342995169087,
                  "y": 0.5449999999999999
                },
                "p6": {
                  "x": 0.26147342995169087,
                  "y": 0.7849999999999998
                },
                "p7": {
                  "x": 0.16206800445930886,
                  "y": 0.5449999999999999
                },
                "p8": {
                  "x": 0.16206800445930886,
                  "y": 0.7849999999999998
                }
              },
              "attributes": {
                "Lane": {
                  "value": "Side"
                }
              },
              "front": {
                "coordinates": [
                  "p1",
                  "p2",
                  "p3",
                  "p4"
                ]
              },
              "side": {
                "coordinates": [
                  "p2",
                  "p5",
                  "p6",
                  "p3"
                ]
              },
              "back": {
                "coordinates": [
                  "p5",
                  "p7",
                  "p8",
                  "p6"
                ]
              }
            },
            "frame004": {
              "points": {
                "p1": {
                  "x": -0.06763285024154582,
                  "y": 0.6466666666666666
                },
                "p2": {
                  "x": 0.04005636070853473,
                  "y": 0.6466666666666666
                },
                "p3": {
                  "x": 0.04005636070853473,
                  "y": 0.9066666666666666
                },
                "p4": {
                  "x": -0.06763285024154582,
                  "y": 0.9066666666666666
                },
                "p5": {
                  "x": 0.15780998389694048,
                  "y": 0.5949999999999999
                },
                "p6": {
                  "x": 0.15780998389694048,
                  "y": 0.8349999999999999
                },
                "p7": {
                  "x": 0.05840455840455844,
                  "y": 0.5949999999999999
                },
                "p8": {
                  "x": 0.05840455840455844,
                  "y": 0.8349999999999999
                }
              },
              "attributes": {
                "Lane": {
                  "value": "Side"
                }
              },
              "front": {
                "coordinates": [
                  "p1",
                  "p2",
                  "p3",
                  "p4"
                ]
              },
              "side": {
                "coordinates": [
                  "p2",
                  "p5",
                  "p6",
                  "p3"
                ]
              },
              "back": {
                "coordinates": [
                  "p5",
                  "p7",
                  "p8",
                  "p6"
                ]
              }
            },
            "frame005": {
              "points": {
                "p1": {
                  "x": -0.13103864734299503,
                  "y": 0.5833333333333334
                },
                "p2": {
                  "x": -0.015096618357487952,
                  "y": 0.5833333333333334
                },
                "p3": {
                  "x": -0.015096618357487952,
                  "y": 0.9
                },
                "p4": {
                  "x": -0.13103864734299503,
                  "y": 0.9
                },
                "p5": {
                  "x": 0.1869967793880838,
                  "y": 0.49833333333333335
                },
                "p6": {
                  "x": 0.1869967793880838,
                  "y": 0.8283333333333334
                },
                "p7": {
                  "x": 0.06617298076108166,
                  "y": 0.49833333333333335
                },
                "p8": {
                  "x": 0.06617298076108166,
                  "y": 0.8283333333333334
                }
              },
              "attributes": {
                "Lane": {
                  "value": "Side"
                }
              },
              "front": {
                "coordinates": [
                  "p1",
                  "p2",
                  "p3",
                  "p4"
                ]
              },
              "side": {
                "coordinates": [
                  "p2",
                  "p5",
                  "p6",
                  "p3"
                ]
              },
              "back": {
                "coordinates": [
                  "p5",
                  "p7",
                  "p8",
                  "p6"
                ]
              }
            }
          },
          "tracker_id": "bab6690f-c6de-446b-b372-0ef3743abe35"
        }
      ]
    }
  ]
}

Semantic Segmentation

 

Assign a label to each pixel in an image

Full Pixel Semantic Segmentation for Autonomous driving

Full Pixel Semantic Segmentation for Autonomous driving

{  
   "reference_id":"001",
   "data":{
     "image_url":"https://dummyimage.com/600x400/000/fff.jpg&text=Dummy+Image+1"
   },
   "tag":"semantic_segmentation"
}
curl -X POST \
  https://api.playment.in/v1/project/:projectId/feedline \
  -H 'Content-Type: application/json' \
  -H 'cache-control: no-cache' \
  -H 'x-client-key: <your x-client-key here>' \
  -d '{  
   "reference_id":"001",
   "data":{
     "image_url":"https://dummyimage.com/600x400/000/fff.jpg&text=Dummy+Image+1"
   },
   "tag":"semantic_segmentation"
}'
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://api.playment.in/v1/project/:projectId/feedline"

	payload := strings.NewReader("{  \n   \"reference_id\":\"001\",\n   \"data\":{\n     \"image_url\":\"https://dummyimage.com/600x400/000/fff.jpg&text=Dummy+Image+1\"\n   },\n   \"tag\":\"semantic_segmentation\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("x-client-key", "<your x-client-key here>")
	req.Header.Add("Content-Type", "application/json")
	req.Header.Add("cache-control", "no-cache")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
import http.client

conn = http.client.HTTPConnection("api,playment,in")

payload = "{  \n   \"reference_id\":\"001\",\n   \"data\":{\n     \"image_url\":\"https://dummyimage.com/600x400/000/fff.jpg&text=Dummy+Image+1\"\n   },\n   \"tag\":\"semantic_segmentation\"\n}"

headers = {
    'x-client-key': "<your x-client-key here>",
    'Content-Type': "application/json",
    'cache-control': "no-cache",
    }

conn.request("POST", "v1,project,:projectId,feedline", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
var request = require("request");

var options = { method: 'POST',
  url: 'https://api.playment.in/v1/project/:projectId/feedline',
  headers: 
   { 'cache-control': 'no-cache',
     'Content-Type': 'application/json',
     'x-client-key': '<your x-client-key here>' },
  body: 
   { reference_id: '001',
     data: { image_url: 'https://dummyimage.com/600x400/000/fff.jpg&text=Dummy+Image+1' },
     tag: 'semantic_segmentation' },
  json: true };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
{
  "feed_line_units": [
    {
      "reference_id": "001",
      "flu_id": "3bcbc3fe-9fbc-4d7c-b951-a1d1bfb6f840",
      "status": "COMPLETED",
      "tag": "semantic_segmentation",
      "image_url": "https://dummyimage.com/600x400/000/fff.jpg&text=Dummy+Image+1",
      "result": {
        "grayscale_mask": "https://example.playment.io/001_grayscale.png",
        "grayscale_label_map": {
          "car" : "1",
          "pedestrian" : "2"
        },
        "rgb_mask": "https://example.playment.io/001_rgb.png",
        "rgb_label_map": {
          "car" : "#001ADE",
          "pedestrian" : "#BDF032"
        }
      }
    }
  ]
}

Instance Segmentation

 

Assign an instanceID to each object present in the image.

Semantic Instance Segmented street scene

Semantic Instance Segmented street scene

{  
   "reference_id":"001",
   "data":{
     "image_url":"https://dummyimage.com/600x400/000/fff.jpg&text=Dummy+Image+1"
   },
   "tag":"instance_segmentation"
}
curl -X POST \
  https://api.playment.in/v1/project/:projectId/feedline \
  -H 'Content-Type: application/json' \
  -H 'cache-control: no-cache' \
  -H 'x-client-key: <your x-client-key here>' \
  -d '{  
   "reference_id":"001",
   "data":{
     "image_url":"https://dummyimage.com/600x400/000/fff.jpg&text=Dummy+Image+1"
   },
   "tag":"semantic_segmentation"
}'
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://api.playment.in/v1/project/:projectId/feedline"

	payload := strings.NewReader("{  \n   \"reference_id\":\"001\",\n   \"data\":{\n     \"image_url\":\"https://dummyimage.com/600x400/000/fff.jpg&text=Dummy+Image+1\"\n   },\n   \"tag\":\"instance_segmentation\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("x-client-key", "<your x-client-key here>")
	req.Header.Add("Content-Type", "application/json")
	req.Header.Add("cache-control", "no-cache")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
import http.client

conn = http.client.HTTPConnection("api,playment,in")

payload = "{  \n   \"reference_id\":\"001\",\n   \"data\":{\n     \"image_url\":\"https://dummyimage.com/600x400/000/fff.jpg&text=Dummy+Image+1\"\n   },\n   \"tag\":\"instance_segmentation\"\n}"

headers = {
    'x-client-key': "<your x-client-key here>",
    'Content-Type': "application/json",
    'cache-control': "no-cache",
    }

conn.request("POST", "v1,project,:projectId,feedline", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
var request = require("request");

var options = { method: 'POST',
  url: 'https://api.playment.in/v1/project/:projectId/feedline',
  headers: 
   { 'cache-control': 'no-cache',
     'Content-Type': 'application/json',
     'x-client-key': '<your x-client-key here>' },
  body: 
   { reference_id: '001',
     data: { image_url: 'https://dummyimage.com/600x400/000/fff.jpg&text=Dummy+Image+1' },
     tag: 'instance_segmentation' },
  json: true };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
{
  "feed_line_units": [
    {
      "reference_id": "001",
      "flu_id": "3bcbc3fe-9fbc-4d7c-b951-a1d1bfb6f840",
      "status": "COMPLETED",
      "tag": "instance_segmentation",
      "result": {
          "mask_url": "https://example.playment.io/001_rgb.png",
          "legend": {
            "Car # 1": "#fdffd34",
            "Car # 2": "#f1fd34",
            "Sky": "#f23334",
            "Tree": "#fd2d34"
          }
      }
    }
  ]
}

Cuboids

 

Label perspective cuboids with coordinates of 6 vertices for any object in a 2D image for camera based depth perception models

{  
   "reference_id":"002",
   "data":{
     "image_url":"https://dummyimage.com/600x400/000/fff.jpg&text=Dummy+Image+1"
   },
   "tag":"draw_cuboids"
}
curl -X POST \
  https://api.playment.in/v1/project/:projectId/feedline \
  -H 'Content-Type: application/json' \
  -H 'cache-control: no-cache' \
  -H 'x-client-key: <your x-client-key here>' \
  -d '{  
   "reference_id":"001",
   "data":{
     "image_url":"https://dummyimage.com/600x400/000/fff.jpg&text=Dummy+Image+1"
   },
   "tag":"draw_cuboids"
}'
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io/ioutil"
)

func main() {

  url := "https://api.playment.in/v1/project/:projectId/feedline"

	payload := strings.NewReader("{  \n   \"reference_id\":\"001\",\n   \"data\":{\n     \"image_url\":\"https://dummyimage.com/600x400/000/fff.jpg&text=Dummy+Image+1\"\n   },\n   \"tag\":\"draw_cuboids\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("x-client-key", "<your x-client-key here>")
	req.Header.Add("Content-Type", "application/json")
	req.Header.Add("cache-control", "no-cache")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
import http.client

conn = http.client.HTTPConnection("api,playment,in")

payload = "{  \n   \"reference_id\":\"001\",\n   \"data\":{\n     \"image_url\":\"https://dummyimage.com/600x400/000/fff.jpg&text=Dummy+Image+1\"\n   },\n   \"tag\":\"draw_cuboids\"\n}"

headers = {
    'x-client-key': "<your x-client-key here>",
    'Content-Type': "application/json",
    'cache-control': "no-cache"
    }

conn.request("POST", "v1,project,:projectId,feedline", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
var request = require("request");

var options = { method: 'POST',
  url: 'https://api.playment.in/v1/project/:projectId/feedline',
  headers: 
   { 'cache-control': 'no-cache',
     'Content-Type': 'application/json',
     'x-client-key': '<your x-client-key here>' },
  body: 
   { reference_id: '001',
     data: { image_url: 'https://dummyimage.com/600x400/000/fff.jpg&text=Dummy+Image+1' },
     tag: 'draw_cuboids' },
  json: true };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
{
	"feed_line_units": [{
		"reference_id": "002",
		"flu_id": "3bcbc3fe-9fbc-4d7c-b951-a1d1bfb6f840",
		"status": "COMPLETED",
		"tag": "draw_cuboids",
		"result": {
			"cuboids": [{
				"points": {
					"p1": {"x": 0.17,"y": 0.58},
					"p2": {"x": 0.26,"y": 0.58},
					"p3": {"x": 0.26,"y": 0.49},
					"p4": {"x": 0.17,"y": 0.49},
					"p5": {"x": 0.24,"y": 0.51},
					"p6": {"x": 0.35,"y": 0.52},
					"p7": {"x": 0.35,"y": 0.36},
          "p8": {"x": 0.25,"y": 0.37}
				},
				"front": {
					"coordinates": ["p1","p2","p3","p4"] //clockwise
				},
				"side": {
					"coordinates": ["p2","p3","p5","p6"]
				},
				"back": {
					"coordinates": ["p7","p8","p5","p6"]
				},
				"label": "Car - Sedan",
        "faces_visible": ["right","back"]
			}...
			]
		}
	}]
}

Landmarks

 

Facial landmark annotations for facial feature understanding

Landmarks on Human Face

Landmarks on Human Face

{  
   "reference_id":"001",
   "data":{
     "image_url":"https://dummyimage.com/600x400/000/fff.jpg&text=Dummy+Image+1"
   },
   "tag":"draw_landmarks"
}
curl -X POST \
  https://api.playment.in/v1/project/:projectId/feedline \
  -H 'Content-Type: application/json' \
  -H 'cache-control: no-cache' \
  -H 'x-client-key: <your x-client-key here>' \
  -d '{  
   "reference_id":"001",
   "data":{
     "image_url":"https://dummyimage.com/600x400/000/fff.jpg&text=Dummy+Image+1"
   },
   "tag":"draw_landmarks"
}'
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io/ioutil"
)

func main() {

  url := "https://api.playment.in/v1/project/:projectId/feedline"

	payload := strings.NewReader("{  \n   \"reference_id\":\"001\",\n   \"data\":{\n     \"image_url\":\"https://dummyimage.com/600x400/000/fff.jpg&text=Dummy+Image+1\"\n   },\n   \"tag\":\"draw_landmarks\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("x-client-key", "<your x-client-key here>")
	req.Header.Add("Content-Type", "application/json")
	req.Header.Add("cache-control", "no-cache")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
import http.client

conn = http.client.HTTPConnection("api,playment,in")

payload = "{  \n   \"reference_id\":\"001\",\n   \"data\":{\n     \"image_url\":\"https://dummyimage.com/600x400/000/fff.jpg&text=Dummy+Image+1\"\n   },\n   \"tag\":\"draw_landmarks\"\n}"

headers = {
    'x-client-key': "<your x-client-key here>",
    'Content-Type': "application/json",
    'cache-control': "no-cache"
    }

conn.request("POST", "v1,project,:projectId,feedline", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
var request = require("request");

var options = { method: 'POST',
  url: 'https://api.playment.in/v1/project/:projectId/feedline',
  headers: 
   { 'cache-control': 'no-cache',
     'Content-Type': 'application/json',
     'x-client-key': '<your x-client-key here>' },
  body: 
   { reference_id: '001',
     data: { image_url: 'https://dummyimage.com/600x400/000/fff.jpg&text=Dummy+Image+1' },
     tag: 'draw_landmarks' },
  json: true };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
{
	"feed_line_units": [{
		"reference_id": "002",
		"flu_id": "3bcbc3fe-9fbc-4d7c-b951-a1d1bfb6f840",
		"status": "COMPLETED",
		"tag": "draw_landmarks",
		"result": {
			"landmarks": [{
			"points": {
				"p1": { "x": 0.17, "y": 0.58, "label": 1 },
				"p2": { "x": 0.26, "y": 0.63, "label": 2 },
        "p3": { "x": 0.27, "y": 0.63, "label": 3 },
        "p4": { "x": 0.29, "y": 0.59, "label": 4 },
        "p5": { "x": 0.25, "y": 0.46, "label": 5 },
        "p6": { "x": 0.22, "y": 0.42, "label": 6 }
		},
			"label": "nose"
		}, {
			"points": {
        "p1": { "x": 0.17, "y": 0.58, "label": 7 },
        "p2": { "x": 0.26, "y": 0.63, "label": 8 },
        "p3": { "x": 0.27, "y": 0.63, "label": 9 },
        "p4": { "x": 0.29, "y": 0.59, "label": 10 },
        "p5": { "x": 0.25, "y": 0.46, "label": 11 },
        "p6": { "x": 0.22, "y": 0.42, "label": 12 }
		},
			"label": "left-ear"
		}...]
		}
	}]
}

Polygons

 

Annotate object instances with polygons instead of pixel segmentation

Detect vehicles on road

Detect vehicles on road

{  
   "reference_id":"001",
   "data":{
     "image_url":"https://dummyimage.com/600x400/000/fff.jpg&text=Dummy+Image+1"
   },
   "tag":"draw_polygons"
}
curl -X POST \
  https://api.playment.in/v1/project/:projectId/feedline \
  -H 'Content-Type: application/json' \
  -H 'cache-control: no-cache' \
  -H 'x-client-key: <your x-client-key here>' \
  -d '{  
   "reference_id":"001",
   "data":{
     "image_url":"https://dummyimage.com/600x400/000/fff.jpg&text=Dummy+Image+1"
   },
   "tag":"draw_polygons"
}'
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io/ioutil"
)

func main() {

  url := "https://api.playment.in/v1/project/:projectId/feedline"

	payload := strings.NewReader("{  \n   \"reference_id\":\"001\",\n   \"data\":{\n     \"image_url\":\"https://dummyimage.com/600x400/000/fff.jpg&text=Dummy+Image+1\"\n   },\n   \"tag\":\"draw_polygons\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("x-client-key", "<your x-client-key here>")
	req.Header.Add("Content-Type", "application/json")
	req.Header.Add("cache-control", "no-cache")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
import http.client

conn = http.client.HTTPConnection("api,playment,in")

payload = "{  \n   \"reference_id\":\"001\",\n   \"data\":{\n     \"image_url\":\"https://dummyimage.com/600x400/000/fff.jpg&text=Dummy+Image+1\"\n   },\n   \"tag\":\"draw_polygons\"\n}"

headers = {
    'x-client-key': "<your x-client-key here>",
    'Content-Type': "application/json",
    'cache-control': "no-cache"
    }

conn.request("POST", "v1,project,:projectId,feedline", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
var request = require("request");

var options = { method: 'POST',
  url: 'https://api.playment.in/v1/project/:projectId/feedline',
  headers: 
   { 'cache-control': 'no-cache',
     'Content-Type': 'application/json',
     'x-client-key': '<your x-client-key here>' },
  body: 
   { reference_id: '001',
     data: { image_url: 'https://dummyimage.com/600x400/000/fff.jpg&text=Dummy+Image+1' },
     tag: 'draw_polygons' },
  json: true };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
{
	"feed_line_units": [{
		"reference_id": "001",
		"flu_id": "3bcbc3fe-9fbc-4d7c-b951-a1d1bfb6f840",
		"status": "COMPLETED",
		"tag": "draw_polygons",
		"result": {
			"polygons": [{
				"points": {
					"p1": {"x": 0.17,"y": 0.58},
					"p2": {"x": 0.26,"y": 0.63},
					"p3": {"x": 0.27,"y": 0.63},
					"p4": {"x": 0.29,"y": 0.59},
					"p5": {"x": 0.25,"y": 0.46},
					"p6": {"x": 0.22,"y": 0.42}...
				},
				"edges": {
					"e1": ["p1","p2"],
					"e2": ["p2","p3"],
					"e3": ["p3","p4"],
					"e4": ["p4","p5"],
					"e5": ["p5","p6"],
					"e6": ["p6","p7"],
					"e7": ["p8","p9"]...
				},
				"label": "Sofa"
			}...
                 ]
		}
	}]
}

Bounding Box Validation

 

Validate the performance of your object detection models

{  
   "reference_id":"001",
   "data":{
     "image_url":"https://dummyimage.com/600x400/000/fff.jpg&text=Dummy+Image+1",
     "boxes": [{
       	 "id" : "box_0001",
         "label": "car",
         "coordinates": [
           {"x": 0.38, "y": 0.19}, 
           {"x": 0.57, "y": 0.19}, 
           {"x": 0.57, "y": 0.44}, 
           {"x": 0.38, "y": 0.44}]
       },
       {
         "id" : "box_0002",
         "label": "van",
         "coordinates": [
           {"x": 0.38, "y": 0.19}, 
           {"x": 0.57, "y": 0.19}, 
           {"x": 0.57, "y": 0.44}, 
           {"x": 0.38, "y": 0.44}]
       }]
   },
   "tag":"validate_boxes"
}
curl -X POST \
  https://api.playment.in/v1/project/:projectId/feedline \
  -H 'Content-Type: application/json' \
  -H 'cache-control: no-cache' \
  -H 'x-client-key: <your x-client-key here>' \
  -d '{  
   "reference_id":"001",
   "data":{
     "image_url":"https://dummyimage.com/600x400/000/fff.jpg&text=Dummy+Image+1",
     "boxes": [{
       	 "id" : "box_0001",
         "label": "car",
         "coordinates": [
           {"x": 0.38, "y": 0.19}, 
           {"x": 0.57, "y": 0.19}, 
           {"x": 0.57, "y": 0.44}, 
           {"x": 0.38, "y": 0.44}]
       },
       {
         "id" : "box_0002",
         "label": "van",
         "coordinates": [
           {"x": 0.38, "y": 0.19}, 
           {"x": 0.57, "y": 0.19}, 
           {"x": 0.57, "y": 0.44}, 
           {"x": 0.38, "y": 0.44}]
       }]
   },
   "tag":"validate_boxes"
}'
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://api.playment.in/v1/project/:projectId/feedline"

	payload := strings.NewReader("{  \n   \"reference_id\":\"001\",\n   \"data\":{\n     \"image_url\":\"https://dummyimage.com/600x400/000/fff.jpg&text=Dummy+Image+1\",\n     \"boxes\": [{\n       \t \"id\" : \"box_0001\",\n         \"label\": \"car\",\n         \"coordinates\": [\n           {\"x\": 0.38, \"y\": 0.19}, \n           {\"x\": 0.57, \"y\": 0.19}, \n           {\"x\": 0.57, \"y\": 0.44}, \n           {\"x\": 0.38, \"y\": 0.44}]\n       },\n       {\n         \"id\" : \"box_0002\",\n         \"label\": \"van\",\n         \"coordinates\": [\n           {\"x\": 0.38, \"y\": 0.19}, \n           {\"x\": 0.57, \"y\": 0.19}, \n           {\"x\": 0.57, \"y\": 0.44}, \n           {\"x\": 0.38, \"y\": 0.44}]\n       }]\n   },\n   \"tag\":\"validate_boxes\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("x-client-key", "<your x-client-key here>")
	req.Header.Add("Content-Type", "application/json")
	req.Header.Add("cache-control", "no-cache")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
import http.client

conn = http.client.HTTPConnection("api,playment,in")

payload = "{  \n   \"reference_id\":\"001\",\n   \"data\":{\n     \"image_url\":\"https://dummyimage.com/600x400/000/fff.jpg&text=Dummy+Image+1\",\n     \"boxes\": [{\n       \t \"id\" : \"box_0001\",\n         \"label\": \"car\",\n         \"coordinates\": [\n           {\"x\": 0.38, \"y\": 0.19}, \n           {\"x\": 0.57, \"y\": 0.19}, \n           {\"x\": 0.57, \"y\": 0.44}, \n           {\"x\": 0.38, \"y\": 0.44}]\n       },\n       {\n         \"id\" : \"box_0002\",\n         \"label\": \"van\",\n         \"coordinates\": [\n           {\"x\": 0.38, \"y\": 0.19}, \n           {\"x\": 0.57, \"y\": 0.19}, \n           {\"x\": 0.57, \"y\": 0.44}, \n           {\"x\": 0.38, \"y\": 0.44}]\n       }]\n   },\n   \"tag\":\"validate_boxes\"\n}"

headers = {
    'x-client-key': "<your x-client-key here>",
    'Content-Type': "application/json",
    'cache-control': "no-cache",
    }

conn.request("POST", "v1,project,:projectId,feedline", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
var request = require("request");

var options = { method: 'POST',
  url: 'https://api.playment.in/v1/project/:projectId/feedline',
  headers: 
   { 'cache-control': 'no-cache',
     'Content-Type': 'application/json',
     'x-client-key': '<your x-client-key here>' },
  body: 
   { reference_id: '001',
     data: 
      { image_url: 'https://dummyimage.com/600x400/000/fff.jpg&text=Dummy+Image+1',
        boxes: 
         [ { id: 'box_0001',
             label: 'car',
             coordinates: 
              [ { x: 0.38, y: 0.19 },
                { x: 0.57, y: 0.19 },
                { x: 0.57, y: 0.44 },
                { x: 0.38, y: 0.44 } ] },
           { id: 'box_0002',
             label: 'van',
             coordinates: 
              [ { x: 0.38, y: 0.19 },
                { x: 0.57, y: 0.19 },
                { x: 0.57, y: 0.44 },
                { x: 0.38, y: 0.44 } ] } ] },
     tag: 'validate_boxes' },
  json: true };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
{
  "feed_line_units": [
    {
      "reference_id": "001",
      "flu_id": "33abc3fe-9fbc-4d7c-b951-a1d1bfb6f840",
      "status": "COMPLETED",
      "tag": "validate_boxes",
      "result": [
        {
          "id": "box_0001",
          "label": {
            "judgement": "valid",
            "value": "car"
          },
          "coordinates": {
            "judgement": "invalid",
            "value": [
              {"x": 0.38, "y": 0.19}, 
              {"x": 0.57, "y": 0.19}, 
              {"x": 0.57, "y": 0.44}, 
              {"x": 0.38, "y": 0.44}]
          }
        },
        {
          "id": "box_0002",
          "label": {
            "judgement": "invalid",
            "value": "truck"
          },
          "coordinates": {
            "judgement": "valid",
            "value": [
              {"x": 0.38, "y": 0.19}, 
              {"x": 0.57, "y": 0.19}, 
              {"x": 0.57, "y": 0.44}, 
              {"x": 0.38, "y": 0.44}]
          }
        }
      ]
    ]
  }
}

Annotation Attributes

 

In addition to the basic shape annotations, we provide labelling of any attributes associated with the parent annotations

Check the feed_line_units[0].result.rectangles[0].attributes key in the callback body shown on the right

{
    "feed_line_units": [{
   	 "reference_id": "001",
   	 "flu_id": "33abc3fe-9fbc-4d7c-b951-a1d1bfb6f840",
   	 "status": "COMPLETED",
   	 "tag": "draw_bounding_boxes",
   	 "result": {
       "rectangles": [
         {
           "label": "television",
           "coordinates": [
             {"x": 0.38, "y": 0.19}, 
             {"x": 0.57, "y": 0.19}, 
             {"x": 0.57, "y": 0.44}, 
             {"x": 0.38, "y": 0.44}],
           "attributes": {
             "occlusion": 0,
             "leading_vehicle": True
           }
         },
         {
           "label": "plant",
           "coordinates": [
             {"x": 0.38, "y": 0.19}, 
             {"x": 0.57, "y": 0.19}, 
             {"x": 0.57, "y": 0.44}, 
             {"x": 0.38, "y": 0.44}],
            "attributes": {
              "occlusion": 1,
              "leading_vehicle": False
            }
         }
       ]
      }
    }]
}

What we send

 

You will be required to configure a callback_url, where we will POST the results of your request once it is completed.

POST https://<some_custom_callback_url>

We send the response as a JSON body, which looks like this:

The result object is a JSON which can contain one or more key-value pairs, depending on your requirements. Check the examples to understand how it can be used in various scenarios.

In case the images shared in the Feedline API are invalid or unavailable, we will retry multiple times before responding asynchronously to the Callback API with "status": "FAILED"

Parameters

content-type : application/json

reference_id

reference_id is a unique identifier for a request. We'll fail a request if you've sent another request with the same reference_id previously. This helps us ensure that we don't charge you for work which we've already done for you.

flu_id

This is the unique ID that we generate for every request

status

PENDING : The data is currently being processed
COMPLETED : All the data has been processed and is ready for consumption by client
FAILED : Data validation or file download failed

As of today, you will not receive a response which has a `FAILED' status

tag

Each request should have a tag which tells us what operation needs to be performed on that request. Don't worry, We'll share this tag with you during the integration process.

Authentication

For authentication of the callbacks, we can send a x-playment-key header with each callback. You will need to share the key with us via a secure channel. If you receive requests without the set header, then it is not from Playment's side.

{
    "feed_line_units": [{
   	 "reference_id": "001",
   	 "flu_id": "33abc3fe-9fbc-4d7c-b951-a1d1bfb6f840",
   	 "status": "COMPLETED",
   	 "tag": "cat_or_dog",
   	 "result": {
       "category" : "cat"
    }]
}
{
  "feed_line_units": [
    {
      "reference_id": "001",
      "flu_id": "33abc3fe-9fbc-4d7c-b951-a1d1bfb6f840",
      "status": "FAILED",
      "tag": "cat_or_dog",
      "error": {
        "code": "FS_0003",
        "message": "Invalid data passed",
        "meta_data": {
          "failures": [
            {
              "field": "product_image_url",
              "type": "INVALID_IMAGE_LINK"
            },
            {
              "field": "review_image_url",
              "type": "INVALID_IMAGE_LINK"
            }
          ]
        }
      }
    }
  ]
}

Error codes

 

On a callback request, you should respond with 200 HttpStatusCode to be considered as a successful request. Any non-200 HttpStatusCode will be considered as unsuccessful. In case of following non-200 HttpStatusCodes, we retry upto 3 times in an interval of 30 seconds:

Error Code
Description

408

Request Timeout

500

Internal Server Error

501

Not Implemented

502

Bad Gateway

503

Service Unavailable

504

Gateway Timeout

505

HTTP Version Not Supported

511

Network Authentication Required