Instructions to use nlpconnect/vit-gpt2-image-captioning with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use nlpconnect/vit-gpt2-image-captioning with Transformers:
# Use a pipeline as a high-level helper # Warning: Pipeline type "image-to-text" is no longer supported in transformers v5. # You must load the model directly (see below) or downgrade to v4.x with: # 'pip install "transformers<5.0.0' from transformers import pipeline pipe = pipeline("image-to-text", model="nlpconnect/vit-gpt2-image-captioning")# Load model directly from transformers import AutoTokenizer, AutoModelForImageTextToText tokenizer = AutoTokenizer.from_pretrained("nlpconnect/vit-gpt2-image-captioning") model = AutoModelForImageTextToText.from_pretrained("nlpconnect/vit-gpt2-image-captioning") - Notebooks
- Google Colab
- Kaggle
Update README.md
#25
by qraunak - opened
README.md
CHANGED
|
@@ -4,12 +4,22 @@ tags:
|
|
| 4 |
- image-captioning
|
| 5 |
license: apache-2.0
|
| 6 |
widget:
|
| 7 |
-
- src:
|
|
|
|
| 8 |
example_title: Savanna
|
| 9 |
-
- src:
|
|
|
|
| 10 |
example_title: Football Match
|
| 11 |
-
- src:
|
|
|
|
| 12 |
example_title: Airport
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
---
|
| 14 |
|
| 15 |
# nlpconnect/vit-gpt2-image-captioning
|
|
|
|
| 4 |
- image-captioning
|
| 5 |
license: apache-2.0
|
| 6 |
widget:
|
| 7 |
+
- src: >-
|
| 8 |
+
https://huggingface.co/datasets/mishig/sample_images/resolve/main/savanna.jpg
|
| 9 |
example_title: Savanna
|
| 10 |
+
- src: >-
|
| 11 |
+
https://huggingface.co/datasets/mishig/sample_images/resolve/main/football-match.jpg
|
| 12 |
example_title: Football Match
|
| 13 |
+
- src: >-
|
| 14 |
+
https://huggingface.co/datasets/mishig/sample_images/resolve/main/airport.jpg
|
| 15 |
example_title: Airport
|
| 16 |
+
datasets:
|
| 17 |
+
- imagenet-1k
|
| 18 |
+
language:
|
| 19 |
+
- en
|
| 20 |
+
metrics:
|
| 21 |
+
- bleu
|
| 22 |
+
pipeline_tag: text-generation
|
| 23 |
---
|
| 24 |
|
| 25 |
# nlpconnect/vit-gpt2-image-captioning
|