Instructions to use Bekhouche/LMIM-STR with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Bekhouche/LMIM-STR with Transformers:
# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("Bekhouche/LMIM-STR", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Fix missing image preprocessing step (encoder was receiving raw PIL images instead of a normalized tensor)
Browse files- config.json +29 -2
config.json
CHANGED
|
@@ -45,9 +45,28 @@
|
|
| 45 |
}
|
| 46 |
},
|
| 47 |
"type": "DeepTextRecognition.CTCTokenizer"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 48 |
}
|
| 49 |
},
|
| 50 |
"order": [
|
|
|
|
| 51 |
"lmim_encoder",
|
| 52 |
"text_decoder",
|
| 53 |
"tokenizer"
|
|
@@ -59,7 +78,7 @@
|
|
| 59 |
"routing": {
|
| 60 |
"lmim_encoder": {
|
| 61 |
"inputs": [
|
| 62 |
-
"
|
| 63 |
],
|
| 64 |
"outputs": [
|
| 65 |
"lmim_encoder:visual_features",
|
|
@@ -82,6 +101,14 @@
|
|
| 82 |
"outputs": [
|
| 83 |
"tokenizer:labels"
|
| 84 |
]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 85 |
}
|
| 86 |
}
|
| 87 |
-
}
|
|
|
|
| 45 |
}
|
| 46 |
},
|
| 47 |
"type": "DeepTextRecognition.CTCTokenizer"
|
| 48 |
+
},
|
| 49 |
+
"processing": {
|
| 50 |
+
"config": {
|
| 51 |
+
"args": {
|
| 52 |
+
"channels_size": 3,
|
| 53 |
+
"image_size": [
|
| 54 |
+
32,
|
| 55 |
+
128
|
| 56 |
+
],
|
| 57 |
+
"normalize": [
|
| 58 |
+
0.5,
|
| 59 |
+
0.5
|
| 60 |
+
],
|
| 61 |
+
"padding": "none",
|
| 62 |
+
"resize_method": "bilinear"
|
| 63 |
+
}
|
| 64 |
+
},
|
| 65 |
+
"type": "DeepTextRecognition.ImageProcessor"
|
| 66 |
}
|
| 67 |
},
|
| 68 |
"order": [
|
| 69 |
+
"processing",
|
| 70 |
"lmim_encoder",
|
| 71 |
"text_decoder",
|
| 72 |
"tokenizer"
|
|
|
|
| 78 |
"routing": {
|
| 79 |
"lmim_encoder": {
|
| 80 |
"inputs": [
|
| 81 |
+
"processing:processed_images"
|
| 82 |
],
|
| 83 |
"outputs": [
|
| 84 |
"lmim_encoder:visual_features",
|
|
|
|
| 101 |
"outputs": [
|
| 102 |
"tokenizer:labels"
|
| 103 |
]
|
| 104 |
+
},
|
| 105 |
+
"processing": {
|
| 106 |
+
"inputs": [
|
| 107 |
+
"images"
|
| 108 |
+
],
|
| 109 |
+
"outputs": [
|
| 110 |
+
"processing:processed_images"
|
| 111 |
+
]
|
| 112 |
}
|
| 113 |
}
|
| 114 |
+
}
|