diff --git a/api/api.py b/api/api.py index a907fb2..838346d 100644 --- a/api/api.py +++ b/api/api.py @@ -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}) diff --git a/scripts/dockerize.sh b/scripts/dockerize.sh index adb79ae..a54af01 100644 --- a/scripts/dockerize.sh +++ b/scripts/dockerize.sh @@ -10,11 +10,14 @@ # build deepface image docker build -t deepface_image . +# copy weights from your local +# docker cp ~/.deepface/weights/. :/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 /bin/sh # healthcheck # sleep 3s