Skip to content

Commit

Permalink
Reformat using black with settings.json
Browse files Browse the repository at this point in the history
  • Loading branch information
Vincent-Stragier committed Mar 1, 2023
1 parent 34c7a81 commit 03d7d19
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions deepface/commons/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,9 @@ def load_image(img):

# The image is a url
if img.startswith("http"):
return np.array(
Image.open(requests.get(img, stream=True, timeout=60).raw).convert("RGB")
)[:, :, ::-1]
return np.array(Image.open(requests.get(img, stream=True, timeout=60).raw).convert("RGB"))[
:, :, ::-1
]

# The image is a path
if os.path.isfile(img) is not True:
Expand Down Expand Up @@ -147,9 +147,7 @@ def extract_faces(
face_objs = [(img, img_region, 0)]
else:
face_detector = FaceDetector.build_model(detector_backend)
face_objs = FaceDetector.detect_faces(
face_detector, detector_backend, img, align
)
face_objs = FaceDetector.detect_faces(face_detector, detector_backend, img, align)

# in case of no face found
if len(face_objs) == 0 and enforce_detection is True:
Expand Down

0 comments on commit 03d7d19

Please sign in to comment.