mirror of
https://github.com/serengil/deepface.git
synced 2025-06-07 12:05:22 +00:00
Merge pull request #1311 from serengil/feat-task-1708-stream-overlay-bug-for-crowded-photo
Feat task 1708 stream overlay bug for crowded photo
This commit is contained in:
commit
b447cc4add
@ -1 +1 @@
|
|||||||
__version__ = "0.0.93"
|
__version__ = "0.0.94"
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
import os
|
import os
|
||||||
import time
|
import time
|
||||||
from typing import List, Tuple, Optional
|
from typing import List, Tuple, Optional
|
||||||
|
import traceback
|
||||||
|
|
||||||
# 3rd party dependencies
|
# 3rd party dependencies
|
||||||
import numpy as np
|
import numpy as np
|
||||||
@ -248,12 +249,14 @@ def search_identity(
|
|||||||
# extract 1st item directly
|
# extract 1st item directly
|
||||||
target_obj = target_objs[0]
|
target_obj = target_objs[0]
|
||||||
target_img = target_obj["face"]
|
target_img = target_obj["face"]
|
||||||
target_img = cv2.resize(target_img, (IDENTIFIED_IMG_SIZE, IDENTIFIED_IMG_SIZE))
|
|
||||||
target_img *= 255
|
target_img *= 255
|
||||||
target_img = target_img[:, :, ::-1]
|
target_img = target_img[:, :, ::-1]
|
||||||
else:
|
else:
|
||||||
target_img = cv2.imread(target_path)
|
target_img = cv2.imread(target_path)
|
||||||
|
|
||||||
|
# resize anyway
|
||||||
|
target_img = cv2.resize(target_img, (IDENTIFIED_IMG_SIZE, IDENTIFIED_IMG_SIZE))
|
||||||
|
|
||||||
return target_path.split("/")[-1], target_img
|
return target_path.split("/")[-1], target_img
|
||||||
|
|
||||||
|
|
||||||
@ -769,7 +772,7 @@ def overlay_identified_face(
|
|||||||
else:
|
else:
|
||||||
logger.info("cannot put facial recognition info on the image")
|
logger.info("cannot put facial recognition info on the image")
|
||||||
except Exception as err: # pylint: disable=broad-except
|
except Exception as err: # pylint: disable=broad-except
|
||||||
logger.error(str(err))
|
logger.error(f"{str(err)} - {traceback.format_exc()}")
|
||||||
return img
|
return img
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
{
|
{
|
||||||
"version": "0.0.93"
|
"version": "0.0.94"
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user