-
Benefits
- Create a function from a trigger and language-specific template.
- Run the function locally.
- Publish the project to Azure.
-
Create virtual enviroment
virtualenv venv
- Activate
source ./venv/bin/activate
- Install dependencies
pip3 install -r requirements.txt
- Run server locally
func host start
[GET] http://localhost:7071/api/draw
- Params
- single: Image with a face
- multiple: Image with a face or multiple
http://localhost:7071/api/draw?single=https://i.ibb.co/yVxyc09/ibai.jpg&multiple=https://i.ibb.co/2jG2VLm/ibai-friends.jpg
[POST] http://localhost:7071/api/similar
- Body
- single: Image with a face
- multiple: Image with a face or multiple
{
"single": "https://i.ibb.co/yVxyc09/ibai.jpg",
"multiple": "https://i.ibb.co/2jG2VLm/ibai-friends.jpg"
}
curl -d '{"single": "https://i.ibb.co/yVxyc09/ibai.jpg","multiple": "https://i.ibb.co/2jG2VLm/ibai-friends.jpg"}' -H "Content-Type: application/json" -X POST http://localhost:7071/api/similar
{
"similar": true,
"message": "Similar Faces",
"facesNumber": {
"single": 1,
"multiple": 3
},
"drawUrl": "http://localhost:7071/api/draw?single=https://i.ibb.co/yVxyc09/ibai.jpg&multiple=https://i.ibb.co/2jG2VLm/ibai-friends.jpg"
}
{
"similar": false,
"message": "No similar faces found image.jpg",
"facesNumber": {
"single": 1,
"multiple": 1
},
"drawUrl": ""
}