transformers/docs/source/en/model_doc/git.md

3.8 KiB

GIT

Overview

The GIT model was proposed in GIT: A Generative Image-to-text Transformer for Vision and Language by Jianfeng Wang, Zhengyuan Yang, Xiaowei Hu, Linjie Li, Kevin Lin, Zhe Gan, Zicheng Liu, Ce Liu, Lijuan Wang. GIT is a decoder-only Transformer that leverages CLIP's vision encoder to condition the model on vision inputs besides text. The model obtains state-of-the-art results on image captioning and visual question answering benchmarks.

The abstract from the paper is the following:

In this paper, we design and train a Generative Image-to-text Transformer, GIT, to unify vision-language tasks such as image/video captioning and question answering. While generative models provide a consistent network architecture between pre-training and fine-tuning, existing work typically contains complex structures (uni/multi-modal encoder/decoder) and depends on external modules such as object detectors/taggers and optical character recognition (OCR). In GIT, we simplify the architecture as one image encoder and one text decoder under a single language modeling task. We also scale up the pre-training data and the model size to boost the model performance. Without bells and whistles, our GIT establishes new state of the arts on 12 challenging benchmarks with a large margin. For instance, our model surpasses the human performance for the first time on TextCaps (138.2 vs. 125.5 in CIDEr). Furthermore, we present a new scheme of generation-based image classification and scene text recognition, achieving decent performance on standard benchmarks.

drawing

GIT architecture. Taken from the original paper.

This model was contributed by nielsr. The original code can be found here.

Usage tips

  • GIT is implemented in a very similar way to GPT-2, the only difference being that the model is also conditioned on pixel_values.

Resources

A list of official Hugging Face and community (indicated by 🌎) resources to help you get started with GIT.

If you're interested in submitting a resource to be included here, please feel free to open a Pull Request and we will review it. The resource should ideally demonstrate something new instead of duplicating an existing resource.

GitVisionConfig

autodoc GitVisionConfig

GitVisionModel

autodoc GitVisionModel - forward

GitConfig

autodoc GitConfig - all

GitProcessor

autodoc GitProcessor - call

GitModel

autodoc GitModel - forward

GitForCausalLM

autodoc GitForCausalLM - forward