赛题名称:图片文本块检测挑战赛 赛题类型:计算机视觉 赛题链接👇:
https://challenge.xfyun.cn/topic/info?type=image-text&ch=vWxQGFU
图片文本块检测是指检测出图片中完整且位置独立的文本块,并输出对应位置的任务,属于图片文档分析(Document Image Analysis,包括文档版面分析、表格检测等)中的任务之一,近年来业界相关的工作有 LayoutParser、LayoutLM、LayoutLM2等。
图片文本块检测具有广泛的应用价值,例如:在生活、工作拍照翻译场景中,如果直接利用行粒度的识别结果做下游的翻译任务,会出现单行信息不完整,导致翻译结果信息缺失。


本赛题提供非受限场景,可使用任何数据资源和模型,在提供的测试集中进行推理,按要求返回数据进行评测,数据格式详见3.1。本赛题提供数据如下:
训练集:无 验证集:17张图片以及标注文件(用于示例) 测试集:200张评测图片
注:验证集、测试集仅中、英两个场景
标签文件txt格式为:class_name xmin ymin xmax ymax
采用F1-Score(IoU = 0.5)作为评估指标。
赛题是一个典型的版面识别赛题,因此可以考虑使用paddleocr来完成识别:
!pip3 install "paddleocr>=2.6.0.3"
# 模型预测
import glob
import subprocess
for path in glob.glob('/home/aistudio/图片文本块检测挑战赛公开数据/测试集A/images/*'):
path = path.replace('(', '\(').replace(')', '\)')
subprocess.check_output(
f"paddleocr --image_dir={path} --type=structure --table=false --ocr=false",
shell=True
)
# 打包结果
!mkdir submit
import json
for path in glob.glob('/home/aistudio/图片文本块检测挑战赛公开数据/测试集A/images/*'):
tags = open('output/' + path.split('/')[-1][:-4] + '/res_0.txt').readlines()
tags = [json.loads(x)['bbox'] for x in tags]
with open('submit/' + path.split('/')[-1][:-4] + '.txt', 'w') as up:
for tag in tags:
up.write("blocks " + ' '.join([str(x) for x in tag]) + ' 1.0\n')
!\rm submit.zip
!\rm -rf submit/.ipynb_checkpoints/
!zip -r submit.zip submit
代码链接:https://aistudio.baidu.com/projectdetail/6677815?contributionType=1
# 竞赛交流群 邀请函 #

每天大模型、算法竞赛、干货资讯

内容中包含的图片若涉及版权问题,请及时与我们联系删除


评论
沙发等你来抢