Reformat using black with settings.json

This commit is contained in:
Vincent STRAGIER 2023-03-01 14:01:15 +01:00
parent 34c7a81f76
commit 03d7d1931f

View File

@ -95,9 +95,9 @@ def load_image(img):
# The image is a url # The image is a url
if img.startswith("http"): if img.startswith("http"):
return np.array( return np.array(Image.open(requests.get(img, stream=True, timeout=60).raw).convert("RGB"))[
Image.open(requests.get(img, stream=True, timeout=60).raw).convert("RGB") :, :, ::-1
)[:, :, ::-1] ]
# The image is a path # The image is a path
if os.path.isfile(img) is not True: if os.path.isfile(img) is not True:
@ -147,9 +147,7 @@ def extract_faces(
face_objs = [(img, img_region, 0)] face_objs = [(img, img_region, 0)]
else: else:
face_detector = FaceDetector.build_model(detector_backend) face_detector = FaceDetector.build_model(detector_backend)
face_objs = FaceDetector.detect_faces( face_objs = FaceDetector.detect_faces(face_detector, detector_backend, img, align)
face_detector, detector_backend, img, align
)
# in case of no face found # in case of no face found
if len(face_objs) == 0 and enforce_detection is True: if len(face_objs) == 0 and enforce_detection is True: