Temporary Documentation
POST api/auth/login
Name | Type | Description |
---|---|---|
username | String | User's email |
password | String | User's password |
{
username: "user2",
password: "password2"
}
{
username: "user2",
id: 2,
token: "tokenStringGoesHere"
}
HTTP 401
{
message: "Invalid credentials"
}
POST api/auth/register
{
username: "user2",
password: "password2"
}
Name | Type | Description |
---|---|---|
username | String | User's email |
password | String | User's password |
{
"username": "user2",
"id": 2
}
HTTP 400
{
"message": "Please enter username and password"
}
HTTP 500
{
"message": "Internal error when adding a new user."
}
GET /api/analysis
Name | Type | Description |
---|---|---|
token | String | Token in authorization headers |
Note that the token payload already includes metadata of the user, there is no need to have a body.
[
{
faces_source:
"http://picmetric3.s3.amazonaws.com/93cc62cb0b79f774037c6980052d60f1_faces.png",
hash: "07020d585b1e4fec65838eb462f58562",
original:
"http://picmetric3.s3.amazonaws.com/07020d585b1e4fec65838eb462f58562.png",
resnet:
'{"sunglasses": "0.6676245", "sunglass": "0.3276029", "bolo_tie": "0.00093378656"}',
yolov3: '{"person": "99.90501403808594"}',
yolov3_source:
"http://picmetric3.s3.amazonaws.com/93cc62cb0b79f774037c6980052d60f1_yolov3.png"
},
{
faces_source:
"http://picmetric3.s3.amazonaws.com/93cc62cb0b79f774037c6980052d60f1_faces.png",
hash: "07020d585b1e4fec65838eb462f58562",
original:
"http://picmetric3.s3.amazonaws.com/07020d585b1e4fec65838eb462f58562.png",
resnet:
'{"sunglasses": "0.6676245", "sunglass": "0.3276029", "bolo_tie": "0.00093378656"}',
yolov3: '{"person": "99.90501403808594"}',
yolov3_source:
"http://picmetric3.s3.amazonaws.com/93cc62cb0b79f774037c6980052d60f1_yolov3.png"
},
{
faces_source:
"http://picmetric3.s3.amazonaws.com/93cc62cb0b79f774037c6980052d60f1_faces.png",
hash: "07020d585b1e4fec65838eb462f58562",
original:
"http://picmetric3.s3.amazonaws.com/07020d585b1e4fec65838eb462f58562.png",
resnet:
'{"sunglasses": "0.6676245", "sunglass": "0.3276029", "bolo_tie": "0.00093378656"}',
yolov3: '{"person": "99.90501403808594"}',
yolov3_source:
"http://picmetric3.s3.amazonaws.com/93cc62cb0b79f774037c6980052d60f1_yolov3.png"
}
];
POST /api/analysis
{
"error": "",
"faces_source": "http://picmetric3.s3.amazonaws.com/93cc62cb0b79f774037c6980052d60f1_faces.png",
"hash": "07020d585b1e4fec65838eb462f58562",
"original": "http://picmetric3.s3.amazonaws.com/07020d585b1e4fec65838eb462f58562.png",
"resnet": "{\"sunglasses\": \"0.6676245\", \"sunglass\": \"0.3276029\", \"bolo_tie\": \"0.00093378656\"}",
"yolov3": "{\"person\": \"99.90501403808594\"}",
"yolov3_source": "http://picmetric3.s3.amazonaws.com/93cc62cb0b79f774037c6980052d60f1_yolov3.png"
}
These parameters will continue to evolve depending on the DS's API. It will always try to match what the DS API outputs to keep things simple.
Name | Type | Required | Description |
---|---|---|---|
token | String | Yes | Token in authorization headers |
error | any | No | Backend will abort any requests with an error field |
source | String | Yes | Source URL of the image |
hash | String | Yes | Hash of the saved image |
resnet | String | No | String output of resnet's analyis |
yolov3 | String | No | String output of yolov3's analysis |
HTTP 201
{
"user_id": 1,
"analysis_id": 1,
"hash": "7844c0f891907246c067202b9631f989",
"resnet": "{'bulletproof_vest': 0.22700253, 'gasmask': 0.19664158, 'assault_rifle': 0.1390793}",
"source": "https://i.redd.it/asnxp0mahfz31.jpg"
}
DELETE /api/analysis
Name | Type | Required | Description |
---|---|---|---|
id | integer | Yes | ID of the analysis, user_id is already included in the token |
token | string | Yes | Token must be included in authorization headers |
HTTP DEL
{
id: 1
}
HTTP 200
{
message: "Success"
}
HTTP 500
{
message: "Internal error when deleting analysis"
}
GET /do_data_science/
Query string: url : "URLofImageGoesHere"
POST /do_data-science/
content-type: 'multipart/form-data'
Image must be under property file
in multiparty form object.