Upload 7 files
Browse files- .gitattributes +2 -0
- README.md +133 -3
- README_en.md +134 -0
- assets/sample1.jpg +3 -0
- det/anytable-det-rtdetr-l-imgsz960.pt +3 -0
- det/anytable-det-yolo11m-imgsz960.pt +3 -0
- det/anytable-det-yolo12s-imgsz960.pt +3 -0
- zanshan.jpg +3 -0
.gitattributes
CHANGED
@@ -33,3 +33,5 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
36 |
+
assets/sample1.jpg filter=lfs diff=lfs merge=lfs -text
|
37 |
+
zanshan.jpg filter=lfs diff=lfs merge=lfs -text
|
README.md
CHANGED
@@ -1,3 +1,133 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# AnyTable
|
2 |
+
|
3 |
+
<a href="https://huggingface.co/oriforge/anytable" target="_blank"><img src="https://img.shields.io/badge/%F0%9F%A4%97-HuggingFace-blue"></a>
|
4 |
+
<a href="https://www.modelscope.cn/models/oriforge/table" target="_blank"><img alt="Static Badge" src="https://img.shields.io/badge/%E9%AD%94%E6%90%AD-ModelScope-blue"></a>
|
5 |
+
<a href=""><img src="https://img.shields.io/badge/Python->=3.6-aff.svg"></a>
|
6 |
+
<a href=""><img src="https://img.shields.io/badge/OS-Linux%2C%20Win%2C%20Mac-pink.svg"></a>
|
7 |
+
<a href=""><img alt="Static Badge" src="https://img.shields.io/badge/engine-cpu_gpu_onnxruntime-blue"></a>
|
8 |
+
|
9 |
+
```
|
10 |
+
___ ______ __ __
|
11 |
+
/ | ____ __ _/_ __/___ _/ /_ / /__
|
12 |
+
/ /| | / __ \/ / / // / / __ `/ __ \/ / _ \
|
13 |
+
/ ___ |/ / / / /_/ // / / /_/ / /_/ / / __/
|
14 |
+
/_/ |_/_/ /_/\__, //_/ \__,_/_.___/_/\___/
|
15 |
+
/____/
|
16 |
+
|
17 |
+
```
|
18 |
+
|
19 |
+
简体中文 | [English](./README_en.md)
|
20 |
+
|
21 |
+
<div align="left">
|
22 |
+
<img src="./assets/sample1.jpg">
|
23 |
+
</div>
|
24 |
+
|
25 |
+
|
26 |
+
## 1. 简介
|
27 |
+
|
28 |
+
AnyTable是一个专注于从文档或者图片中表格解析的模型工具,主要分成两个部分:
|
29 |
+
- anytable-det:用于表格区域检测(已开放)
|
30 |
+
- anytable-rec:用于表格结构识别(未来开放)
|
31 |
+
|
32 |
+
项目地址:
|
33 |
+
- github地址:[AnyTable](https://github.com/oriforge/anytable)
|
34 |
+
- Hugging Face: [AnyTable](https://huggingface.co/oriforge/anytable)
|
35 |
+
- ModelScope: [AnyTable](https://www.modelscope.cn/models/oriforge/anytable)
|
36 |
+
|
37 |
+
## 2. 缘起
|
38 |
+
|
39 |
+
目前市面上表格数据非常多且混杂,很难有一个干净的完整数据和模型,为此我们收集并整理了很多表格数据,训练了我们的模型。
|
40 |
+
|
41 |
+
检测数据集分布:
|
42 |
+
|
43 |
+
- pubtables: 947642
|
44 |
+
- synthtabnet.marketing: 149999
|
45 |
+
- tablebank: 278582
|
46 |
+
- fintabnet.c: 97475
|
47 |
+
- pubtabnet: 519030
|
48 |
+
- synthtabnet.sparse: 150000
|
49 |
+
- synthtabnet.fintabnet: 149999
|
50 |
+
- docbank: 24517
|
51 |
+
- synthtabnet.pubtabnet: 150000
|
52 |
+
- cTDaRTRACKA: 1639
|
53 |
+
- SciTSR: 14971
|
54 |
+
- doclaynet.large: 21185
|
55 |
+
- IIITAR13K: 9905
|
56 |
+
- selfbuilt: 121157
|
57 |
+
|
58 |
+
数据集总计:大于`2.6M`(大约2633869张图片)。
|
59 |
+
|
60 |
+
### 扩展训练
|
61 |
+
|
62 |
+
- 训练集:`2.6M(大于10万的部分只抽样了42000, 没办法因为贫穷,卡有限。)`
|
63 |
+
- 测试集:`4k`
|
64 |
+
- python: 3.12
|
65 |
+
- pytorch: 2.6.0
|
66 |
+
- cuda: 12.3
|
67 |
+
- ultralytics: 8.3.128
|
68 |
+
|
69 |
+
### 模型介绍
|
70 |
+
|
71 |
+
表格检测模型位于det文件夹下:
|
72 |
+
- yolo系列:使用ultralytics训练yolo检测
|
73 |
+
- rt-detr:使用ultralytics训练rt-detr检测
|
74 |
+
|
75 |
+
注释:您可以直接模型预测,也可以作为预训练模型微调私有数据集
|
76 |
+
|
77 |
+
### 评估
|
78 |
+
|
79 |
+
自建评估集:`4K`
|
80 |
+
|
81 |
+
| model | imgsz | epochs | metrics/precision |
|
82 |
+
|---|---|---|---|
|
83 |
+
|rt-detr-l|960|10|0.97|
|
84 |
+
|yolo11s|960|10|-|
|
85 |
+
|yolo11m|960|10|0.964|
|
86 |
+
|yolo12s|960|10|0.978|
|
87 |
+
|
88 |
+
|
89 |
+
## 3. 使用方法
|
90 |
+
|
91 |
+
### 安装依赖
|
92 |
+
|
93 |
+
```bash
|
94 |
+
pip install ultralytics pillow
|
95 |
+
```
|
96 |
+
|
97 |
+
### 使用方法
|
98 |
+
|
99 |
+
```python
|
100 |
+
## simple
|
101 |
+
## 下载模型后直接使用ultralytics即可
|
102 |
+
|
103 |
+
from ultralytics import YOLO,RTDETR
|
104 |
+
|
105 |
+
# Load a model
|
106 |
+
model = YOLO("/path/to/download_model") # pretrained YOLO11n model
|
107 |
+
|
108 |
+
# Run batched inference on a list of images
|
109 |
+
results = model(["/path/to/your_image"],imgsz = 960) # return a list of Results objects
|
110 |
+
|
111 |
+
# Process results list
|
112 |
+
for result in results:
|
113 |
+
boxes = result.boxes # Boxes object for bounding box outputs
|
114 |
+
masks = result.masks # Masks object for segmentation masks outputs
|
115 |
+
keypoints = result.keypoints # Keypoints object for pose outputs
|
116 |
+
probs = result.probs # Probs object for classification outputs
|
117 |
+
obb = result.obb # Oriented boxes object for OBB outputs
|
118 |
+
result.show() # display to screen
|
119 |
+
result.save(filename="result.jpg") # save to disk
|
120 |
+
|
121 |
+
```
|
122 |
+
|
123 |
+
## Buy me a coffee
|
124 |
+
|
125 |
+
- 微信(WeChat)
|
126 |
+
|
127 |
+
<div align="left">
|
128 |
+
<img src="./zanshan.jpg" width="30%" height="30%">
|
129 |
+
</div>
|
130 |
+
|
131 |
+
## 特别鸣谢
|
132 |
+
- ultralytics公开的训练模型和文档
|
133 |
+
- 各种数据集提供者
|
README_en.md
ADDED
@@ -0,0 +1,134 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# AnyTable
|
2 |
+
|
3 |
+
<a href="https://huggingface.co/oriforge/anytable" target="_blank"><img src="https://img.shields.io/badge/%F0%9F%A4%97-HuggingFace-blue"></a>
|
4 |
+
<a href="https://www.modelscope.cn/models/oriforge/table" target="_blank"><img alt="Static Badge" src="https://img.shields.io/badge/%E9%AD%94%E6%90%AD-ModelScope-blue"></a>
|
5 |
+
<a href=""><img src="https://img.shields.io/badge/Python->=3.6-aff.svg"></a>
|
6 |
+
<a href=""><img src="https://img.shields.io/badge/OS-Linux%2C%20Win%2C%20Mac-pink.svg"></a>
|
7 |
+
<a href=""><img alt="Static Badge" src="https://img.shields.io/badge/engine-cpu_gpu_onnxruntime-blue"></a>
|
8 |
+
|
9 |
+
```
|
10 |
+
___ ______ __ __
|
11 |
+
/ | ____ __ _/_ __/___ _/ /_ / /__
|
12 |
+
/ /| | / __ \/ / / // / / __ `/ __ \/ / _ \
|
13 |
+
/ ___ |/ / / / /_/ // / / /_/ / /_/ / / __/
|
14 |
+
/_/ |_/_/ /_/\__, //_/ \__,_/_.___/_/\___/
|
15 |
+
/____/
|
16 |
+
|
17 |
+
```
|
18 |
+
|
19 |
+
English | [简体中文](./README.md)
|
20 |
+
|
21 |
+
<div align="left">
|
22 |
+
<img src="./assets/sample1.jpg">
|
23 |
+
</div>
|
24 |
+
|
25 |
+
## 1. Introduction
|
26 |
+
|
27 |
+
AnyTable is a modeling tool that focuses on parsing tables from documents or images, mainly divided into two parts:
|
28 |
+
-Anytable det: used for table region detection (open)
|
29 |
+
-Anytable rec: used for table structure recognition (open in the future)
|
30 |
+
|
31 |
+
Project Address:
|
32 |
+
- github地址:[AnyTable](https://github.com/oriforge/anytable)
|
33 |
+
- Hugging Face: [AnyTable](https://huggingface.co/oriforge/anytable)
|
34 |
+
- ModelScope: [AnyTable](https://www.modelscope.cn/models/oriforge/anytable)
|
35 |
+
|
36 |
+
## 2. Origin
|
37 |
+
|
38 |
+
At present, there are a lot of mixed table data on the market, making it difficult to have a clean and complete data and model. Therefore, we collected and organized a lot of table data and trained our model.
|
39 |
+
|
40 |
+
Detecting dataset distribution:
|
41 |
+
|
42 |
+
- pubtables: 947642
|
43 |
+
- synthtabnet.marketing: 149999
|
44 |
+
- tablebank: 278582
|
45 |
+
- fintabnet.c: 97475
|
46 |
+
- pubtabnet: 519030
|
47 |
+
- synthtabnet.sparse: 150000
|
48 |
+
- synthtabnet.fintabnet: 149999
|
49 |
+
- docbank: 24517
|
50 |
+
- synthtabnet.pubtabnet: 150000
|
51 |
+
- cTDaRTRACKA: 1639
|
52 |
+
- SciTSR: 14971
|
53 |
+
- doclaynet.large: 21185
|
54 |
+
- IIITAR13K: 9905
|
55 |
+
- selfbuilt: 121157
|
56 |
+
|
57 |
+
Total dataset: greater than 2.6M (approximately 2633869 images).
|
58 |
+
|
59 |
+
### Train
|
60 |
+
|
61 |
+
- train set:`2.6M(Only 42000 samples were taken for the portion greater than 100000,Due to poverty, the cards are limited.)`
|
62 |
+
- eval set:`4k`
|
63 |
+
- python: 3.12
|
64 |
+
- pytorch: 2.6.0
|
65 |
+
- cuda: 12.3
|
66 |
+
- ultralytics: 8.3.128
|
67 |
+
|
68 |
+
### Model introduction
|
69 |
+
|
70 |
+
The table detection model is located in the det folder:
|
71 |
+
|
72 |
+
- YOLO series: Training YOLO detection using ultralytics
|
73 |
+
- Rt detr: Training rt detr detection using ultralytics
|
74 |
+
|
75 |
+
Note: You can directly predict the model or fine tune the private dataset as a pre trained model
|
76 |
+
|
77 |
+
### Eval
|
78 |
+
|
79 |
+
self built evaluation set:`4K`
|
80 |
+
|
81 |
+
| model | imgsz | epochs | metrics/precision |
|
82 |
+
|---|---|---|---|
|
83 |
+
|rt-detr-l|960|10|0.97|
|
84 |
+
|yolo11s|960|10|-|
|
85 |
+
|yolo11m|960|10|0.964|
|
86 |
+
|yolo12s|960|10|0.978|
|
87 |
+
|
88 |
+
|
89 |
+
## 3. Usage
|
90 |
+
|
91 |
+
### Install dependencies
|
92 |
+
|
93 |
+
```bash
|
94 |
+
pip install ultralytics pillow
|
95 |
+
```
|
96 |
+
|
97 |
+
### Usage
|
98 |
+
|
99 |
+
```python
|
100 |
+
## simple
|
101 |
+
## After downloading the model, simply use ultralytics directly
|
102 |
+
|
103 |
+
from ultralytics import YOLO,RTDETR
|
104 |
+
|
105 |
+
# Load a model
|
106 |
+
model = YOLO("/path/to/download_model") # pretrained YOLO11n model
|
107 |
+
|
108 |
+
# Run batched inference on a list of images
|
109 |
+
results = model(["/path/to/your_image"],imgsz = 960) # return a list of Results objects
|
110 |
+
|
111 |
+
# Process results list
|
112 |
+
for result in results:
|
113 |
+
boxes = result.boxes # Boxes object for bounding box outputs
|
114 |
+
masks = result.masks # Masks object for segmentation masks outputs
|
115 |
+
keypoints = result.keypoints # Keypoints object for pose outputs
|
116 |
+
probs = result.probs # Probs object for classification outputs
|
117 |
+
obb = result.obb # Oriented boxes object for OBB outputs
|
118 |
+
result.show() # display to screen
|
119 |
+
result.save(filename="result.jpg") # save to disk
|
120 |
+
|
121 |
+
```
|
122 |
+
|
123 |
+
## Buy me a coffee
|
124 |
+
|
125 |
+
- 微信(WeChat)
|
126 |
+
|
127 |
+
<div align="left">
|
128 |
+
<img src="./zanshan.jpg" width="30%" height="30%">
|
129 |
+
</div>
|
130 |
+
|
131 |
+
## Special thanks
|
132 |
+
|
133 |
+
- Ultralytics publicly available training models and documentation
|
134 |
+
- Various dataset providers
|
assets/sample1.jpg
ADDED
![]() |
Git LFS Details
|
det/anytable-det-rtdetr-l-imgsz960.pt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:c3d8bb4b94a4219394c116eba8d5ee59f47e44f7131b0338f91076123a90b831
|
3 |
+
size 66131712
|
det/anytable-det-yolo11m-imgsz960.pt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:74002c6849c3e7eb41e8fa6cfcc053fc3d815b824db9a467db929a22e0c90d98
|
3 |
+
size 40527013
|
det/anytable-det-yolo12s-imgsz960.pt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:e84eb6d911e5cc66d75b7aff522799cd53fa3fc8900b3d67551cec31bfcd5e3a
|
3 |
+
size 18931923
|
zanshan.jpg
ADDED
![]() |
Git LFS Details
|