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",")","."]
code: def __init__(self, *args, **kwargs):
      super().__init__(*args, **kwargs)
      requires_backends(self, "vision")
      self.check_model_type(
          TF_MODEL_FOR_VISION_2_SEQ_MAPPING_NAMES
          if self.framework == "tf"
          else MODEL_FOR_VISION_2_SEQ_MAPPING_NAMES
      )
  
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 1 to create a new ImageToTextPipeline object from inherited base classes: Pipeline with example: obj = ImageToTextPipeline()