Skip to content

Latest commit

 

History

History
928 lines (804 loc) · 24.9 KB

File metadata and controls

928 lines (804 loc) · 24.9 KB
description
V2 REST API References for Image Annotation (Bounding Box / Segmentation)

REST API V2

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
PUT /:annotation_type/projects/:project_name/star Toggle the starring status of a project
PUT /v2/newproject Import a project with configuration file
PUT /v2/labelfiles Select a label text file
PUT /v2/folders Select a project folder
PUT /v2/projects Create a new project
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

{% hint style="info" %} :annotation_type accepts the following parameter

  • bndbox
    • Example: /bndbox/projects/helloworld
  • seg .
    • Example: /seg/projects/helloworld

for the corresponding image annotation techniques. {% endhint %}

API Detailed Walkthrough

{% api-method method="get" host="http://localhost:{port}" path="/v2/labelfiles" %} {% api-method-summary %} Get the loading status when selecting a label file {% endapi-method-summary %}

{% api-method-description %} Get the loading status when selecting a label file {% endapi-method-description %}

{% api-method-spec %} {% api-method-request %} {% api-method-path-parameters %} {% api-method-parameter name="" type="string" required=false %}

{% endapi-method-parameter %} {% endapi-method-path-parameters %} {% endapi-method-request %}

{% api-method-response %} {% api-method-response-example httpCode=200 %} {% api-method-response-example-description %} - message : integer (1 for success)
- window_status : integer
- window_status = 0 (window open)
- window_status = 1(window close)
- window_message : string
- label_file_path : string (Empty string when label file not selected) {% endapi-method-response-example-description %}

{% tabs %} {% tab title="message = 1 (window_status = 0)" %}

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

{% endtab %}

{% tab title="message = 1 (window_status = 1)" %}

{
    "message": 1,
    "window_status": 1,
    "window_message": "WINDOW_CLOSE",
    "label_file_path": "/Users/johndoe/Downloads/man_label.txt"
}

{% endtab %} {% endtabs %} {% endapi-method-response-example %} {% endapi-method-response %} {% endapi-method-spec %} {% endapi-method %}

{% api-method method="get" host="http://localhost:{port}" path="/v2/folders" %} {% api-method-summary %} Get the folder status when selecting a project folder {% endapi-method-summary %}

{% api-method-description %} Get the folder status when selecting a project folder. {% endapi-method-description %}

{% api-method-spec %} {% api-method-request %} {% api-method-path-parameters %} {% api-method-parameter name="" type="string" required=false %}

{% endapi-method-parameter %} {% endapi-method-path-parameters %} {% endapi-method-request %}

{% api-method-response %} {% api-method-response-example httpCode=200 %} {% api-method-response-example-description %} - message : integer (1 for success)
- window_status : string
- window_status = 0 (window open)
**- window_status = 1 (**window close)
- window_message : string
- project_path : string (Empty string when no project path is selected) {% endapi-method-response-example-description %}

{% tabs %} {% tab title="message = 1 (window_status = 0)" %}

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

{% endtab %}

{% tab title="message = 1 (window_status = 1)" %}

{
    "message": 1,
    "window_status": 1,
    "window_message": "WINDOW_CLOSE",
    "project_path": "/Users/johndoe/Desktop/temp"
}

{% endtab %} {% endtabs %} {% endapi-method-response-example %} {% endapi-method-response %} {% endapi-method-spec %} {% endapi-method %}

{% api-method method="get" host="http://localhost:{port}" path="/v2/:annotation_type/projects/:project_name" %} {% api-method-summary %} Get the status of creating a project {% endapi-method-summary %}

{% api-method-description %} Get the status of creating a project. {% endapi-method-description %}

{% api-method-spec %} {% api-method-request %} {% api-method-path-parameters %} {% api-method-parameter name="project_name" type="string" required=true %} Project name {% endapi-method-parameter %} {% endapi-method-path-parameters %} {% endapi-method-request %}

{% api-method-response %} {% api-method-response-example httpCode=200 %} {% api-method-response-example-description %} - message : integer (1 for success)
- file_system_status : integer
The category of create project status is displayed with returning integer of file_system_status
- file_system_status = 0 (Not initiated)
- file_system_status = 1 (Iterating folder)
- file_system_status = 2 (Updating database)
- file_system_status = 3 (Database updated)
- file_system_message : string {% endapi-method-response-example-description %}

