Ucas-HaoranWei / GOT-OCR2.0

Official code implementation of General OCR Theory: Towards OCR-2.0 via a Unified End-to-end Model
3.92k stars 302 forks source link

Scene text OCR performance 有问题 #40

Closed yyyyyxie closed 6 days ago

yyyyyxie commented 1 week ago

image 大佬,我有个疑惑,论文这里的评估我得到的中文结果F1只有 80,英文F1只有 20 多(其他指标也都很低),使用的是--datatype OCR。不知道是我选择错了评估方式还是其他原因。

cn: { "eval question num": 603, "bleu": 0.15852079095502944, "meteor": 0.6955505241626702, "f_measure": 0.8001939900604479, "precision": 0.8232468609334285, "recall": 0.80041261944247, "edit_dist": 0.1486647123494855 }

en: { "eval question num": 1407, "bleu": 3.1196824934773723e-80, "meteor": 0.11758307321651489, "f_measure": 0.21838366166724377, "precision": 0.25041459369817576, "recall": 0.21360459606728258, "edit_dist": 0.4739556215822536 }

Ucas-HaoranWei commented 1 week ago

这是因为你用的单词级别的分词吧,对于自然场景文本,文字非常短,需要用字符级别的分词,如text要分成t,e,x,t计算指标,相关计算在论文里有写,character segment

yyyyyxie commented 1 week ago

这是因为你用的单词级别的分词吧,对于自然场景文本,文字非常短,需要用字符级别的分词,如text要分成t,e,x,t计算指标,相关计算在论文里有写,character segment

感谢您的解答,确实这里需要注意修改一下评估的type,将plain改成scene后,评估结果就比较正常了;但是Scene text英文指标似乎仍然有较大差别,F1 score只有 60 多~ 不知道哪里可能出现了异常

{ "eval question num": 2010, "bleu": 0.3768598715790712, "meteor": 0.5662809277235715, "f_measure": 0.6498719748390631, "precision": 0.8432641432641435, "recall": 0.5684595824613625, "edit_dist": 0.4739556215822549 }

Ucas-HaoranWei commented 1 week ago

我测试下,另外请问你改了prompt了吗,默认的eval是"OCR with format: " 需要改成纯"OCR: "

yyyyyxie commented 1 week ago

我是用的是这行命令,-datatype OCR;完整命令如下 python3 GOT/eval/evaluate_GOT.py --model-name /GOT_weights/ --gtfile_path benchmarks/scene/natural_page_ocr_en_final_open.json --image_path benchmarks/scene/natural_page_ocr_en_final_open --out_path /data/eval_results/ --num-chunks 1 --datatype OCR

另外我检查了一下输出:在输出文件resutls_final.json中有 \text{} 这种输出,我发现将这个格式符号去掉后性能取得了一定的提升

image
Ucas-HaoranWei commented 1 week ago

有这个说明测错了,测成format了,需要修改L231行

image