bug for analyze in api

This commit is contained in:
Sefik Ilkin Serengil 2023-01-09 12:43:29 +00:00
parent 352da73830
commit ba3db18671
2 changed files with 15 additions and 4 deletions

View File

@ -66,10 +66,18 @@ def analyze():
toc = time.time()
resp_obj["trx_id"] = trx_id
resp_obj["seconds"] = toc-tic
resp = {}
return resp_obj, 200
resp["trx_id"] = trx_id
resp["seconds"] = toc-tic
if isinstance(resp_obj, list):
for idx, instance in enumerate(resp_obj):
resp[f"instance_{idx+1}"] = instance
elif isinstance(resp_obj, dict):
resp["instance_1"] = resp_obj
return resp, 200
def analyzeWrapper(req, trx_id = 0):
resp_obj = jsonify({'success': False})

View File

@ -10,11 +10,14 @@
# build deepface image
docker build -t deepface_image .
# copy weights from your local
# docker cp ~/.deepface/weights/. <CONTAINER_ID>:/root/.deepface/weights/
# run image
docker run --net="host" deepface
# to access the inside of docker image when it is in running status
# docker run -it --net="host" deepface /bin/sh
# docker exec -it <CONTAINER_ID> /bin/sh
# healthcheck
# sleep 3s