-
Notifications
You must be signed in to change notification settings - Fork 0
03. API
dragarcia edited this page May 11, 2020
·
3 revisions
Our API can be accessed through http://localhost:8000.
- Saves the image in the database
- Runs it against the YOLO model
- Saves information on the bounding boxes in the database as well.
http://localhost:8000/image/new
Takes in a multipart form including an image file.
http://localhost:8000/image/get
Returns an array of Image objects. If there are any bounding boxes linked to the image, it will be returned as well within the image.
{
[
'id': '123',
'file': 'static/images/123.jpg',
'height': '300.0',
'width': '400.0',
'boxes': [
'id': 1,
'x': 0.1,
'y': 0.2,
'height': 0.5,
'width': 0.2,
'label': 'cat'
'probability': 0.99
]
]
}
Filters can be applied through query parameters. Valid filters would be any of the following:
id
file
height
width
A sample would be:
http://localhost:8000/image/get?id=123
http://localhost:8000/box/update
Takes in an array of Box objects and updates the boxes linked to the respective image.