Views
No views yet
| Model | Model Storage Size(GB) | Total Score |
|---|---|---|
| PP-DocBee-2B | 4.2 | 765 |
| PP-DocBee-7B | 15.8 | - |
1# for CUDA11.8
2python -m pip install paddlepaddle-gpu==3.0.0 -i https://www.paddlepaddle.org.cn/packages/stable/cu118/
3
4# for CUDA12.6
5python -m pip install paddlepaddle-gpu==3.0.0 -i https://www.paddlepaddle.org.cn/packages/stable/cu126/
6
7# for CPU
8python -m pip install paddlepaddle==3.0.0 -i https://www.paddlepaddle.org.cn/packages/stable/cpu/python -m pip install paddleocr1paddleocr doc_vlm \
2 --model_name PP-DocBee-7B \
3 -i "{'image': 'https://cdn-uploads.huggingface.co/production/uploads/684acf07de103b2d44c85531/l5xpHbfLn75dKInhQZ84I.png', 'query': 'Recognize the content of this table and output it in markdown format.'}"1from paddleocr import DocVLM
2model = DocVLM(model_name="PP-DocBee-7B")
3results = model.predict(
4 input={
5 "image": "https://cdn-uploads.huggingface.co/production/uploads/684acf07de103b2d44c85531/l5xpHbfLn75dKInhQZ84I.png",
6 "query": "Recognize the content of this table and output it in markdown format."
7 },
8 batch_size=1
9)
10for res in results:
11 res.print()
12 res.save_to_json(f"./output/res.json"){'res': {'image': 'medal_table_en.png', 'query': 'Recognize the content of this table and output it in markdown format', 'result': '| Rank | Country/Region | Gold | Silver | Bronze | Total Medals |\n|---|---|---|---|---|---|\n| 1 | China (CHN) | 48 | 22 | 30 | 100 |\n| 2 | United States (USA) | 36 | 39 | 37 | 112 |\n| 3 | Russia (RUS) | 24 | 13 | 23 | 60 |\n| 4 | Great Britain (GBR) | 19 | 13 | 19 | 51 |\n| 5 | Germany (GER) | 16 | 11 | 14 | 41 |\n| 6 | Australia (AUS) | 14 | 15 | 17 | 46 |\n| 7 | South Korea (KOR) | 13 | 11 | 8 | 32 |\n| 8 | Japan (JPN) | 9 | 8 | 8 | 25 |\n| 9 | Italy (ITA) | 8 | 9 | 10 | 27 |\n| 10 | France (FRA) | 7 | 16 | 20 | 43 |\n| 11 | Netherlands (NED) | 7 | 5 | 4 | 16 |\n| 12 | Ukraine (UKR) | 7 | 4 | 11 | 22 |\n| 13 | Kenya (KEN) | 6 | 4 | 6 | 16 |\n| 14 | Spain (ESP) | 5 | 11 | 3 | 19 |\n| 15 | Jamaica (JAM) | 5 | 4 | 2 | 11 |\n'}}1| Rank | Country/Region | Gold | Silver | Bronze | Total Medals |
2|---|---|---|---|---|---|
3| 1 | China (CHN) | 48 | 22 | 30 | 100 |
4| 2 | United States (USA) | 36 | 39 | 37 | 112 |
5| 3 | Russia (RUS) | 24 | 13 | 23 | 60 |
6| 4 | Great Britain (GBR) | 19 | 13 | 19 | 51 |
7| 5 | Germany (GER) | 16 | 11 | 14 | 41 |
8| 6 | Australia (AUS) | 14 | 15 | 17 | 46 |
9| 7 | South Korea (KOR) | 13 | 11 | 8 | 32 |
10| 8 | Japan (JPN) | 9 | 8 | 8 | 25 |
11| 9 | Italy (ITA) | 8 | 9 | 10 | 27 |
12| 10 | France (FRA) | 7 | 16 | 20 | 43 |
13| 11 | Netherlands (NED) | 7 | 5 | 4 | 16 |
14| 12 | Ukraine (UKR) | 7 | 4 | 11 | 22 |
15| 13 | Kenya (KEN) | 6 | 4 | 6 | 16 |
16| 14 | Spain (ESP) | 5 | 11 | 3 | 19 |
17| 15 | Jamaica (JAM) | 5 | 4 | 2 | 11 |paddleocr doc_understanding -i "{'image': 'https://cdn-uploads.huggingface.co/production/uploads/684acf07de103b2d44c85531/l5xpHbfLn75dKInhQZ84I.png', 'query': 'Recognize the content of this table and output it in markdown format.'}"{'res': {'image': 'medal_table_en.png', 'query': 'Recognize the content of this table and output it in markdown format', 'result': '| Rank | Country/Region | Gold | Silver | Bronze | Total Medals |\n|---|---|---|---|---|---|\n| 1 | China (CHN) | 48 | 22 | 30 | 100 |\n| 2 | United States (USA) | 36 | 39 | 37 | 112 |\n| 3 | Russia (RUS) | 24 | 13 | 23 | 60 |\n| 4 | Great Britain (GBR) | 19 | 13 | 19 | 51 |\n| 5 | Germany (GER) | 16 | 11 | 14 | 41 |\n| 6 | Australia (AUS) | 14 | 15 | 17 | 46 |\n| 7 | South Korea (KOR) | 13 | 11 | 8 | 32 |\n| 8 | Japan (JPN) | 9 | 8 | 8 | 25 |\n| 9 | Italy (ITA) | 8 | 9 | 10 | 27 |\n| 10 | France (FRA) | 7 | 16 | 20 | 43 |\n| 11 | Netherlands (NED) | 7 | 5 | 4 | 16 |\n| 12 | Ukraine (UKR) | 7 | 4 | 11 | 22 |\n| 13 | Kenya (KEN) | 6 | 4 | 6 | 16 |\n| 14 | Spain (ESP) | 5 | 11 | 3 | 19 |\n| 15 | Jamaica (JAM) | 5 | 4 | 2 | 11 |\n'}}save_path. The visualization output is shown below:
1from paddleocr import DocUnderstanding
2
3pipeline = DocUnderstanding(
4 doc_understanding_model_name="PP-DocBee-7B"
5)
6output = pipeline.predict(
7 {
8 "image": "https://cdn-uploads.huggingface.co/production/uploads/684acf07de103b2d44c85531/l5xpHbfLn75dKInhQZ84I.png",
9 "query": "Recognize the content of this table and output it in markdown format."
10 }
11)
12for res in output:
13 res.print() ## Print the structured output of the prediction
14 res.save_to_json("./output/")PP-DocBee2-3B, so you need to specify doc_understanding_model_name to PP-DocBee-7B. And you can also use the local model file by argument doc_understanding_model_dir. For details about usage command and descriptions of parameters, please refer to the Document.