偷偷摘套内射激情视频,久久精品99国产国产精,中文字幕无线乱码人妻,中文在线中文a,性爽19p

字節(jié)開源Dolphin文檔解析模型-部署指南+實(shí)戰(zhàn)測試

發(fā)布于 2025-6-11 06:39
瀏覽
0收藏

在數(shù)字化辦公席卷全球的今天,文檔解析技術(shù)已成為企業(yè)數(shù)字化轉(zhuǎn)型的關(guān)鍵瓶頸。面對海量的合同、報(bào)告、論文等文檔資料,傳統(tǒng)解決方案要么速度緩慢,要么錯(cuò)誤百出。5月22日,字節(jié)跳動(dòng)開源的全新文檔解析模型Dolphin橫空出世,憑借僅322M參數(shù)的輕量級(jí)架構(gòu),在性能上實(shí)現(xiàn)了對GPT-4.1、Claude3.5等重量級(jí)模型的全面超越!

github: https://github.com/bytedance/Dolphin

在線Demo:  http://115.190.42.15:8888/dolphin

下面開始部署指南:

一、安裝依賴環(huán)境

# 下載代碼

git clone https://github.com/ByteDance/Dolphin.git
cd Dolphin


# 創(chuàng)建虛擬環(huán)境
conda create -n Dolphin  python=3.11

# 激活虛擬環(huán)境
conda activate Dolphin 


# 安裝uv

pip install uv -i https://pypi.tuna.tsinghua.edu.cn/simple/


# 修改numpy版本
先修改requirements.txt文件,否則會(huì)報(bào)錯(cuò),報(bào)錯(cuò)信息放在了文末:
把numpy==1.24.4  改為  numpy==1.26.0


# 安裝requirements.txt依賴包

uv pip install -r requirements.txt  -i https://pypi.tuna.tsinghua.edu.cn/simple/

二、下載模型權(quán)重

選項(xiàng)A:原始模型格式(基于配置)

從百度云或谷歌驅(qū)動(dòng)器下載,并將它們放在。/checkpoint文件夾中。

百度網(wǎng)盤:??https://pan.baidu.com/share/init?surl=5zcARoX0CTOHKbW8bFZovQ&pwd=9rpx??

谷歌云盤:??https://drive.google.com/drive/folders/1PQJ3UutepXvunizZEw-uGaQ0BCzf-mie??

選項(xiàng)B:Huggingface模型格式

huggingface模型地址:??https://huggingface.co/ByteDance/Dolphin??

魔搭的模型地址:??https://www.modelscope.cn/models/ByteDance/Dolphin??

#從Hugging Face Hub下載模型

Git LFS安裝

git clone https://huggingface.co/ByteDance/Dolphin ./hf_model

本文采用選項(xiàng)A:原始模型格式,百度網(wǎng)盤下載模型權(quán)重,放入checkpoints 目錄中;

字節(jié)開源Dolphin文檔解析模型-部署指南+實(shí)戰(zhàn)測試-AI.x社區(qū)

三、實(shí)戰(zhàn)測試效果

模型推理的配置文件:

字節(jié)開源Dolphin文檔解析模型-部署指南+實(shí)戰(zhàn)測試-AI.x社區(qū)

1、頁面級(jí)解析(Page-level Parsing)

字節(jié)開源Dolphin文檔解析模型-部署指南+實(shí)戰(zhàn)測試-AI.x社區(qū)

解析單個(gè)文檔圖片(page_1.jpeg)

python demo_page.py --config ./config/Dolphin.yaml --input_path ./demo/page_imgs/page_1.jpeg --save_dir ./results

輸出結(jié)果:

字節(jié)開源Dolphin文檔解析模型-部署指南+實(shí)戰(zhàn)測試-AI.x社區(qū)

顯存占用量高達(dá)15g多;

字節(jié)開源Dolphin文檔解析模型-部署指南+實(shí)戰(zhàn)測試-AI.x社區(qū)

處理一個(gè)目錄中的所有文檔圖像

字節(jié)開源Dolphin文檔解析模型-部署指南+實(shí)戰(zhàn)測試-AI.x社區(qū)

json和md文件都會(huì)生成一份;

