mirror of
https://github.com/serengil/deepface.git
synced 2025-06-07 03:55:21 +00:00
batch test assert shape
This commit is contained in:
parent
c30f55c380
commit
dc6cb81ec5
@ -180,6 +180,7 @@ def test_batch_extract_faces_with_nparray(detector_backend):
|
|||||||
cv2.resize(image_utils.load_image(img_path)[0], (1920, 1080))
|
cv2.resize(image_utils.load_image(img_path)[0], (1920, 1080))
|
||||||
for img_path in img_paths
|
for img_path in img_paths
|
||||||
]
|
]
|
||||||
|
expected_num_faces = [1, 1, 1, 2]
|
||||||
|
|
||||||
# load images as numpy arrays
|
# load images as numpy arrays
|
||||||
imgs_batch = np.stack(imgs, axis=0)
|
imgs_batch = np.stack(imgs, axis=0)
|
||||||
@ -191,6 +192,9 @@ def test_batch_extract_faces_with_nparray(detector_backend):
|
|||||||
align=True,
|
align=True,
|
||||||
enforce_detection=False,
|
enforce_detection=False,
|
||||||
)
|
)
|
||||||
|
assert len(imgs_objs_batch) == 4
|
||||||
|
for img_objs_batch, expected_num_faces in zip(imgs_objs_batch, expected_num_faces):
|
||||||
|
assert len(img_objs_batch) == expected_num_faces
|
||||||
|
|
||||||
# extract faces in batch of paths
|
# extract faces in batch of paths
|
||||||
imgs_objs_batch_paths = DeepFace.extract_faces(
|
imgs_objs_batch_paths = DeepFace.extract_faces(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user