Closed tangjinou closed 2 years ago
Please use English or English & Chinese for issues so that we could have broader discussion.
Hi, MMOCR currently provides a pre-trained SAR model for Chinese recognition. More pre-trained models for Chinese and multi-lingual detection & recognition are on the way; please stay tuned.
Hi, MMOCR currently provides a pre-trained SAR model for Chinese recognition. More pre-trained models for Chinese and multi-lingual detection & recognition are on the way; please stay tuned.
OK, when I use SAR_CN, like this "python mmocr/utils/ocr.py demo/word_1.jpg --recog SAR_CN --output demo/"
something error happened like this
"FileNotFoundError: SARNet: AttnConvertor: [Errno 2] No such file or directory: 'data/chineseocr/labels/dict_printed_chinese_english_digits.txt'"
here is detail:
root@3b5cb35cb3b4:/mmocr# python mmocr/utils/ocr.py demo/word_1.jpg --recog SAR_CN --output demo/ load checkpoint from http path: https://download.openmmlab.com/mmocr/textdet/panet/panet_r18_fpem_ffm_sbn_600e_icdar2015_20210219-42dbe46a.pth Traceback (most recent call last): File "/opt/conda/lib/python3.8/site-packages/mmcv/utils/registry.py", line 52, in build_from_cfg return obj_cls(**args) File "/mmocr/mmocr/models/textrecog/convertors/attn.py", line 36, in init super().init(dict_type, dict_file, dict_list) File "/mmocr/mmocr/models/textrecog/convertors/base.py", line 38, in init for line_num, line in enumerate(list_from_file(dict_file)): File "/mmocr/mmocr/utils/fileio.py", line 35, in list_from_file with open(filename, 'r', encoding=encoding) as f: FileNotFoundError: [Errno 2] No such file or directory: 'data/chineseocr/labels/dict_printed_chinese_english_digits.txt'
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/opt/conda/lib/python3.8/site-packages/mmcv/utils/registry.py", line 52, in build_from_cfg return obj_cls(**args) File "/mmocr/mmocr/models/textrecog/recognizer/encode_decode_recognizer.py", line 34, in init self.label_convertor = build_convertor(label_convertor) File "/mmocr/mmocr/models/builder.py", line 37, in build_convertor return build_from_cfg(cfg, CONVERTORS) File "/opt/conda/lib/python3.8/site-packages/mmcv/utils/registry.py", line 55, in build_from_cfg raise type(e)(f'{obj_cls.name}: {e}') FileNotFoundError: AttnConvertor: [Errno 2] No such file or directory: 'data/chineseocr/labels/dict_printed_chinese_english_digits.txt'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "mmocr/utils/ocr.py", line 861, in
You have to first download the Chinese dict and put it to the correct path.
You have to first download the Chinese dict and put it to the correct path.
why I use other reg models like sar and crnn etc , the model will be downloaded ? It seems only sar_cn have this problem?
You have to first download the Chinese dict and put it to the correct path.
when I use wget "https://download.openmmlab.com/mmocr/textrecog/sar/dict_printed_chinese_english_digits.txt" to /data/chineseocr/labels/ , It seems ok;
But the result is not OK,
Hi, I ran the following command on the provided image and the result looks fine.
python mmocr/utils/ocr.py demo.png --det None --recog SAR_CN --output out.png
```shell python mmocr/utils/ocr.py demo.png --det None --recog SAR_CN --output out.png
OK, it seems "python mmocr/utils/ocr.py demo/word_1.jpg --recog SAR_CN --output demo/out.png" is not ok
but "python mmocr/utils/ocr.py demo/word_1.jpg --det None --recog SAR_CN --output demo/out.png" is ok
the difference is only if use "--det None"
BTW, Is any det model with chinese?
None
here, it will use PANet_IC15
as the detector by default.MaskRCNN_IC17
), since this is a multilingual dataset containing Chinese training samples.
- Yes, since your input is a cropped image, it is unnecessary to use a detection model; if the det model is not specified to
None
here, it will usePANet_IC15
as the detector by default.- MMOCR currently does not provide a Chinese-specific pre-trained model for the detector, however, you may try the model pre-trained on ICDAR2017 (such as
MaskRCNN_IC17
), since this is a multilingual dataset containing Chinese training samples.
1 It's OK . May be some tips without reading code or Answering question will be fine. 3ks. 2 MaskRCNN is old and slow, any other models will be given?
Currently, released detection models are primarily trained on English data. However, they can be used for Chinese detection as well, please have a try. If you have your own Chinese data, it might be better to train your own model for the best performance. In addition, we are going to release more Chinese models soon, please stay tuned.
Please also refer to issues #243 and #712.
Currently, released detection models are primarily trained on English data. However, they can be used for Chinese detection as well, please have a try. If you have your own Chinese data, it might be better to train your own model for the best performance. In addition, we are going to release more Chinese models soon, please stay tuned.
Please also refer to issues #243 and #712.
OK 3KS
如题
英文的检测和识别运行得较好,但中文的检测和识别没有发现任何文档或pretrain的模型