mirror of
https://github.com/serengil/deepface.git
synced 2025-06-07 20:15:21 +00:00
if detector is skipped, then resizing is missing in representation
This commit is contained in:
parent
fc3f607bf4
commit
ea43de9baa
@ -639,28 +639,16 @@ def represent(
|
|||||||
model = build_model(model_name)
|
model = build_model(model_name)
|
||||||
|
|
||||||
# ---------------------------------
|
# ---------------------------------
|
||||||
# we have run pre-process in verification. so, this can be skipped if it is coming from verify.
|
target_size = functions.find_target_size(model_name=model_name)
|
||||||
if detector_backend != "skip":
|
|
||||||
target_size = functions.find_target_size(model_name=model_name)
|
|
||||||
|
|
||||||
img_objs = functions.extract_faces(
|
img_objs = functions.extract_faces(
|
||||||
img=img_path,
|
img=img_path,
|
||||||
target_size=target_size,
|
target_size=target_size,
|
||||||
detector_backend=detector_backend,
|
detector_backend=detector_backend,
|
||||||
grayscale=False,
|
grayscale=False,
|
||||||
enforce_detection=enforce_detection,
|
enforce_detection=enforce_detection,
|
||||||
align=align,
|
align=align,
|
||||||
)
|
)
|
||||||
else: # skip
|
|
||||||
if isinstance(img_path, str):
|
|
||||||
img = functions.load_image(img_path)
|
|
||||||
elif type(img_path).__module__ == np.__name__:
|
|
||||||
img = img_path.copy()
|
|
||||||
else:
|
|
||||||
raise ValueError(f"unexpected type for img_path - {type(img_path)}")
|
|
||||||
|
|
||||||
img_region = [0, 0, img.shape[1], img.shape[0]]
|
|
||||||
img_objs = [(img, img_region, 0)]
|
|
||||||
# ---------------------------------
|
# ---------------------------------
|
||||||
|
|
||||||
for img, region, _ in img_objs:
|
for img, region, _ in img_objs:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user