updated doctstring descriptions for functions that accept IO[bytes] file objects

This commit is contained in:
Samuel J. Woodward 2025-01-10 12:04:01 -05:00
parent 86fa2dfa83
commit e4cba05a10
2 changed files with 14 additions and 7 deletions

View File

@ -85,11 +85,13 @@ def verify(
Verify if an image pair represents the same person or different persons. Verify if an image pair represents the same person or different persons.
Args: Args:
img1_path (str or np.ndarray or IO[bytes] or List[float]): Path to the first image. 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. or pre-calculated embeddings.
img2_path (str or np.ndarray or IO[bytes] or List[float]): Path to the second image. 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. or pre-calculated embeddings.
model_name (str): Model for face recognition. Options: VGG-Face, Facenet, Facenet512, model_name (str): Model for face recognition. Options: VGG-Face, Facenet, Facenet512,
@ -177,7 +179,8 @@ def analyze(
Analyze facial attributes such as age, gender, emotion, and race in the provided image. Analyze facial attributes such as age, gender, emotion, and race in the provided image.
Args: Args:
img_path (str or np.ndarray or IO[bytes]): The exact path to the image, a numpy array 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. the result will include information for each detected face.
actions (tuple): Attributes to analyze. The default is ('age', 'gender', 'emotion', 'race'). actions (tuple): Attributes to analyze. The default is ('age', 'gender', 'emotion', 'race').
@ -282,7 +285,8 @@ def find(
Identify individuals in a database Identify individuals in a database
Args: Args:
img_path (str or np.ndarray or IO[bytes]): The exact path to the image, a numpy array 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. faces, the result will include information for each detected face.
db_path (string): Path to the folder containing image files. All detected faces db_path (string): Path to the folder containing image files. All detected faces
@ -384,7 +388,8 @@ def represent(
Args: Args:
img_path (str or np.ndarray or IO[bytes]): The exact path to the image, a numpy array 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. the result will include information for each detected face.
model_name (str): Model for face recognition. Options: VGG-Face, Facenet, Facenet512, model_name (str): Model for face recognition. Options: VGG-Face, Facenet, Facenet512,
@ -520,7 +525,8 @@ def extract_faces(
Args: Args:
img_path (str or np.ndarray or IO[bytes]): Path to the first image. Accepts exact image path 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', detector_backend (string): face detector backend. Options: 'opencv', 'retinaface',
'mtcnn', 'ssd', 'dlib', 'mediapipe', 'yolov8', 'yolov11n', 'yolov11s', 'yolov11m', 'mtcnn', 'ssd', 'dlib', 'mediapipe', 'yolov8', 'yolov11n', 'yolov11s', 'yolov11m',

View File

@ -35,7 +35,8 @@ def extract_faces(
Args: Args:
img_path (str or np.ndarray or IO[bytes]): Path to the first image. Accepts exact image path 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', detector_backend (string): face detector backend. Options: 'opencv', 'retinaface',
'mtcnn', 'ssd', 'dlib', 'mediapipe', 'yolov8', 'yolov11n', 'yolov11s', 'yolov11m', 'mtcnn', 'ssd', 'dlib', 'mediapipe', 'yolov8', 'yolov11n', 'yolov11s', 'yolov11m',