Image-to-Text
Transformers
PyTorch
Safetensors
vision-encoder-decoder
image-text-to-text
image-captioning
Instructions to use bipin/image-caption-generator with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use bipin/image-caption-generator 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="bipin/image-caption-generator")# Load model directly from transformers import AutoTokenizer, AutoModelForImageTextToText tokenizer = AutoTokenizer.from_pretrained("bipin/image-caption-generator") model = AutoModelForImageTextToText.from_pretrained("bipin/image-caption-generator") - Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files
README.md
CHANGED
|
@@ -41,9 +41,9 @@ It achieves the following results on the evaluation set:
|
|
| 41 |
model.to(device)
|
| 42 |
```
|
| 43 |
|
| 44 |
-
2. Load the image for which the caption is to be generated
|
| 45 |
```python
|
| 46 |
-
### replace the
|
| 47 |
img_name = "flickr_data.jpg"
|
| 48 |
img = Image.open(img_name)
|
| 49 |
if img.mode != 'RGB':
|
|
|
|
| 41 |
model.to(device)
|
| 42 |
```
|
| 43 |
|
| 44 |
+
2. Load the image for which the caption is to be generated(note: replace the value of `img_name` with image of your choice)
|
| 45 |
```python
|
| 46 |
+
### replace the value with your image
|
| 47 |
img_name = "flickr_data.jpg"
|
| 48 |
img = Image.open(img_name)
|
| 49 |
if img.mode != 'RGB':
|