class_docstr: Image classification pipeline using any `AutoModelForImageClassification`. This pipeline predicts the class of an
  image.
  
  This image classification pipeline can currently be loaded from [`pipeline`] using the following task identifier:
  `"image-classification"`.
  
  See the list of available models on
  [huggingface.co/models](https://huggingface.co/models?filter=image-classification).
class_docstr_tok: ["Image","classification","pipeline","using","any","`","AutoModelForImageClassification","`",".","This","pipeline","predicts","the","class","of","an","image",".","This","image","classification","pipeline","can","currently","be","loaded","from","[","`","pipeline","`","]","using","the","following","task","identifier",":","`","``","image-classification","''","`",".","See","the","list","of","available","models","on","[","huggingface.co\/models","]","(","https",":","\/\/huggingface.co\/models","?","filter=image-classification",")","."]
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 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, which must then be passed as a string.
          Images in a batch must all be in the same format: all as http links, all as local paths, or all as PIL
          images.
      top_k (`int`, *optional*, defaults to 5):
          The number of top labels that will be returned by the pipeline. If the provided number is higher than
          the number of labels available in the model configuration, it will default to the number of labels.
  
  Return:
      A dictionary or a list of dictionaries containing result. If the input is a single image, will return a
      dictionary, if the input is a list of several images, will return a list of dictionaries corresponding to
      the images.
  
      The dictionaries contain the following keys:
  
      - **label** (`str`) -- The label identified by the model.
      - **score** (`int`) -- The score attributed by the model for that label.
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","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",",","which","must","then","be","passed","as","a","string",".","Images","in","a","batch","must","all","be","in","the","same","format",":","all","as","http","links",",","all","as","local","paths",",","or","all","as","PIL","images",".","top_k","(","`","int","`",",","*","optional","*",",","defaults","to","5",")",":","The","number","of","top","labels","that","will","be","returned","by","the","pipeline",".","If","the","provided","number","is","higher","than","the","number","of","labels","available","in","the","model","configuration",",","it","will","default","to","the","number","of","labels",".","Return",":","A","dictionary","or","a","list","of","dictionaries","containing","result",".","If","the","input","is","a","single","image",",","will","return","a","dictionary",",","if","the","input","is","a","list","of","several","images",",","will","return","a","list","of","dictionaries","corresponding","to","the","images",".","The","dictionaries","contain","the","following","keys",":","-","*","*","label","*","*","(","`","str","`",")","--","The","label","identified","by","the","model",".","-","*","*","score","*","*","(","`","int","`",")","--","The","score","attributed","by","the","model","for","that","label","."]
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 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, which must then be passed as a string.
              Images in a batch must all be in the same format: all as http links, all as local paths, or all as PIL
              images.
          top_k (`int`, *optional*, defaults to 5):
              The number of top labels that will be returned by the pipeline. If the provided number is higher than
              the number of labels available in the model configuration, it will default to the number of labels.
  
      Return:
          A dictionary or a list of dictionaries containing result. If the input is a single image, will return a
          dictionary, if the input is a list of several images, will return a list of dictionaries corresponding to
          the images.
  
          The dictionaries contain the following keys:
  
          - **label** (`str`) -- The label identified by the model.
          - **score** (`int`) -- The score attributed by the model for that label.
      """
      return super().__call__(images, **kwargs)
  
file_path: H2O/h2o_flexgen/benchmark/third_party/transformers/src/transformers/pipelines/image_classification.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 ImageClassificationPipeline obj's underlying member method code with example usage: obj.__call__(images) and returns: super