Text-to-Image
Diffusers
Safetensors
tolgacangoz commited on
Commit
cfc5504
·
verified ·
1 Parent(s): 72a08f7

Upload anytext.py

Browse files
Files changed (1) hide show
  1. text_embedding_module/anytext.py +5 -0
text_embedding_module/anytext.py CHANGED
@@ -471,6 +471,11 @@ class TextEmbeddingModule(nn.Module):
471
  args["rec_image_shape"] = "3, 48, 320"
472
  args["rec_batch_num"] = 6
473
  args["rec_char_dict_path"] = "./text_embedding_module/OCR/ppocr_keys_v1.txt"
 
 
 
 
 
474
  args["use_fp16"] = use_fp16
475
  self.embedding_manager.recog = TextRecognizer(args, self.text_predictor)
476
 
 
471
  args["rec_image_shape"] = "3, 48, 320"
472
  args["rec_batch_num"] = 6
473
  args["rec_char_dict_path"] = "./text_embedding_module/OCR/ppocr_keys_v1.txt"
474
+ args["rec_char_dict_path"] = hf_hub_download(
475
+ repo_id="tolgacangoz/anytext",
476
+ filename="text_embedding_module/OCR/ppocr_keys_v1.txt",
477
+ cache_dir=HF_MODULES_CACHE
478
+ )
479
  args["use_fp16"] = use_fp16
480
  self.embedding_manager.recog = TextRecognizer(args, self.text_predictor)
481