Skip to content

Commit

Permalink
fix linter errors
Browse files Browse the repository at this point in the history
  • Loading branch information
AnthraX1 committed Jul 24, 2023
1 parent fc09756 commit 9bf9542
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions deepface/detectors/YunetWrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@


def build_model():
url = (
"https://github.com/opencv/opencv_zoo/raw/main/models/"
+ "face_detection_yunet/face_detection_yunet_2023mar.onnx"
)
# pylint: disable=C0301
url = "https://github.com/opencv/opencv_zoo/raw/main/models/face_detection_yunet/face_detection_yunet_2023mar.onnx"
file_name = "face_detection_yunet_2023mar.onnx"
home = functions.get_deepface_home()
if os.path.isfile(home + f"/.deepface/weights/{file_name}") is False:
Expand Down Expand Up @@ -44,9 +42,10 @@ def detect_face(detector, image, align=True, score_threshold=0.9):
if faces is None:
return resp
for face in faces:
# pylint: disable=W0105
"""
The detection output faces is a two-dimension array of type CV_32F,
whose rows are the detected face instances, columns are the location
whose rows are the detected face instances, columns are the location
of a face and 5 facial landmarks.
The format of each row is as follows:
x1, y1, w, h, x_re, y_re, x_le, y_le, x_nt, y_nt,
Expand All @@ -58,7 +57,7 @@ def detect_face(detector, image, align=True, score_threshold=0.9):
"""
(x, y, w, h, x_re, y_re, x_le, y_le) = list(map(int, face[:8]))

# Yunet returns negative coordinates if it thinks part of
# Yunet returns negative coordinates if it thinks part of
# the detected face is outside the frame.
# We set the coordinate to 0 if they are negative.
x = max(x, 0)
Expand Down

0 comments on commit 9bf9542

Please sign in to comment.