mirror of
https://github.com/serengil/deepface.git
synced 2025-06-08 04:25:21 +00:00
detection skip
This commit is contained in:
parent
799f83cd7b
commit
619930cd1e
@ -227,6 +227,15 @@ def detect_faces(
|
|||||||
if not isinstance(img, list):
|
if not isinstance(img, list):
|
||||||
img = [img]
|
img = [img]
|
||||||
|
|
||||||
|
if detector_backend == "skip":
|
||||||
|
all_face_objs = [
|
||||||
|
[DetectedFace(img=single_img, facial_area=FacialAreaRegion(x=0, y=0, w=single_img.shape[1], h=single_img.shape[0]), confidence=0)]
|
||||||
|
for single_img in img
|
||||||
|
]
|
||||||
|
if len(img) == 1:
|
||||||
|
all_face_objs = all_face_objs[0]
|
||||||
|
return all_face_objs
|
||||||
|
|
||||||
face_detector: Detector = modeling.build_model(
|
face_detector: Detector = modeling.build_model(
|
||||||
task="face_detector", model_name=detector_backend
|
task="face_detector", model_name=detector_backend
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user