REST API V2

V2 REST API References for Image Annotation (Bounding Box / Segmentation)

API Overview for Image Annotation (Bounding Box / Segmentation)

Verb

Endpoint

Description

GET

/v2/labelfiles

Get the loading status when selecting a label file

GET

/v2/folders

Get the folder status when selecting a project folder

GET

/v2/:annotation_type/projects/:project_name

Get the status of creating a project

GET

/v2/:annotation_type/projects/:project_name/reloadstatus

Get the reload status on refreshing/reloading a project

GET

/v2/:annotation_type/projects/importstatus

Get the status of importing a project configuration file

GET

/v2/:annotation_type/projects/exportstatus

Get the status of exporting a project

GET

/v2/:annotation_type/projects/:project_name/statistic

Get the statistics of a project

GET

/v2/:annotation_type/projects/:project_name/addstatus

Get the add images status of a project

PUT

/:annotation_type/projects/:project_name/star

Toggle the starring status of a project

PUT

/v2/labelfiles

Select a label text file

PUT

/v2/folders

Select a project folder

PUT

/v2/projects

Create a new project with preferred options

PUT

/v2/:annotation_type/projects/:project_name/reload

Reload/refresh a project by rechecking through the project folder

PUT

/v2/:annotation_type/projects/:project_name/export/:export_type

Start export process of a project.

PUT

/v2/:annotation_type/projects/:projectname/rename/:new_project_name

Rename an existing project to a new unique project name

PUT

/:annotation_type/projects/:project_name

Close a project

PUT

/v2/:annotation_type/projects/:project_name/imgsrc/rename

Rename project data

PUT

v2/:annotation_type/projects/:project_name/add

Add images to a project

DELETE

/v2/:annotation_type/projects/:project_name/uuids

Delete project data

:annotation_type accepts the following parameter

  • bndbox

    • Example: /bndbox/projects/helloworld

  • seg .

    • Example: /seg/projects/helloworld

for the corresponding image annotation techniques.

API Detailed Walkthrough

Get the loading status when selecting a label file

GET http://localhost:{port}/v2/labelfiles

Get the loading status when selecting a label file

Path Parameters

NameTypeDescription

string

{
    "message": 1,
    "window_status": 0,
    "window_message": "WINDOW_OPEN"
}

Get the folder status when selecting a project folder

GET http://localhost:{port}/v2/folders

Get the folder status when selecting a project folder.

Path Parameters

NameTypeDescription

string

{
    "message": 1,
    "window_status": 0,
    "window_message": "WINDOW_OPEN"
}

Get the status of creating a project

GET http://localhost:{port}/v2/:annotation_type/projects/:project_name

Get the status of creating a project.

Path Parameters

NameTypeDescription

project_name*

string

Project name

annotation_tye*

string

Type of annotation

{
    "message": 1,
    "file_system_status": 1,
    "file_system_message": "ITERATING_FOLDER"
}

Get the reload status on refreshing/reloading a project.

GET http://localhost:{port}/v2/:annotation_type/projects/:project_name/reloadstatus

Get the reload status of refreshing/reloading a project.

Path Parameters

NameTypeDescription

project_name*

string

Project name

annotation_type*

string

Type of annotation

{
    "message": 1,
    "file_system_status": 0,
    "file_system_message": "DID_NOT_INITIATED"
}

Get the status of importing a project configuration file

GET http://localhost:{port}/v2/:annotation_type/projects/importstatus

Check the status of importing a project configuration file.

Path Parameters

NameTypeDescription

annotation_type*

string

Type of annotation

{
    "message": 0,
    "error_message": ""
}

Get the status of exporting a project

GET http://localhost:{port}/v2/:annotation_type/projects/exportstatus

To check the export status of a project. Should be called after calling export api

Path Parameters

NameTypeDescription

annotation_type*

string

Type of annotation

{
    "message": 1,
    "export_status": 0,
    "export_status_message": "EXPORT_NOT_INITIATED"
}

Get the statistics of a project

GET http://localhost:{port}/v2/:annotation_type/projects/:project_name/statistic

To get the number of labeled images, the number of unlabeled images, and the number of labels per class in a project

Path Parameters

NameTypeDescription

project_name*

string

Name of project

annotation_type*

string

Type of annotation

{
    "message":1,
    "labeled_image":1,
    "unlabeled_image":23,
    "label_per_class_in_project":[
        {"label":"lorry","count":0},
        {"label":"bus","count":0},
        {"label":"van","count":1},
        {"label":"car","count":1},
        {"label":"truck","count":0}
    ]
}

