-
Notifications
You must be signed in to change notification settings - Fork 458
REST API
Justin Brooks edited this page Oct 28, 2018
·
7 revisions
The COCO Annotator API is organized around REST. The API has predictable, resource-oriented URLs, and uses HTTP response codes to indicate API errors. JSON is returned by all API responses, including errors.
A swagger interface can be found at localhost:5000/api
which lists each endpoint and allows you to call it from your web browser.
- Image
- Annotation
- Category
- Annotator
- Dataset
- Undo
Returns all images in the database.
None
Request:
curl -X GET "http://localhost:5000/api/image/"
Response:
[]
Returns an image with the provided ID. Image ID's are sequentially generated when the image object is created in the database.
Augment | Required | Type | Default | Location | Description |
---|---|---|---|---|---|
asAttachment | false |
Boolean | true |
URL paramter | Sends the image file with a Content-Disposition: attachment header |
width | false |
Integer | Image Width | URL paramter | Returns image with provided width (Maintains aspect ratio) |
height | false |
Integer | Image Height | URL paramter | Returns image with provided height (Maintains aspect ratio) |
Request:
curl -X GET "http://localhost:5000/api/image/1?asAttachment=true"
Response:
Binary Output