mmocr icon indicating copy to clipboard operation
mmocr copied to clipboard

制作的中文字符json标签在识别训练的数据读取时出现格式错误

Open hzj0913 opened this issue 2 years ago • 9 comments

Branch

master branch https://mmocr.readthedocs.io/en/latest/

📚 The doc issue

请问要怎样训练自己的中文字符识别模型? 我按照MMOCR的格式写的脚本制作的数据集,但是在训练时,出现json文件中中文的读取错误: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xba in position 2443: invalid start byte 我把encoding模式设置为"gbk",会出现输入特征维度不匹配的问题

Suggest a potential alternative/fix

No response

hzj0913 avatar Jun 25 '23 10:06 hzj0913

We recommend using English or English & Chinese for issues so that we could have broader discussion.

mm-assistant[bot] avatar Jun 25 '23 10:06 mm-assistant[bot]

部分标签如下: { "img_path": "trainRecImage/BE01F5286606B4CCB2AD82FDD4936E532003398-4.bmp", "instances": [ { "text": "合" } ] }, { "img_path": "trainRecImage/BE01F5286606B4CCB2AD82FDD4936E532003398-5.bmp", "instances": [ { "text": "格" } ] },

hzj0913 avatar Jun 25 '23 10:06 hzj0913

单纯的编码问题吧,我中文数据集训练过 很健康

xiaomaofeng avatar Jun 29 '23 08:06 xiaomaofeng

单纯的编码问题吧,我中文数据集训练过 很健康

我目前的标签是utf-8的json,请问我是需要修改标签json的编码方式还是在修改读取数据时load函数的编码方式呢

hzj0913 avatar Jul 07 '23 08:07 hzj0913

单纯的编码问题吧,我中文数据集训练过 很健康

我目前的标签是utf-8的json,请问我是需要修改标签json的编码方式还是在修改读取数据时load函数的编码方式呢

改读取,很多库对包含中文数据的文件兼容性没那么好的,自己改下就好了。

xiaomaofeng avatar Jul 07 '23 08:07 xiaomaofeng

单纯的编码问题吧,我中文数据集训练过 很健康

我目前的标签是utf-8的json,请问我是需要修改标签json的编码方式还是在修改读取数据时load函数的编码方式呢

改读取,很多库对包含中文数据的文件兼容性没那么好的,自己改下就好了。

okok,非常感谢!

hzj0913 avatar Jul 07 '23 09:07 hzj0913

单纯的编码问题吧,我中文数据集训练过 很健康

请问您是如何标注数据的,使用什么标注工具吗,格式是不是需要转化,我看了数据集准备,有点蒙,可以指导以下吗

jingmingtao avatar Sep 23 '23 04:09 jingmingtao

单纯的编码问题吧,我中文数据集训练过 很健康

大哥,求求你,我自己使用paddleocr标注的数据,想使用mmocr训练,格式转换亚

jingmingtao avatar Sep 23 '23 07:09 jingmingtao

you can use the icdar_text_parser.py to parse the dataset from the dataset obtained by paddleocr, but the format may be a little different. the gt text format in paddocr is (topleft,x,y ; topright,x,y; bottomright,x,y bottomleft,x,y; isdifficult; text)

xiaomaofeng avatar Oct 08 '23 06:10 xiaomaofeng