Upload anytext.py
Browse files- anytext.py +4 -4
anytext.py
CHANGED
@@ -349,11 +349,11 @@ def create_predictor(model_lang="ch", device="cpu", use_fp16=False):
|
|
349 |
n_class = 97
|
350 |
else:
|
351 |
raise ValueError(f"Unsupported OCR recog model_lang: {model_lang}")
|
352 |
-
rec_config =
|
353 |
in_channels=3,
|
354 |
-
backbone=
|
355 |
-
neck=
|
356 |
-
head=
|
357 |
)
|
358 |
|
359 |
rec_model = RecModel(rec_config)
|
|
|
349 |
n_class = 97
|
350 |
else:
|
351 |
raise ValueError(f"Unsupported OCR recog model_lang: {model_lang}")
|
352 |
+
rec_config = dict(
|
353 |
in_channels=3,
|
354 |
+
backbone=dict(type="MobileNetV1Enhance", scale=0.5, last_conv_stride=[1, 2], last_pool_type="avg"),
|
355 |
+
neck=dict(type="SequenceEncoder", encoder_type="svtr", dims=64, depth=2, hidden_dims=120, use_guide=True),
|
356 |
+
head=dict(type="CTCHead", fc_decay=0.00001, out_channels=n_class, return_feats=True),
|
357 |
)
|
358 |
|
359 |
rec_model = RecModel(rec_config)
|