class_docstr: Image To Text pipeline using a `AutoModelForVision2Seq`. This pipeline predicts a caption for a given image.
  
  Example:
  
  ```python
  >>> from transformers import pipeline
  
  >>> captioner = pipeline(model="ydshieh/vit-gpt2-coco-en")
  >>> captioner("https://huggingface.co/datasets/Narsil/image_dummy/raw/main/parrots.png")
  [{'generated_text': 'two birds are standing next to each other '}]
  ```
  
  Learn more about the basics of using a pipeline in the [pipeline tutorial](../pipeline_tutorial)
  
  This image to text pipeline can currently be loaded from pipeline() using the following task identifier:
  "image-to-text".
  
  See the list of available models on
  [huggingface.co/models](https://huggingface.co/models?pipeline_tag=image-to-text).
class_docstr_tok: ["Image","To","Text","pipeline","using","a","`","AutoModelForVision2Seq","`",".","This","pipeline","predicts","a","caption","for","a","given","image",".","Example",":","``","`","python",">",">",">","from","transformers","import","pipeline",">",">",">","captioner","=","pipeline","(","model=","''","ydshieh\/vit-gpt2-coco-en","''",")",">",">",">","captioner","(","``","https",":","\/\/huggingface.co\/datasets\/Narsil\/image_dummy\/raw\/main\/parrots.png","''",")","[","{","'generated_text","'",":","'two","birds","are","standing","next","to","each","other","'","}","]","``","`","Learn","more","about","the","basics","of","using","a","pipeline","in","the","[","pipeline","tutorial","]","(","..","\/pipeline_tutorial",")","This","image","to","text","pipeline","can","currently","be","loaded","from","pipeline","(",")","using","the","following","task","identifier",":","''","image-to-text","''",".","See","the","list","of","available","models","on","[","huggingface.co\/models","]","(","https",":","\/\/huggingface.co\/models","?","pipeline_tag=image-to-text",")","."]
docstr: Assign labels to the image(s) passed as inputs.
  
  Args:
      images (`str`, `List[str]`, `PIL.Image` or `List[PIL.Image]`):
          The pipeline handles three types of images:
  
          - A string containing a HTTP(s) link pointing to an image
          - A string containing a local path to an image
          - An image loaded in PIL directly
  
          The pipeline accepts either a single image or a batch of images.
  
      max_new_tokens (`int`, *optional*):
          The amount of maximum tokens to generate. By default it will use `generate` default.
  
      generate_kwargs (`Dict`, *optional*):
          Pass it to send all of these arguments directly to `generate` allowing full control of this function.
      timeout (`float`, *optional*, defaults to None):
          The maximum time in seconds to wait for fetching images from the web. If None, no timeout is set and
          the call may block forever.
  
  Return:
      A list or a list of list of `dict`: Each result comes as a dictionary with the following key:
  
      - **generated_text** (`str`) -- The generated text.
docstr_tok: ["Assign","labels","to","the","image","(","s",")","passed","as","inputs",".","Args",":","images","(","`","str","`",",","`","List","[","str","]","`",",","`","PIL.Image","`","or","`","List","[","PIL.Image","]","`",")",":","The","pipeline","handles","three","types","of","images",":","-","A","string","containing","a","HTTP","(","s",")","link","pointing","to","an","image","-","A","string","containing","a","local","path","to","an","image","-","An","image","loaded","in","PIL","directly","The","pipeline","accepts","either","a","single","image","or","a","batch","of","images",".","max_new_tokens","(","`","int","`",",","*","optional","*",")",":","The","amount","of","maximum","tokens","to","generate",".","By","default","it","will","use","`","generate","`","default",".","generate_kwargs","(","`","Dict","`",",","*","optional","*",")",":","Pass","it","to","send","all","of","these","arguments","directly","to","`","generate","`","allowing","full","control","of","this","function",".","timeout","(","`","float","`",",","*","optional","*",",","defaults","to","None",")",":","The","maximum","time","in","seconds","to","wait","for","fetching","images","from","the","web",".","If","None",",","no","timeout","is","set","and","the","call","may","block","forever",".","Return",":","A","list","or","a","list","of","list","of","`","dict","`",":","Each","result","comes","as","a","dictionary","with","the","following","key",":","-","*","*","generated_text","*","*","(","`","str","`",")","--","The","generated","text","."]
code: def __call__(
      self,
      images: Union[str, List[str], "Image.Image", List["Image.Image"]],
      **kwargs,
  ):
      """
      Assign labels to the image(s) passed as inputs.
  
      Args:
          images (`str`, `List[str]`, `PIL.Image` or `List[PIL.Image]`):
              The pipeline handles three types of images:
  
              - A string containing a HTTP(s) link pointing to an image
              - A string containing a local path to an image
              - An image loaded in PIL directly
  
              The pipeline accepts either a single image or a batch of images.
  
          max_new_tokens (`int`, *optional*):
              The amount of maximum tokens to generate. By default it will use `generate` default.
  
          generate_kwargs (`Dict`, *optional*):
              Pass it to send all of these arguments directly to `generate` allowing full control of this function.
          timeout (`float`, *optional*, defaults to None):
              The maximum time in seconds to wait for fetching images from the web. If None, no timeout is set and
              the call may block forever.
  
      Return:
          A list or a list of list of `dict`: Each result comes as a dictionary with the following key:
  
          - **generated_text** (`str`) -- The generated text.
      """
      return super().__call__(images, **kwargs)
  
file_path: transformers/src/transformers/pipelines/image_to_text.py
imports: from typing import List, Union
  from ..utils import add_end_docstrings, is_tf_available, is_torch_available, is_vision_available, logging, requires_backends
  from .base import PIPELINE_INIT_ARGS, Pipeline
label_desc: Use image node_id 3 for calling the ImageToTextPipeline obj's underlying member method code with example usage: obj.__call__(images) and returns: super