perform resize in a common point

This commit is contained in:
Sefik Ilkin Serengil 2024-08-17 10:13:29 +01:00
parent a7c2a9f76b
commit cc99de6e76

View File

@ -249,11 +249,12 @@ 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)) 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