python demo_page.py --config ./config/Dolphin.yaml --input_path ./demo/page_imgs --save_dir ./results

運(yùn)行日志截圖:

字節(jié)開源Dolphin文檔解析模型-部署指南+實(shí)戰(zhàn)測試-AI.x社區(qū)

顯存截圖:顯存占用量最高達(dá)到17g;

字節(jié)開源Dolphin文檔解析模型-部署指南+實(shí)戰(zhàn)測試-AI.x社區(qū)

2、元素級(jí)解析(Element-level Parsing)

Using Original Framework (config-based)

# Process a single table image
python demo_element.py --config ./config/Dolphin.yaml --input_path ./demo/element_imgs/table_1.jpeg --element_type table

# Process a single formula image
python demo_element.py --config ./config/Dolphin.yaml --input_path ./demo/element_imgs/line_formula.jpeg --element_type formula

# Process a single text paragraph image
python demo_element.py --config ./config/Dolphin.yaml --input_path ./demo/element_imgs/para_1.jpg --element_type text

# Process a single table image 顯存截圖

字節(jié)開源Dolphin文檔解析模型-部署指南+實(shí)戰(zhàn)測試-AI.x社區(qū)

# Process a single formula image  顯存截圖

字節(jié)開源Dolphin文檔解析模型-部署指南+實(shí)戰(zhàn)測試-AI.x社區(qū)

1、單個(gè)段落處理

字節(jié)開源Dolphin文檔解析模型-部署指南+實(shí)戰(zhàn)測試-AI.x社區(qū)

結(jié)果:

字節(jié)開源Dolphin文檔解析模型-部署指南+實(shí)戰(zhàn)測試-AI.x社區(qū)

2、單個(gè)表格處理

字節(jié)開源Dolphin文檔解析模型-部署指南+實(shí)戰(zhàn)測試-AI.x社區(qū)

結(jié)果:

字節(jié)開源Dolphin文檔解析模型-部署指南+實(shí)戰(zhàn)測試-AI.x社區(qū)

字節(jié)開源Dolphin文檔解析模型-部署指南+實(shí)戰(zhàn)測試-AI.x社區(qū)

把md文件,在線解析一下看看,表格還原程度如何:

模型解析的md結(jié)果:

字節(jié)開源Dolphin文檔解析模型-部署指南+實(shí)戰(zhàn)測試-AI.x社區(qū)

原始圖片的:

字節(jié)開源Dolphin文檔解析模型-部署指南+實(shí)戰(zhàn)測試-AI.x社區(qū)

結(jié)果竟然是正確的,效果很厲害!

3、單行公式處理

字節(jié)開源Dolphin文檔解析模型-部署指南+實(shí)戰(zhàn)測試-AI.x社區(qū)

結(jié)果:

字節(jié)開源Dolphin文檔解析模型-部署指南+實(shí)戰(zhàn)測試-AI.x社區(qū)

字節(jié)開源Dolphin文檔解析模型-部署指南+實(shí)戰(zhàn)測試-AI.x社區(qū)

部署中常見的錯(cuò)誤:

numpy==1.24.4  與opencv-pythnotallow==4.11.0.86 版本沖突的報(bào)錯(cuò)信息:

and opencv-pythnotallow==4.11.0.86 depends on numpy>=1.26.0, we can conclude that opencv-pythnotallow==4.11.0.86 depends on numpy>=1.26.0.

And because you require numpy==1.24.4 and opencv-pythnotallow==4.11.0.86, we can conclude that your requirements are unsatisfiable.

解決方案:

修改numpy版本

先修改requirements.txt文件:

把numpy==1.24.4  改為  numpy==1.26.0

總結(jié):本文手把手教學(xué),從零開始安裝Dolphin項(xiàng)目,使用官方示例代碼,測試過程中發(fā)現(xiàn),元素級(jí)解析顯存占用5G左右,頁面級(jí)解析顯存占用到達(dá)17G,這個(gè)確實(shí)令人驚訝,不過看著效果還可以的,尤其是表格解析,挺不錯(cuò)的,快來一起本地部署使用吧!

本文轉(zhuǎn)載自??????AI小新??????,作者:AI小新

收藏
回復(fù)
舉報(bào)
回復(fù)
相關(guān)推薦