Instructions to use microsoft/kosmos-2-patch14-224 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use microsoft/kosmos-2-patch14-224 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="microsoft/kosmos-2-patch14-224")# Load model directly from transformers import AutoProcessor, AutoModelForImageTextToText processor = AutoProcessor.from_pretrained("microsoft/kosmos-2-patch14-224") model = AutoModelForImageTextToText.from_pretrained("microsoft/kosmos-2-patch14-224") - Notebooks
- Google Colab
- Kaggle
Upload processor
Browse files- preprocessor_config.json +3 -2
preprocessor_config.json
CHANGED
|
@@ -13,7 +13,7 @@
|
|
| 13 |
0.4578275,
|
| 14 |
0.40821073
|
| 15 |
],
|
| 16 |
-
"image_processor_type": "
|
| 17 |
"image_std": [
|
| 18 |
0.26862954,
|
| 19 |
0.26130258,
|
|
@@ -24,5 +24,6 @@
|
|
| 24 |
"rescale_factor": 0.00392156862745098,
|
| 25 |
"size": {
|
| 26 |
"shortest_edge": 224
|
| 27 |
-
}
|
|
|
|
| 28 |
}
|
|
|
|
| 13 |
0.4578275,
|
| 14 |
0.40821073
|
| 15 |
],
|
| 16 |
+
"image_processor_type": "CLIPImageProcessor",
|
| 17 |
"image_std": [
|
| 18 |
0.26862954,
|
| 19 |
0.26130258,
|
|
|
|
| 24 |
"rescale_factor": 0.00392156862745098,
|
| 25 |
"size": {
|
| 26 |
"shortest_edge": 224
|
| 27 |
+
},
|
| 28 |
+
"use_square_size": true
|
| 29 |
}
|