@@ -947,8 +947,8 @@ def document_question_answering(
947947 Answer questions on document images.
948948
949949 Args:
950- image (`Union[str, Path, bytes, BinaryIO]`):
951- The input image for the context. It can be raw bytes, an image file, or a URL to an online image.
950+ image (`Union[str, Path, bytes, BinaryIO, PIL.Image.Image ]`):
951+ The input image for the context. It can be raw bytes, an image file, a URL to an online image, or a PIL Image .
952952 question (`str`):
953953 Question to be answered.
954954 model (`str`, *optional*):
@@ -1156,8 +1156,8 @@ def image_classification(
11561156 Perform image classification on the given image using the specified model.
11571157
11581158 Args:
1159- image (`Union[str, Path, bytes, BinaryIO]`):
1160- The image to classify. It can be raw bytes, an image file, or a URL to an online image.
1159+ image (`Union[str, Path, bytes, BinaryIO, PIL.Image.Image ]`):
1160+ The image to classify. It can be raw bytes, an image file, a URL to an online image, or a PIL Image .
11611161 model (`str`, *optional*):
11621162 The model to use for image classification. Can be a model ID hosted on the Hugging Face Hub or a URL to a
11631163 deployed Inference Endpoint. If not provided, the default recommended model for image classification will be used.
@@ -1214,8 +1214,8 @@ def image_segmentation(
12141214 </Tip>
12151215
12161216 Args:
1217- image (`Union[str, Path, bytes, BinaryIO]`):
1218- The image to segment. It can be raw bytes, an image file, or a URL to an online image.
1217+ image (`Union[str, Path, bytes, BinaryIO, PIL.Image.Image ]`):
1218+ The image to segment. It can be raw bytes, an image file, a URL to an online image, or a PIL Image .
12191219 model (`str`, *optional*):
12201220 The model to use for image segmentation. Can be a model ID hosted on the Hugging Face Hub or a URL to a
12211221 deployed Inference Endpoint. If not provided, the default recommended model for image segmentation will be used.
@@ -1286,8 +1286,8 @@ def image_to_image(
12861286 </Tip>
12871287
12881288 Args:
1289- image (`Union[str, Path, bytes, BinaryIO]`):
1290- The input image for translation. It can be raw bytes, an image file, or a URL to an online image.
1289+ image (`Union[str, Path, bytes, BinaryIO, PIL.Image.Image ]`):
1290+ The input image for translation. It can be raw bytes, an image file, a URL to an online image, or a PIL Image .
12911291 prompt (`str`, *optional*):
12921292 The text prompt to guide the image generation.
12931293 negative_prompt (`str`, *optional*):
@@ -1348,8 +1348,8 @@ def image_to_text(self, image: ContentT, *, model: Optional[str] = None) -> Imag
13481348 (OCR), Pix2Struct, etc). Please have a look to the model card to learn more about a model's specificities.
13491349
13501350 Args:
1351- image (`Union[str, Path, bytes, BinaryIO]`):
1352- The input image to caption. It can be raw bytes, an image file, or a URL to an online image. .
1351+ image (`Union[str, Path, bytes, BinaryIO, PIL.Image.Image ]`):
1352+ The input image to caption. It can be raw bytes, an image file, a URL to an online image, or a PIL Image .
13531353 model (`str`, *optional*):
13541354 The model to use for inference. Can be a model ID hosted on the Hugging Face Hub or a URL to a deployed
13551355 Inference Endpoint. This parameter overrides the model defined at the instance level. Defaults to None.
@@ -1399,8 +1399,8 @@ def object_detection(
13991399 </Tip>
14001400
14011401 Args:
1402- image (`Union[str, Path, bytes, BinaryIO]`):
1403- The image to detect objects on. It can be raw bytes, an image file, or a URL to an online image.
1402+ image (`Union[str, Path, bytes, BinaryIO, PIL.Image.Image ]`):
1403+ The image to detect objects on. It can be raw bytes, an image file, a URL to an online image, or a PIL Image .
14041404 model (`str`, *optional*):
14051405 The model to use for object detection. Can be a model ID hosted on the Hugging Face Hub or a URL to a
14061406 deployed Inference Endpoint. If not provided, the default recommended model for object detection (DETR) will be used.
@@ -2974,8 +2974,8 @@ def visual_question_answering(
29742974 Answering open-ended questions based on an image.
29752975
29762976 Args:
2977- image (`Union[str, Path, bytes, BinaryIO]`):
2978- The input image for the context. It can be raw bytes, an image file, or a URL to an online image.
2977+ image (`Union[str, Path, bytes, BinaryIO, PIL.Image.Image ]`):
2978+ The input image for the context. It can be raw bytes, an image file, a URL to an online image, or a PIL Image .
29792979 question (`str`):
29802980 Question to be answered.
29812981 model (`str`, *optional*):
@@ -3141,8 +3141,8 @@ def zero_shot_image_classification(
31413141 Provide input image and text labels to predict text labels for the image.
31423142
31433143 Args:
3144- image (`Union[str, Path, bytes, BinaryIO]`):
3145- The input image to caption. It can be raw bytes, an image file, or a URL to an online image.
3144+ image (`Union[str, Path, bytes, BinaryIO, PIL.Image.Image ]`):
3145+ The input image to caption. It can be raw bytes, an image file, a URL to an online image, or a PIL Image .
31463146 candidate_labels (`List[str]`):
31473147 The candidate labels for this image
31483148 labels (`List[str]`, *optional*):
0 commit comments