From 7b0500a17d09567e622253317b12d51df9ef138b Mon Sep 17 00:00:00 2001 From: Andrea Lanfranchi Date: Thu, 22 Feb 2024 14:32:16 +0100 Subject: [PATCH] Compute toc only if needed --- deepface/modules/recognition.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/deepface/modules/recognition.py b/deepface/modules/recognition.py index 5c7f6b6..3b83558 100644 --- a/deepface/modules/recognition.py +++ b/deepface/modules/recognition.py @@ -172,8 +172,8 @@ def find( # Should we have no representations bailout if len(representations) == 0: - toc = time.time() if not silent: + toc = time.time() logger.info(f"find function duration {toc - tic} seconds") return [] @@ -266,9 +266,8 @@ def find( # ----------------------------------- - toc = time.time() - if not silent: + toc = time.time() logger.info(f"find function duration {toc - tic} seconds") return resp_obj