{% tabs %} {% tab title="message = 1 (file_system_status = 1)" %}

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

{% endtab %}

{% tab title="message = 1 (file_system_status = 2)" %}

{
    "message": 1,
    "file_system_status": 2,
    "file_system_message": "DATABASE_UPDATING"
}

{% endtab %}

{% tab title="message = 1 (file_system_status = 3)" %}

{
    "message": 1,
    "file_system_status": 3,
    "file_system_message": "DATABASE_UPDATED",
    "unsupported_image_list" : [ "C:\\Users\\yinch\\Pictures\\image_fail_display\\2.jpg"]
}

{% endtab %} {% endtabs %} {% endapi-method-response-example %} {% endapi-method-response %} {% endapi-method-spec %} {% endapi-method %}

{% api-method method="get" host="http://localhost:{port}" path="/v2/:annotation_type/projects/:project_name/reloadstatus" %} {% api-method-summary %} Get the reload status on refreshing/reloading a project. {% endapi-method-summary %}

{% api-method-description %} Get the reload status of refreshing/reloading a project. {% endapi-method-description %}

{% api-method-spec %} {% api-method-request %} {% api-method-path-parameters %} {% api-method-parameter name="project_name" type="string" required=true %} Project name {% endapi-method-parameter %} {% endapi-method-path-parameters %} {% endapi-method-request %}

{% api-method-response %} {% api-method-response-example httpCode=200 %} {% api-method-response-example-description %} - message : integer (1 for loading, 4 successfully loaded )
- file_system_status : integer
The category of reload status is displayed in the returning integer of file_system_status
- file_system_status = 0 (Not initiated)
- file_system_status = 1 (Loading and iterating folder)
- file_system_status = 2 (Loading and database is updating) ****
- file_system_status = 3 (Loaded and dababase is updated)
- file_system_message : string
- uuid_add_list : list of string
- uuid_delete_list : list of string {% endapi-method-response-example-description %}

{% tabs %} {% tab title="message = 1 (file_system_status = 0)" %}

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

{% endtab %}

{% tab title="message = 1 (file_system_status = 1)" %}

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

{% endtab %}

{% tab title="message = 1 (file_system_status = 2)" %}

{
    "message": 1,
    "file_system_status": 2,
    "file_system_message": "DATABASE_UPDATING"
}

{% endtab %}

{% tab title="message = 1 (file_system_status = 3)" %}

{
    "message": 1,
    "file_system_status": 3,
    "file_system_message": "DATABASE_UPDATED",
    "uuid_add_list": [
        "7d695dcd-26c9-4da0-8b33-f772ffb1b7eb",
        "5c2cc14a-ac5a-4b7c-a445-df3cc0e6bd98"
    ],
    "uuid_delete_list": [],
    "unsupported_image_list" : [ "C:\\Users\\user\\Pictures\\image_fail_display\\2.jpg"]
}

{% endtab %} {% endtabs %} {% endapi-method-response-example %} {% endapi-method-response %} {% endapi-method-spec %} {% endapi-method %}

{% api-method method="get" host="http://localhost:{port}" path="/v2/:annotation_type/projects/importstatus" %} {% api-method-summary %} Get the status of importing a project configuration file {% endapi-method-summary %}

{% api-method-description %} Check the status of importing a project configuration file. {% endapi-method-description %}

{% api-method-spec %} {% api-method-request %} {% api-method-path-parameters %} {% api-method-parameter name="" type="string" required=false %}

{% endapi-method-parameter %} {% endapi-method-path-parameters %} {% endapi-method-request %}

{% api-method-response %} {% api-method-response-example httpCode=200 %} {% api-method-response-example-description %} - message : integer (0 for import window open/import in progress, 1 for success)
- file_system_status : integer
The category of import status is displayed in the returning integer of file_system_status
- file_system_status = 0 (Did not initiated)
- file_system_status = 1 (Iterating folder)
- file_system_status = 2 (Updating database)
- file_system_status = 3 (Database updated)
- file_system_status = 4 (Files is successfully imported)
- file_system_status = 5 (Process is aborted)
- file_system_message : string
- error_message : string {% endapi-method-response-example-description %}

{% tabs %} {% tab title="message = 0" %}

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

{% endtab %}

{% tab title="message = 1 (file_system_status = 0)" %}

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

{% endtab %}

{% tab title="message = 1 (file_system_status = 1)" %}

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

{% endtab %}

