Update README.md
Browse files
README.md
CHANGED
|
@@ -1,16 +1,19 @@
|
|
| 1 |
---
|
| 2 |
-
pipeline_tag: image-to-text
|
| 3 |
license: apache-2.0
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
---
|
| 5 |
-
##
|
| 6 |
```python
|
| 7 |
from transformers import VisionEncoderDecoderModel, ViTImageProcessor, AutoTokenizer
|
| 8 |
import torch
|
| 9 |
from PIL import Image
|
| 10 |
|
| 11 |
-
model = VisionEncoderDecoderModel.from_pretrained("
|
| 12 |
-
feature_extractor = ViTImageProcessor.from_pretrained("
|
| 13 |
-
tokenizer = AutoTokenizer.from_pretrained("
|
| 14 |
|
| 15 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
| 16 |
model.to(device)
|
|
|
|
| 1 |
---
|
|
|
|
| 2 |
license: apache-2.0
|
| 3 |
+
pipeline_tag: image-to-text
|
| 4 |
+
tags:
|
| 5 |
+
- image-captioning
|
| 6 |
+
- image-to-text
|
| 7 |
---
|
| 8 |
+
## Use in Transformers
|
| 9 |
```python
|
| 10 |
from transformers import VisionEncoderDecoderModel, ViTImageProcessor, AutoTokenizer
|
| 11 |
import torch
|
| 12 |
from PIL import Image
|
| 13 |
|
| 14 |
+
model = VisionEncoderDecoderModel.from_pretrained("TheKOG/vit-gpt2-verifycode-caption")
|
| 15 |
+
feature_extractor = ViTImageProcessor.from_pretrained("TheKOG/vit-gpt2-verifycode-caption")
|
| 16 |
+
tokenizer = AutoTokenizer.from_pretrained("TheKOG/vit-gpt2-verifycode-caption")
|
| 17 |
|
| 18 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
| 19 |
model.to(device)
|