Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
SthPhoenix committed Feb 18, 2020
1 parent b9e959c commit d952074
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,18 @@ Currently this repository contains Dockerfiles for CPU inference.


## Usage:
### `/extract` endpoint

API accept requests in JSON in following format:
Extract endpoint accepts list of images and return faces bounding boxes with corresponding
embeddings.

API accept JSON in following format:
```
{
"images":{
"data":[
base64_encoded_image1, base64_encoded_image2
base64_encoded_image1,
base64_encoded_image2
]
},
"max_size":640
Expand Down Expand Up @@ -56,7 +61,7 @@ def file2base64(path):
def extract_vecs(ims,max_size=640):
target = [file2base64(im) for im in ims]
req = {"images": {"data": target},"max_size":max_size}
resp = requests.post('http://localhost:6000/extract', json=req)
resp = requests.post('http://localhost:18080/extract', json=req)
data = resp.json()
return data

Expand Down Expand Up @@ -87,17 +92,18 @@ dictionary containing face embedding, bounding box, detection probability and de
1. Clone repo
2. Download model **LResNet100E-IR,ArcFace@ms1m-refine-v2** from
DeepInsight [Model Zoo](https://github.com/deepinsight/insightface/wiki/Model-Zoo)
([dropbox](https://www.dropbox.com/s/tj96fsm6t6rq8ye/model-r100-arcface-ms1m-refine-v2.zip?dl=0))
([dropbox](https://www.dropbox.com/s/tj96fsm6t6rq8ye/model-r100-arcface-ms1m-refine-v2.zip?dl=0)).
3. Unzip downloaded model to `src/api/models`
> You can use script `load_model.sh` to automatically download and unzip model to proper location.
2. Run `src/api/app.py`

## Run with Docker:

1. Follow steps 1-3 from above.
2. Execute `build.sh` from `docker_tf_opencv` folder to build base image
`tensorflow-opencv:preconf`
3. Execute `deploy.sh` from repo root folder to build and start `insightface-rest:v0.1` image
3. Execute `deploy.sh` from repo root folder to build and start `insightface-rest:v0.1.2` image


## Known issues:
1. Docker container requires at least 4GB RAM (MTCNN uses lots of RAM)
1. Docker container requires at least 2.2GB RAM (MTCNN uses lots of RAM)

0 comments on commit d952074

Please sign in to comment.