{% tab title="message = 1 (file_system_status = 2)" %}

{
    "message": 1,
    "file_system_status": 2,
    "file_system_message": "DATABASE_UPDATING"
}

{% endtab %}

{% tab title="message = 1 (file_system_status = 3)" %}

{
    "message": 1,
    "file_system_status": 3,
    "file_system_message": "DATABASE_UPDATED"
    "project_name": "awesome_wonderwoman"
}

{% endtab %}

{% tab title="message = 4 (success)" %}

{
  "message" : 4,
  "error_message" : "\nName Overlapped. Rename as cute_thor.\nImport project success."
}

{% endtab %}

{% tab title="message = 5 (failure)" %}

{
    "message": 1,
    "file_system_status": 5,
    "file_system_message": "ABORTED"
}

{% endtab %} {% endtabs %} {% endapi-method-response-example %} {% endapi-method-response %} {% endapi-method-spec %} {% endapi-method %}

{% api-method method="get" host="http://localhost:{port}" path="/v2/:annotation_type/projects/exportstatus" %} {% api-method-summary %} Get the status of exporting a project {% endapi-method-summary %}

{% api-method-description %} To check the export status of a project. Should be called after calling export api {% endapi-method-description %}

{% api-method-spec %} {% api-method-request %} {% api-method-path-parameters %} {% api-method-parameter name="annotation_type" type="string" required=false %} Type of annotation {% endapi-method-parameter %} {% endapi-method-path-parameters %} {% endapi-method-request %}

{% api-method-response %} {% api-method-response-example httpCode=200 %} {% api-method-response-example-description %} - message: integer (1 for success, 0 for failure)
- export_status: integer(0 for Export not initiated, 1 for Export Starting, 2 for Export Success, 3 for Export fail)
- export_status_message: string("EXPORT_NOT_INITIATED", "EXPORT_STARTING", "EXPORT_SUCCESS", "EXPORT_FAIL")

When EXPORT_SUCCESS, api will return result of exported project path
- project_config_path: "path/to/config/file" {% endapi-method-response-example-description %}

{% tabs %} {% tab title="EXPORT_NOT_INITIATED" %}

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

{% endtab %}

{% tab title="EXPORT_STARTING" %}

{
    "message": 1,
    "export_status": 1,
    "export_status_message": "EXPORT_STARTING"
}

{% endtab %}

{% tab title="EXPORT_SUCCESS" %}

{
    "message": 1,
    "export_status": 2,
    "export_status_message": "EXPORT_SUCCESS",
    "project_config_path": "path/to/config/file"
}

{% endtab %}

{% tab title="EXPORT_FAIL" %}

{
    "message": 1,
    "export_status": 3,
    "export_status_message": "EXPORT_FAIL"
}

{% endtab %} {% endtabs %} {% endapi-method-response-example %} {% endapi-method-response %} {% endapi-method-spec %} {% endapi-method %}

{% api-method method="put" host="http://localhost:{port}" path="/:annotation_type/projects/:project_name/star" %} {% api-method-summary %} Toggle the starring status of a project {% endapi-method-summary %}

{% api-method-description %} Toggle the starring status of a project to be on or off. {% endapi-method-description %}

{% api-method-spec %} {% api-method-request %} {% api-method-path-parameters %} {% api-method-parameter name="project_name" type="string" required=true %} Project name {% endapi-method-parameter %} {% endapi-method-path-parameters %}

{% api-method-body-parameters %} {% api-method-parameter name="status" type="string" required=true %} Status of the starring of a project
Only accept "true" and "false" {% endapi-method-parameter %} {% endapi-method-body-parameters %} {% endapi-method-request %}

{% api-method-response %} {% api-method-response-example httpCode=200 %} {% api-method-response-example-description %} - message: integer (1 for success, 0 for failure)

if failure occurs,
- error_code: integer
- error_message: string {% endapi-method-response-example-description %}

{% tabs %} {% tab title="success" %}

{
    "message": 1
}

{% endtab %}

{% tab title="failure (error_code = 1)" %}

{ 
    "message": 0,
    "error_code": 1,
    "error_message": "Starring object value is not boolean. Failed to execute"
}

{% endtab %} {% endtabs %} {% endapi-method-response-example %} {% endapi-method-response %} {% endapi-method-spec %} {% endapi-method %}

