OCRBench:评估多模态大模型的OCR能力

论文地址:OCRBench: On The Hidden Mystery of OCR In Large Multimodal Models:2305.07895

OCRBench在10个文本相关任务上测评多模态大模型(LMM)的OCR能力,包含1000个问题-答案对,每个问题-答案对包含以下五个类别:index(索引),image(图片),question(问题),answer(回答),category(问题类别)。其中问题类别主要有以下内容:

任务 翻译 image(图片)示例 question(问题)示例 answer(回答)示例 任务数量
Key Information Extraction 关键信息提取 what is the total amount of this receipt? Answer this question using the text in the image directly. ['26.58'] 200
Doc-oriented VQA 面向文档的视觉问答 Whats the Venue Name? ['the halfmoon'] 200
Scene Text-centric VQA 以场景文本为中心的视觉问答 What is the title of the book? ['PENDRAGON'] 200
Handwritten Mathematical Expression Recognition 手写数学表达式识别 Please write out the expression of the formula in the image using LaTeX format. ['x = \\frac { 1 7 } { 5 }\n'] 100
Irregular Text Recognition 不规则文本识别 what is written in the image? ['COFFEE'] 50
Regular Text Recognition 规则文本识别 what is written in the image? ['CHAIN'] 50
Non-Semantic Text Recognition 非语义文本识别 what is written in the image? ['espt'] 50
Digit String Recognition 数字字符串识别 what is the number in the image? ['9557'] 50
Handwriting Recognition 手写体识别 what is written in the image? ['bread'] 50
Artistic Text Recognition 艺术文本识别 what is written in the image? ['Home'] 50
Total 总计 - - - 1000

需要注意的是,在tsv文件中,图片使用Base64编码保存。Base64 编码可将二进制图像文件(PNG、JPEG、GIF)转换为紧凑的纯文本字符串,从而直接嵌入到 HTML、CSS 或 JSON 中。

要将Base64编码转换为图片,有以下三种方式:

(1)使用在线网站:例如:Base64 转图片转换器 -- 免费在线工具箱 - DopuBOX

(2)使用脚本:

python 复制代码
import base64

# 1. 复制 Base64 编码字符串
base64_data = "/9j/4AAQSkZJRgABAQAAAQABAAD/...(完整字符串)/ALz44+gHAooA/9k="

# 2. 解码并保存为图片
with open("output.jpg", "wb") as f:
    f.write(base64.b64decode(base64_data))

print("图片已保存为 output.jpg")

(3)浏览器直接预览

在 HTML 文件中使用以下代码:

html 复制代码
<img src="data:image/jpeg;base64,/9j/4AAQSkZJRgABAQ...(完整 Base64 字符串).../9k=">

用浏览器打开该 HTML 文件即可显示图片。


说明

  • 编码类型 :该字符串是 JPEG 图片 的 Base64 编码(以 /9j/ 开头)。

  • 注意事项 :确保复制完整的编码(从 /9j/ 到结束标记 /9k=),否则转换会失败。

相关推荐
好运的阿财1 分钟前
OpenClaw工具拆解之 sessions_list+sessions_history
人工智能·python·程序人生·ai·ai编程·openclaw
Westward-sun.2 分钟前
OpenCV 疲劳检测实战:用 dlib 计算眼睛纵横比 (EAR)
人工智能·opencv·计算机视觉·视觉检测
AI周红伟2 分钟前
Hermes Agent 工具-周红伟
linux·网络·人工智能·腾讯云·openclaw
杜子不疼.2 分钟前
Python + AI 实战:用 LangChain 搭建企业级 RAG 知识库
人工智能·python·langchain
阿杰学AI3 分钟前
AI核心知识118—大语言模型之 Software 2.0 (简洁且通俗易懂版)
人工智能·ai·语言模型·自然语言处理·aigc·编程·software 2.0
天天进步20153 分钟前
[核心篇] 视频一致性算法:Toonflow 是如何处理视频闪烁问题的?
人工智能
中科岩创3 分钟前
数字传感护华为数字能源大厦,控制加固施工安全风险!
人工智能·科技·物联网
甄心爱学习4 分钟前
【项目实训(个人3)】
vue.js·人工智能·python·个人开发
Bat U5 分钟前
JavaEE|计算机是如何工作的
java·人工智能
AI先驱体验官6 分钟前
BotCash:AI智能体变现从小 Demo 到商业产品的距离
大数据·人工智能·深度学习·重构·aigc