Instructions to use Bekhouche/DAN-STR with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Bekhouche/DAN-STR with Transformers:
# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("Bekhouche/DAN-STR", device_map="auto") - Notebooks
- Google Colab
- Kaggle
| { | |
| "inputs": [ | |
| "images" | |
| ], | |
| "modules": { | |
| "attention_module": { | |
| "config": { | |
| "args": { | |
| "depth": 8, | |
| "maxT": 25, | |
| "num_channels": 64, | |
| "scales": [ | |
| [ | |
| 32, | |
| 16, | |
| 64 | |
| ], | |
| [ | |
| 128, | |
| 8, | |
| 32 | |
| ], | |
| [ | |
| 512, | |
| 8, | |
| 32 | |
| ] | |
| ] | |
| } | |
| }, | |
| "type": "DeepTextRecognition.CAMModel" | |
| }, | |
| "feature_extraction": { | |
| "config": { | |
| "args": { | |
| "compress_layer": false, | |
| "return_multiscale": true, | |
| "strides": [ | |
| [ | |
| 1, | |
| 1 | |
| ], | |
| [ | |
| 2, | |
| 2 | |
| ], | |
| [ | |
| 1, | |
| 1 | |
| ], | |
| [ | |
| 2, | |
| 2 | |
| ], | |
| [ | |
| 1, | |
| 1 | |
| ], | |
| [ | |
| 1, | |
| 1 | |
| ] | |
| ] | |
| } | |
| }, | |
| "type": "DeepTextRecognition.ResNet45Model" | |
| }, | |
| "processing": { | |
| "config": { | |
| "args": { | |
| "channels_size": 1, | |
| "image_size": [ | |
| 32, | |
| 128 | |
| ], | |
| "normalize": [ | |
| 0.5, | |
| 0.5 | |
| ], | |
| "padding": "none", | |
| "resize_method": "bilinear" | |
| } | |
| }, | |
| "type": "DeepTextRecognition.ImageProcessor" | |
| }, | |
| "text_decoder": { | |
| "config": { | |
| "args": { | |
| "dropout": 0.3, | |
| "nchannel": 512, | |
| "nclass": 38 | |
| } | |
| }, | |
| "type": "DeepTextRecognition.DTDModel" | |
| }, | |
| "tokenizer": { | |
| "config": { | |
| "args": { | |
| "case_sensitive": false, | |
| "characters": [ | |
| "a", | |
| "b", | |
| "c", | |
| "d", | |
| "e", | |
| "f", | |
| "g", | |
| "h", | |
| "i", | |
| "j", | |
| "k", | |
| "l", | |
| "m", | |
| "n", | |
| "o", | |
| "p", | |
| "q", | |
| "r", | |
| "s", | |
| "t", | |
| "u", | |
| "v", | |
| "w", | |
| "x", | |
| "y", | |
| "z", | |
| "1", | |
| "2", | |
| "3", | |
| "4", | |
| "5", | |
| "6", | |
| "7", | |
| "8", | |
| "9", | |
| "0" | |
| ] | |
| } | |
| }, | |
| "type": "DeepTextRecognition.DANTokenizer" | |
| } | |
| }, | |
| "order": [ | |
| "processing", | |
| "feature_extraction", | |
| "attention_module", | |
| "text_decoder", | |
| "tokenizer" | |
| ], | |
| "outputs": [ | |
| "tokenizer:labels", | |
| "tokenizer:probabilities" | |
| ], | |
| "routing": { | |
| "attention_module": { | |
| "inputs": [ | |
| "feature_extraction:extracted_features" | |
| ], | |
| "outputs": [ | |
| "attention_module:attention_features" | |
| ] | |
| }, | |
| "feature_extraction": { | |
| "inputs": [ | |
| "processing:processed_images" | |
| ], | |
| "outputs": [ | |
| "feature_extraction:extracted_features" | |
| ] | |
| }, | |
| "processing": { | |
| "inputs": [ | |
| "images" | |
| ], | |
| "outputs": [ | |
| "processing:processed_images" | |
| ] | |
| }, | |
| "text_decoder": { | |
| "inputs": [ | |
| "feature_extraction:extracted_features", | |
| "attention_module:attention_features" | |
| ], | |
| "outputs": [ | |
| "text_decoder:predictions", | |
| "text_decoder:lengths" | |
| ] | |
| }, | |
| "tokenizer": { | |
| "inputs": [ | |
| "text_decoder:predictions", | |
| "text_decoder:lengths" | |
| ], | |
| "outputs": [ | |
| "tokenizer:labels", | |
| "tokenizer:probabilities" | |
| ] | |
| } | |
| } | |
| } | |