{% api-method method="put" host="http://localhost:{port}" path="/v2/newproject" %} {% api-method-summary %} Import a project with configuration file {% endapi-method-summary %}

{% api-method-description %} Import and load a configuration file correspond to a project. {% endapi-method-description %}

{% api-method-spec %} {% api-method-request %} {% api-method-path-parameters %} {% api-method-parameter name="" type="string" required=false %}

{% endapi-method-parameter %} {% endapi-method-path-parameters %} {% endapi-method-request %}

{% api-method-response %} {% api-method-response-example httpCode=200 %} {% api-method-response-example-description %} - message : integer (1 for success, 0 for failure)

if failure occure (message = 0)
- error_code : integer
- error_message : string {% endapi-method-response-example-description %}

{% tabs %} {% tab title="success" %}

{
    "message": 1
}

{% endtab %}

{% tab title="failure (error_code = 1)" %}

{
    "message": 0,
    "error_code": 1,
    "error_message": "Import config file selector window has already opened. Close that to proceed."
}

{% endtab %} {% endtabs %} {% endapi-method-response-example %} {% endapi-method-response %} {% endapi-method-spec %} {% endapi-method %}

{% api-method method="put" host="http://localhost:{port}" path="/v2/labelfiles" %} {% api-method-summary %} Select a label text file {% endapi-method-summary %}

{% api-method-description %} Select and load a label text file. {% endapi-method-description %}

{% api-method-spec %} {% api-method-request %} {% api-method-path-parameters %} {% api-method-parameter name="" type="string" required=false %}

{% endapi-method-parameter %} {% endapi-method-path-parameters %} {% endapi-method-request %}

{% api-method-response %} {% api-method-response-example httpCode=200 %} {% api-method-response-example-description %} message : integer (1 for success) {% endapi-method-response-example-description %}

{% tabs %} {% tab title="success (message = 1)" %}

{
    "message": 1
}

{% endtab %} {% endtabs %} {% endapi-method-response-example %} {% endapi-method-response %} {% endapi-method-spec %} {% endapi-method %}

{% api-method method="put" host="http://localhost:{port}" path="/v2/folders" %} {% api-method-summary %} Select a project folder {% endapi-method-summary %}

{% api-method-description %} Select a folder for a new project. {% endapi-method-description %}

{% api-method-spec %} {% api-method-request %} {% api-method-path-parameters %} {% api-method-parameter name="" type="string" required=false %}

{% endapi-method-parameter %} {% endapi-method-path-parameters %} {% endapi-method-request %}

{% api-method-response %} {% api-method-response-example httpCode=200 %} {% api-method-response-example-description %} - message : integer (1 for success) {% endapi-method-response-example-description %}

{% tabs %} {% tab title="success (message = 1)" %}

{
    "message": 1
}

{% endtab %} {% endtabs %} {% endapi-method-response-example %} {% endapi-method-response %} {% endapi-method-spec %} {% endapi-method %}

{% api-method method="put" host="http://localhost:{port}" path="/v2/projects" %} {% api-method-summary %} Create a new project {% endapi-method-summary %}

{% api-method-description %} Create a new project name. {% endapi-method-description %}

{% api-method-spec %} {% api-method-request %} {% api-method-body-parameters %} {% api-method-parameter name="project_name" type="string" required=true %} New project name {% endapi-method-parameter %}

{% api-method-parameter name="annotation_type" type="string" required=true %} Type of annotation {% endapi-method-parameter %}

{% api-method-parameter name="project_path" type="string" required=true %} Absolute path of a folder with data {% endapi-method-parameter %}

{% api-method-parameter name="label_file_path" type="string" required=false %} Absolute path of a label file {% endapi-method-parameter %} {% endapi-method-body-parameters %} {% endapi-method-request %}

{% api-method-response %} {% api-method-response-example httpCode=200 %} {% api-method-response-example-description %} - message : integer (1 for success, 0 for failure)

if failure occur (message = 0)
- error_code : integer
- error_message : string {% endapi-method-response-example-description %}

{% tabs %} {% tab title="success" %}

{
    "message": 1
}

{% endtab %}

{% tab title="failure (error_code = 1)" %}

{
    "message": 0,
    "error_code": 1,
    "error_message": "Project name exist: :project_name."
}

{% endtab %} {% endtabs %} {% endapi-method-response-example %} {% endapi-method-response %} {% endapi-method-spec %} {% endapi-method %}

