Skip to content

Commit

Permalink
updated doctstring descriptions for functions that accept IO[bytes] f…
Browse files Browse the repository at this point in the history
…ile objects
  • Loading branch information
PyWoody committed Jan 10, 2025
1 parent 86fa2df commit e4cba05
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
18 changes: 12 additions & 6 deletions deepface/DeepFace.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,13 @@ def verify(
Verify if an image pair represents the same person or different persons.
Args:
img1_path (str or np.ndarray or IO[bytes] or List[float]): Path to the first image.
Accepts exact image path as a string, numpy array (BGR), base64 encoded images
Accepts exact image path as a string, numpy array (BGR), a file object that supports
at least `.read` and is opened in binary mode, base64 encoded images
or pre-calculated embeddings.
img2_path (str or np.ndarray or IO[bytes] or List[float]): Path to the second image.
Accepts exact image path as a string, numpy array (BGR), base64 encoded images
Accepts exact image path as a string, numpy array (BGR), a file object that supports
at least `.read` and is opened in binary mode, base64 encoded images
or pre-calculated embeddings.
model_name (str): Model for face recognition. Options: VGG-Face, Facenet, Facenet512,
Expand Down Expand Up @@ -177,7 +179,8 @@ def analyze(
Analyze facial attributes such as age, gender, emotion, and race in the provided image.
Args:
img_path (str or np.ndarray or IO[bytes]): The exact path to the image, a numpy array
in BGR format, or a base64 encoded image. If the source image contains multiple faces,
in BGR format, a file object that supports at least `.read` and is opened in binary
mode, or a base64 encoded image. If the source image contains multiple faces,
the result will include information for each detected face.
actions (tuple): Attributes to analyze. The default is ('age', 'gender', 'emotion', 'race').
Expand Down Expand Up @@ -282,7 +285,8 @@ def find(
Identify individuals in a database
Args:
img_path (str or np.ndarray or IO[bytes]): The exact path to the image, a numpy array
in BGR format, or a base64 encoded image. If the source image contains multiple
in BGR format, a file object that supports at least `.read` and is opened in binary
mode, or a base64 encoded image. If the source image contains multiple
faces, the result will include information for each detected face.
db_path (string): Path to the folder containing image files. All detected faces
Expand Down Expand Up @@ -384,7 +388,8 @@ def represent(
Args:
img_path (str or np.ndarray or IO[bytes]): The exact path to the image, a numpy array
in BGR format, or a base64 encoded image. If the source image contains multiple faces,
in BGR format, a file object that supports at least `.read` and is opened in binary
mode, or a base64 encoded image. If the source image contains multiple faces,
the result will include information for each detected face.
model_name (str): Model for face recognition. Options: VGG-Face, Facenet, Facenet512,
Expand Down Expand Up @@ -520,7 +525,8 @@ def extract_faces(
Args:
img_path (str or np.ndarray or IO[bytes]): Path to the first image. Accepts exact image path
as a string, numpy array (BGR), or base64 encoded images.
as a string, numpy array (BGR), a file object that supports at least `.read` and is
opened in binary mode, or base64 encoded images.
detector_backend (string): face detector backend. Options: 'opencv', 'retinaface',
'mtcnn', 'ssd', 'dlib', 'mediapipe', 'yolov8', 'yolov11n', 'yolov11s', 'yolov11m',
Expand Down
3 changes: 2 additions & 1 deletion deepface/modules/detection.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ def extract_faces(
Args:
img_path (str or np.ndarray or IO[bytes]): Path to the first image. Accepts exact image path
as a string, numpy array (BGR), or base64 encoded images.
as a string, numpy array (BGR), a file object that supports at least `.read` and is
opened in binary mode, or base64 encoded images.
detector_backend (string): face detector backend. Options: 'opencv', 'retinaface',
'mtcnn', 'ssd', 'dlib', 'mediapipe', 'yolov8', 'yolov11n', 'yolov11s', 'yolov11m',
Expand Down

0 comments on commit e4cba05

Please sign in to comment.