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
|
@@ -73,7 +73,7 @@ tokenizer = AutoTokenizer.from_pretrained("laicsiifes/swin-distilbertimbau")
|
|
| 73 |
image_processor = AutoImageProcessor.from_pretrained("laicsiifes/swin-distilbertimbau")
|
| 74 |
|
| 75 |
# preprocess an image
|
| 76 |
-
url = "http://images.cocodataset.org/
|
| 77 |
image = Image.open(requests.get(url, stream=True).raw)
|
| 78 |
pixel_values = image_processor(image, return_tensors="pt").pixel_values
|
| 79 |
|
|
@@ -92,7 +92,7 @@ plt.title(generated_text)
|
|
| 92 |
plt.show()
|
| 93 |
```
|
| 94 |
|
| 95 |
-

|
| 74 |
|
| 75 |
# preprocess an image
|
| 76 |
+
url = "http://images.cocodataset.org/val2014/COCO_val2014_000000458153.jpg"
|
| 77 |
image = Image.open(requests.get(url, stream=True).raw)
|
| 78 |
pixel_values = image_processor(image, return_tensors="pt").pixel_values
|
| 79 |
|
|
|
|
| 92 |
plt.show()
|
| 93 |
```
|
| 94 |
|
| 95 |
+

|
| 96 |
|
| 97 |
## 📈 Results
|
| 98 |
|