{% api-method method="put" host="http://localhost:{port}" path="/v2/:annotation_type/projects/:project_name/export/:export_type" %} {% api-method-summary %} Export project {% endapi-method-summary %}

{% api-method-description %} 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. {% endapi-method-description %}

{% api-method-spec %} {% api-method-request %} {% api-method-path-parameters %} {% api-method-parameter name="export_type" type="string" required=true %} Type of export file
Parameter :
"cfg": for config files only
"cfgdata": for config files with data {% endapi-method-parameter %}

{% api-method-parameter name="project_name" type="string" required=true %} Project name {% endapi-method-parameter %} {% endapi-method-path-parameters %} {% endapi-method-request %}

{% api-method-response %} {% api-method-response-example httpCode=200 %} {% api-method-response-example-description %} - message : integer (1 for success, 0 for failure)

if error occur (message = 0):
- error_code : integer
- error_message : string {% endapi-method-response-example-description %}

{% tabs %} {% tab title="success" %}

{
    "message" : 1,
}

{% endtab %}

{% tab title="failure (error_code = 1)" %}

{
    "message": 0,
    "error_code": 1,
    "error_message": "Export of project failed for :project_name"
}

{% endtab %} {% endtabs %} {% endapi-method-response-example %} {% endapi-method-response %} {% endapi-method-spec %} {% endapi-method %}

{% api-method method="put" host="http://localhost:{port}" path="/v2/:annotation_type/projects/:project_name/rename/:new_project_name" %} {% api-method-summary %} Rename an existing project to a new unique project name {% endapi-method-summary %}

{% api-method-description %} Rename an existing project to a new unique project name. {% endapi-method-description %}

{% api-method-spec %} {% api-method-request %} {% api-method-path-parameters %} {% api-method-parameter name="new_project_name" type="string" required=true %} New project name {% endapi-method-parameter %}

{% api-method-parameter name="project_name" type="string" required=true %} Project name {% endapi-method-parameter %} {% endapi-method-path-parameters %} {% endapi-method-request %}

{% api-method-response %} {% api-method-response-example httpCode=200 %} {% api-method-response-example-description %} message : integer (1 for success, 0 for failure)

if failure occur (message = 0)
- error_code : integer
- error_message : string {% endapi-method-response-example-description %}

{% tabs %} {% tab title="success" %}

{
    "message" : 1
}

{% endtab %}

{% tab title="failure (error_code = 1)" %}

{
    "message": 0,
    "error_code": 1,
    "error_message": "Failed to rename project :project_name"
}

{% endtab %} {% endtabs %} {% endapi-method-response-example %} {% endapi-method-response %} {% endapi-method-spec %} {% endapi-method %}

{% api-method method="put" host="http://localhost:{port}" path="/projects/:project_name" %} {% api-method-summary %} Close a project {% endapi-method-summary %}

{% api-method-description %} Indicate the closing state of a project. {% endapi-method-description %}

{% api-method-spec %} {% api-method-request %} {% api-method-path-parameters %} {% api-method-parameter name="project_name" type="string" required=true %} Project name {% endapi-method-parameter %} {% endapi-method-path-parameters %}

{% api-method-body-parameters %} {% api-method-parameter name="status" type="string" required=true %} State of the project as "closed"
Example:
{ "status": "closed"} {% endapi-method-parameter %} {% endapi-method-body-parameters %} {% endapi-method-request %}

{% api-method-response %} {% api-method-response-example httpCode=200 %} {% api-method-response-example-description %} - message: integer (1 for success, 0 for failure)

if failure occurs,
- error_code: integer
- error_message: string {% endapi-method-response-example-description %}

{% tabs %} {% tab title="success" %}

{
    "message": 1
}

{% endtab %}

{% tab title="failure (error_code = 1)" %}

{
    "message": 0,
    "error_code": 1,
    "error_message": "Request body not defined: io.vertx.core.json.DecodeException: Failed to decode:No content to map due to end-of-input\n at [Source: (io.netty.buffer.ByteBufInputStream); line: 1, column: 0"
}

{% endtab %}

{% tab title="failure (error_code = 2)" %}

{
    "message": 0,
    "error_code": 2,
    "error_message": "Request payload failed to satisfied the status of {\"status\": \"closed\"} for :project_name."
}Segmentation Annotation

{% endtab %} {% endtabs %} {% endapi-method-response-example %} {% endapi-method-response %} {% endapi-method-spec %} {% endapi-method %}