|
@@ -16,6 +16,12 @@ git clone --depth 1 https://github.com/PaddlePaddle/PaddleOCR.git
|
|
cd PaddleOCR
|
|
cd PaddleOCR
|
|
```
|
|
```
|
|
|
|
|
|
|
|
+安装依赖:
|
|
|
|
+
|
|
|
|
+```bash
|
|
|
|
+pip install -r requirements.txt
|
|
|
|
+```
|
|
|
|
+
|
|
PaddleOCR 训练数据的默认存储路径是 `PaddleOCR/train_data`。我们将数据集下载到本地后,可以拷贝数据集或创建软链接到对应目录:
|
|
PaddleOCR 训练数据的默认存储路径是 `PaddleOCR/train_data`。我们将数据集下载到本地后,可以拷贝数据集或创建软链接到对应目录:
|
|
|
|
|
|
```bash
|
|
```bash
|
|
@@ -37,9 +43,9 @@ PaddleOCR 对训练过程做了模块化,如果要训练不同的模型,我
|
|
$ cat configs/table/SLANet_ch.yml
|
|
$ cat configs/table/SLANet_ch.yml
|
|
Global:
|
|
Global:
|
|
use_gpu: True
|
|
use_gpu: True
|
|
- # 修改训练轮数
|
|
|
|
|
|
+ # 训练轮数
|
|
epoch_num: 400
|
|
epoch_num: 400
|
|
- # 修改为实际的预训练模型文件
|
|
|
|
|
|
+ # 预训练模型文件
|
|
pretrained_model: ./pretrain_models/ch_ppstructure_mobile_v2.0_SLANet_train/best_accuracy
|
|
pretrained_model: ./pretrain_models/ch_ppstructure_mobile_v2.0_SLANet_train/best_accuracy
|
|
...
|
|
...
|
|
|
|
|
|
@@ -49,25 +55,25 @@ Optimizer:
|
|
beta2: 0.999
|
|
beta2: 0.999
|
|
clip_norm: 5.0
|
|
clip_norm: 5.0
|
|
lr:
|
|
lr:
|
|
- # 修改学习率
|
|
|
|
|
|
+ # 学习率
|
|
learning_rate: 0.001
|
|
learning_rate: 0.001
|
|
...
|
|
...
|
|
|
|
|
|
Train:
|
|
Train:
|
|
dataset:
|
|
dataset:
|
|
name: PubTabDataSet
|
|
name: PubTabDataSet
|
|
- # 修改为实际训练集的目录
|
|
|
|
|
|
+ # 训练集目录
|
|
data_dir: train_data/table-dataset/artificial
|
|
data_dir: train_data/table-dataset/artificial
|
|
- # 修改为实际训练集的标签文件
|
|
|
|
|
|
+ # 训练集标注文件
|
|
label_file_list: [train_data/table-dataset/artificial/train.txt]
|
|
label_file_list: [train_data/table-dataset/artificial/train.txt]
|
|
...
|
|
...
|
|
|
|
|
|
Eval:
|
|
Eval:
|
|
dataset:
|
|
dataset:
|
|
name: PubTabDataSet
|
|
name: PubTabDataSet
|
|
- # 修改为实际验证集的目录
|
|
|
|
|
|
+ # 验证集目录
|
|
data_dir: train_data/table-dataset/artificial/
|
|
data_dir: train_data/table-dataset/artificial/
|
|
- # 修改为实际验证集的标签文件
|
|
|
|
|
|
+ # 验证集标注文件
|
|
label_file_list: [train_data/table-dataset/artificial/test.txt]
|
|
label_file_list: [train_data/table-dataset/artificial/test.txt]
|
|
...
|
|
...
|
|
```
|
|
```
|