From a7c2a9f76b602c3563d1d22d020635bbed40c55e Mon Sep 17 00:00:00 2001 From: Sefik Ilkin Serengil Date: Sat, 17 Aug 2024 10:09:27 +0100 Subject: [PATCH] bug while showing the recognized face when source image has more than one face sorted --- deepface/modules/streaming.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/deepface/modules/streaming.py b/deepface/modules/streaming.py index bd77ce10c..6edbc270f 100644 --- a/deepface/modules/streaming.py +++ b/deepface/modules/streaming.py @@ -2,6 +2,7 @@ import os import time from typing import List, Tuple, Optional +import traceback # 3rd party dependencies import numpy as np @@ -253,6 +254,7 @@ def search_identity( target_img = target_img[:, :, ::-1] else: target_img = cv2.imread(target_path) + target_img = cv2.resize(target_img, (IDENTIFIED_IMG_SIZE, IDENTIFIED_IMG_SIZE)) return target_path.split("/")[-1], target_img @@ -769,7 +771,7 @@ def overlay_identified_face( else: logger.info("cannot put facial recognition info on the image") except Exception as err: # pylint: disable=broad-except - logger.error(str(err)) + logger.error(f"{str(err)} - {traceback.format_exc()}") return img