Get the add images status of a project

GET http://localhost:{port} /v2/:annotation_type/projects/:project_name/addstatus

To get the status of added images to a project

Path Parameters

NameTypeDescription

annotation_type*

String

Type of annotation

project_name*

String

Project name

{
    "message" : 1,
    "add_image_status" : 0,
    "add_image_message" : "IMAGE_ADDED"
}

Toggle the starring status of a project

PUT http://localhost:{port}/:annotation_type/projects/:project_name/star

Toggle the starring status of a project to be on or off.

Path Parameters

NameTypeDescription

project_name*

string

Project name

annotation_type*

string

Type of annotation

Request Body

NameTypeDescription

status

string

Status of the starring of a project Only accept "true" and "false"

{
    "message": 1
}

Select a label text file

PUT http://localhost:{port}/v2/labelfiles

Select and load a label text file.

Path Parameters

NameTypeDescription

string

{
    "message": 1
}

Select a project folder

PUT http://localhost:{port}/v2/folders

Select a folder for a new project.

Path Parameters

NameTypeDescription

string

{
    "message": 1
}

Create a new project

PUT http://localhost:{port}/v2/projects

Create a new project name with preferred options

Request Body

NameTypeDescription

status

string

Options of new project: "raw" for creating project from scratch, "config" for importing project from json file

project_name

string

New project name

annotation_type

string

Type of annotation

project_path

string

Absolute path of a folder with data

label_file_path

string

Absolute path of a label file

{
    "message": 1
}

Export project

PUT http://localhost:{port}/v2/:annotation_type/projects/:project_name/export/:export_type

Export project into either a configuration file or zipped file (configuration file with data points). Will only start export process. Get the status of project by calling export status api.

Path Parameters

NameTypeDescription

export_type*

string

Type of export file Parameter : "cfg": for config files only "cfgdata": for config files with data

project_name*

string

Project name

annotation_type*

string

Type of annotation

{
    "message" : 1,
}

Rename an existing project to a new unique project name

PUT http://localhost:{port}/v2/:annotation_type/projects/:project_name/rename/:new_project_name

Rename an existing project to a new unique project name.

Path Parameters

NameTypeDescription

new_project_name*

string

New project name

project_name*

string

Project name

annotation_type*

string

Type of annotation

{
    "message" : 1
}

Close a project

PUT http://localhost:{port}/projects/:project_name

Indicate the closing state of a project.

Path Parameters

NameTypeDescription

project_name*

string

Project name

Request Body

NameTypeDescription

status

string

State of the project as "closed" Example: { "status": "closed"}

{
    "message": 1
}

Rename project data

PUT http://localhost:{port}/v2/:annotation_type/projects/:project_name/imgsrc/rename

Rename data points of a project. Used inside project workspace. API requires a json body.

Path Parameters

NameTypeDescription

project_name*

string

Name of current project to rename data

annotation_type*

string

Type of annotation

Request Body

NameTypeDescription

new_fname

string

New data filename to change

uuid

string

uuid of data

Add images to project

PUT http://localhost:{port}/v2/:annotation_type/projects/:project_name/add

Add selected images from source folder to project folder

Path Parameters

NameTypeDescription

annotation_type*

String

Type of annotation

project_name*

String

Project name

{
    "message" : 1
}

Delete project data

DELETE http://localhost:{port}/v2/:annotation_type/projects/:project_name/uuids

Deleting data from project. Will modify the data points in the root folder. When performing deletion, data is placed in a deleted folder.

Path Parameters

NameTypeDescription

project_name*

string

Name of current project

annotation_type*

string

Type of annotation

Request Body

NameTypeDescription

img_path_list

array

Array of strings of data path.

uuid_list

array

Array of strings of uuid of data. Does not support multiple delete for now.

// For success process
{
  "message" : 1,
  "uuid_list" : [ "4930331f-46b0-429e-8e02-9c03660261b1", "7fa70a42-ce16-4dfe-a880-f5d7e0ac5232", "dc584803-caad-407c-89c0-48e633b306f4", "404d61b5-6a39-49d1-8975-d02bca7f1b0f", "64389e29-8c17-47e6-b28a-ebbf4e902e23", "b0f25f5f-c922-4c2b-b418-84ed351c0d94" ]
}

// For failed process
{
  "message" : 0,
  "error_code" : 1, // For user defined error
  "error_message": "Message to explain error"
}

Last updated