Text-to-Image
Diffusers
Safetensors
tolgacangoz commited on
Commit
144f084
·
verified ·
1 Parent(s): d7677d3

Upload anytext.py

Browse files
Files changed (1) hide show
  1. 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 = 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)
 
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)