Image-to-Text
Transformers
Safetensors
Portuguese
vision-encoder-decoder
image-text-to-text
Eval Results (legacy)
Instructions to use laicsiifes/swin-distilbertimbau with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use laicsiifes/swin-distilbertimbau 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="laicsiifes/swin-distilbertimbau")# Load model directly from transformers import AutoTokenizer, AutoModelForMultimodalLM tokenizer = AutoTokenizer.from_pretrained("laicsiifes/swin-distilbertimbau") model = AutoModelForMultimodalLM.from_pretrained("laicsiifes/swin-distilbertimbau", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files
README.md
CHANGED
|
@@ -40,12 +40,12 @@ Use the code below to get started with the model.
|
|
| 40 |
import requests
|
| 41 |
from PIL import Image
|
| 42 |
|
| 43 |
-
from transformers import AutoTokenizer,
|
| 44 |
|
| 45 |
# load a fine-tuned image captioning model and corresponding tokenizer and image processor
|
| 46 |
model = VisionEncoderDecoderModel.from_pretrained("laicsiifes/swin-distilbert-flickr30k-pt-br")
|
| 47 |
tokenizer = AutoTokenizer.from_pretrained("laicsiifes/swin-distilbert-flickr30k-pt-br")
|
| 48 |
-
image_processor =
|
| 49 |
|
| 50 |
# perform inference on an image
|
| 51 |
url = "http://images.cocodataset.org/val2017/000000039769.jpg"
|
|
|
|
| 40 |
import requests
|
| 41 |
from PIL import Image
|
| 42 |
|
| 43 |
+
from transformers import AutoTokenizer, AutoImageProcessor, VisionEncoderDecoderModel
|
| 44 |
|
| 45 |
# load a fine-tuned image captioning model and corresponding tokenizer and image processor
|
| 46 |
model = VisionEncoderDecoderModel.from_pretrained("laicsiifes/swin-distilbert-flickr30k-pt-br")
|
| 47 |
tokenizer = AutoTokenizer.from_pretrained("laicsiifes/swin-distilbert-flickr30k-pt-br")
|
| 48 |
+
image_processor = AutoImageProcessor.from_pretrained("laicsiifes/swin-distilbert-flickr30k-pt-br")
|
| 49 |
|
| 50 |
# perform inference on an image
|
| 51 |
url = "http://images.cocodataset.org/val2017/000000039769.jpg"
|