| { | |
| "inputs": [ | |
| "images" | |
| ], | |
| "modules": { | |
| "avg_pool": { | |
| "config": { | |
| "args": { | |
| "output_size": [ | |
| null, | |
| 1 | |
| ] | |
| } | |
| }, | |
| "type": "DeepTextRecognition.AdaptiveAvgPoolModule" | |
| }, | |
| "feature_extraction": { | |
| "config": { | |
| "args": { | |
| "input_channel": 1, | |
| "output_channel": 512, | |
| "variant": "DTRB" | |
| } | |
| }, | |
| "type": "DeepTextRecognition.ResNetModel" | |
| }, | |
| "permute": { | |
| "config": { | |
| "args": { | |
| "dims": [ | |
| 0, | |
| 3, | |
| 1, | |
| 2 | |
| ] | |
| } | |
| }, | |
| "type": "DeepTextRecognition.PermuteModule" | |
| }, | |
| "prediction": { | |
| "config": { | |
| "args": { | |
| "N_max_character": 26, | |
| "n_class": 38, | |
| "n_position": 26 | |
| } | |
| }, | |
| "type": "DeepTextRecognition.SRNDecoder" | |
| }, | |
| "processing": { | |
| "config": { | |
| "args": { | |
| "channels_size": 1, | |
| "image_size": [ | |
| 32, | |
| 100 | |
| ], | |
| "padding": "left" | |
| } | |
| }, | |
| "type": "DeepTextRecognition.ImageProcessor" | |
| }, | |
| "sequence_modeling": { | |
| "config": { | |
| "args": { | |
| "d_inner": 1024, | |
| "d_k": 64, | |
| "d_model": 512, | |
| "d_v": 64, | |
| "dropout": 0.1, | |
| "n_head": 8, | |
| "n_layers": 2, | |
| "n_position": 26 | |
| } | |
| }, | |
| "type": "DeepTextRecognition.TransformerEncoderv1" | |
| }, | |
| "squeeze": { | |
| "config": { | |
| "args": { | |
| "dim": 3 | |
| } | |
| }, | |
| "type": "DeepTextRecognition.SqueezeModule" | |
| }, | |
| "tokenizer": { | |
| "config": { | |
| "args": { | |
| "characters": [ | |
| "0", | |
| "1", | |
| "2", | |
| "3", | |
| "4", | |
| "5", | |
| "6", | |
| "7", | |
| "8", | |
| "9", | |
| "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" | |
| ], | |
| "max_length": 25, | |
| "pad_token": 36 | |
| } | |
| }, | |
| "type": "DeepTextRecognition.SRNTokenizer" | |
| } | |
| }, | |
| "order": [ | |
| "processing", | |
| "feature_extraction", | |
| "permute", | |
| "avg_pool", | |
| "squeeze", | |
| "sequence_modeling", | |
| "prediction", | |
| "tokenizer" | |
| ], | |
| "outputs": [ | |
| "tokenizer:labels" | |
| ], | |
| "routing": { | |
| "avg_pool": { | |
| "inputs": [ | |
| "permute:permuted_features" | |
| ], | |
| "outputs": [ | |
| "avg_pool:pooled_features" | |
| ] | |
| }, | |
| "feature_extraction": { | |
| "inputs": [ | |
| "processing:processed_images" | |
| ], | |
| "outputs": [ | |
| "feature_extraction:extracted_features" | |
| ] | |
| }, | |
| "permute": { | |
| "inputs": [ | |
| "feature_extraction:extracted_features" | |
| ], | |
| "outputs": [ | |
| "permute:permuted_features" | |
| ] | |
| }, | |
| "prediction": { | |
| "inputs": [ | |
| "sequence_modeling:modeled_features" | |
| ], | |
| "outputs": [ | |
| "prediction:predictions_1", | |
| "prediction:predictions_2", | |
| "prediction:predictions_3" | |
| ] | |
| }, | |
| "processing": { | |
| "inputs": [ | |
| "images" | |
| ], | |
| "outputs": [ | |
| "processing:processed_images" | |
| ] | |
| }, | |
| "sequence_modeling": { | |
| "inputs": [ | |
| "squeeze:squeezed_features" | |
| ], | |
| "outputs": [ | |
| "sequence_modeling:modeled_features" | |
| ] | |
| }, | |
| "squeeze": { | |
| "inputs": [ | |
| "avg_pool:pooled_features" | |
| ], | |
| "outputs": [ | |
| "squeeze:squeezed_features" | |
| ] | |
| }, | |
| "tokenizer": { | |
| "inputs": [ | |
| "prediction:predictions_3" | |
| ], | |
| "outputs": [ | |
| "tokenizer:labels" | |
| ] | |
| } | |
| } | |
| } | |