Instructions to use microsoft/trocr-base-handwritten with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use microsoft/trocr-base-handwritten 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/trocr-base-handwritten")# Load model directly from transformers import AutoTokenizer, AutoModelForImageTextToText tokenizer = AutoTokenizer.from_pretrained("microsoft/trocr-base-handwritten") model = AutoModelForImageTextToText.from_pretrained("microsoft/trocr-base-handwritten") - Notebooks
- Google Colab
- Kaggle
add AIBOM
#14
by sabato-nocera - opened
microsoft_trocr-base-handwritten.json
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"bomFormat": "CycloneDX",
|
| 3 |
+
"specVersion": "1.6",
|
| 4 |
+
"serialNumber": "urn:uuid:afd7e4b7-6ff6-45d6-b444-bf0121684485",
|
| 5 |
+
"version": 1,
|
| 6 |
+
"metadata": {
|
| 7 |
+
"timestamp": "2025-06-05T09:34:50.484830+00:00",
|
| 8 |
+
"component": {
|
| 9 |
+
"type": "machine-learning-model",
|
| 10 |
+
"bom-ref": "microsoft/trocr-base-handwritten-7bfc4f19-89f7-5aeb-921f-5f614d919545",
|
| 11 |
+
"name": "microsoft/trocr-base-handwritten",
|
| 12 |
+
"externalReferences": [
|
| 13 |
+
{
|
| 14 |
+
"url": "https://huggingface.co/microsoft/trocr-base-handwritten",
|
| 15 |
+
"type": "documentation"
|
| 16 |
+
}
|
| 17 |
+
],
|
| 18 |
+
"modelCard": {
|
| 19 |
+
"modelParameters": {
|
| 20 |
+
"task": "image-to-text",
|
| 21 |
+
"architectureFamily": "vision-encoder-decoder",
|
| 22 |
+
"modelArchitecture": "VisionEncoderDecoderModel"
|
| 23 |
+
},
|
| 24 |
+
"properties": [
|
| 25 |
+
{
|
| 26 |
+
"name": "library_name",
|
| 27 |
+
"value": "transformers"
|
| 28 |
+
}
|
| 29 |
+
],
|
| 30 |
+
"consideration": {
|
| 31 |
+
"useCases": "You can use the raw model for optical character recognition (OCR) on single text-line images. See the [model hub](https://huggingface.co/models?search=microsoft/trocr) to look for fine-tuned versions on a task that interests you."
|
| 32 |
+
}
|
| 33 |
+
},
|
| 34 |
+
"authors": [
|
| 35 |
+
{
|
| 36 |
+
"name": "microsoft"
|
| 37 |
+
}
|
| 38 |
+
],
|
| 39 |
+
"licenses": [
|
| 40 |
+
{
|
| 41 |
+
"license": {
|
| 42 |
+
"id": "MIT",
|
| 43 |
+
"url": "https://spdx.org/licenses/MIT.html"
|
| 44 |
+
}
|
| 45 |
+
}
|
| 46 |
+
],
|
| 47 |
+
"description": "The TrOCR model is an encoder-decoder model, consisting of an image Transformer as encoder, and a text Transformer as decoder. The image encoder was initialized from the weights of BEiT, while the text decoder was initialized from the weights of RoBERTa.Images are presented to the model as a sequence of fixed-size patches (resolution 16x16), which are linearly embedded. One also adds absolute position embeddings before feeding the sequence to the layers of the Transformer encoder. Next, the Transformer text decoder autoregressively generates tokens.",
|
| 48 |
+
"tags": [
|
| 49 |
+
"transformers",
|
| 50 |
+
"pytorch",
|
| 51 |
+
"safetensors",
|
| 52 |
+
"vision-encoder-decoder",
|
| 53 |
+
"image-text-to-text",
|
| 54 |
+
"trocr",
|
| 55 |
+
"image-to-text",
|
| 56 |
+
"arxiv:2109.10282",
|
| 57 |
+
"license:mit",
|
| 58 |
+
"endpoints_compatible",
|
| 59 |
+
"region:us"
|
| 60 |
+
]
|
| 61 |
+
}
|
| 62 |
+
}
|
| 63 |
+
}
|