文本检测模型微调完成

This commit is contained in:
haotian 2025-08-15 09:45:20 +08:00
parent cb8384c5bb
commit 16d5131576
7 changed files with 112 additions and 1602 deletions

View File

@ -2,7 +2,8 @@ from paddleocr import PaddleOCR
ocr = PaddleOCR( ocr = PaddleOCR(
# 文本检测模型地址 # 文本检测模型地址
text_detection_model_dir = "/home/admin-root/haotian/康达瑞贝斯机器狗/ocr_model/PP-OCRv5_server_det", # text_detection_model_dir = "/home/admin-root/haotian/康达瑞贝斯机器狗/ocr_model/PP-OCRv5_server_det",
text_detection_model_dir='/home/admin-root/haotian/康达瑞贝斯机器狗/PaddleOCR-3.1.0/output/PP-OCRv5_server_det_infer_20250814',
# 文本识别模型地址 # 文本识别模型地址
text_recognition_model_dir = "/home/admin-root/haotian/康达瑞贝斯机器狗/ocr_model/PP-OCRv5_server_rec", text_recognition_model_dir = "/home/admin-root/haotian/康达瑞贝斯机器狗/ocr_model/PP-OCRv5_server_rec",
use_doc_orientation_classify=False, use_doc_orientation_classify=False,
@ -16,7 +17,7 @@ ocr = PaddleOCR(
# use_doc_orientation_classify=False, # use_doc_orientation_classify=False,
# use_doc_unwarping=False, # use_doc_unwarping=False,
# use_textline_orientation=False) # 更换 PP-OCRv5_mobile 模型 # use_textline_orientation=False) # 更换 PP-OCRv5_mobile 模型
result = ocr.predict("data_image/001读表图片/2c7cc83019e7388a7041101da92c9829_frame_000000.jpg") result = ocr.predict("/home/admin-root/haotian/康达瑞贝斯机器狗/data_image/001读表图片/3aee64cc1f90d93a5a45979f7b17cb4b_frame_001460.jpg")
for res in result: for res in result:
res.print() res.print()

View File

@ -71,7 +71,7 @@ Metric:
Train: Train:
dataset: dataset:
name: SimpleDataSet name: SimpleDataSet
data_dir: /home/admin-root/haotian/康达瑞贝斯机器狗/ocr_dataset/001读表图片 data_dir: /home/admin-root/haotian/康达瑞贝斯机器狗/ocr_dataset
label_file_list: label_file_list:
- /home/admin-root/haotian/康达瑞贝斯机器狗/ocr_dataset/001读表图片/Label.txt - /home/admin-root/haotian/康达瑞贝斯机器狗/ocr_dataset/001读表图片/Label.txt
ratio_list: [1.0] ratio_list: [1.0]
@ -133,13 +133,13 @@ Train:
loader: loader:
shuffle: true shuffle: true
drop_last: false drop_last: false
batch_size_per_card: 8 batch_size_per_card: 4
num_workers: 8 num_workers: 4
Eval: Eval:
dataset: dataset:
name: SimpleDataSet name: SimpleDataSet
data_dir: /home/admin-root/haotian/康达瑞贝斯机器狗/ocr_dataset/001读表图片 data_dir: /home/admin-root/haotian/康达瑞贝斯机器狗/ocr_dataset
label_file_list: label_file_list:
- /home/admin-root/haotian/康达瑞贝斯机器狗/ocr_dataset/001读表图片/Label.txt - /home/admin-root/haotian/康达瑞贝斯机器狗/ocr_dataset/001读表图片/Label.txt
transforms: transforms:

View File

@ -5,7 +5,7 @@ Global:
epoch_num: 75 epoch_num: 75
log_smooth_window: 20 log_smooth_window: 20
print_batch_step: 10 print_batch_step: 10
save_model_dir: ./output/PP-OCRv5_server_rec save_model_dir: ./output/PP-OCRv5_server_rec_20250815
save_epoch_step: 1 save_epoch_step: 1
eval_batch_step: [0, 2000] eval_batch_step: [0, 2000]
cal_metric_during_train: true cal_metric_during_train: true
@ -78,7 +78,7 @@ Train:
dataset: dataset:
name: MultiScaleDataSet name: MultiScaleDataSet
ds_width: false ds_width: false
data_dir: ./train_data/ data_dir: /home/admin-root/haotian/康达瑞贝斯机器狗/ocr_dataset/001读表图片/crop_img
ext_op_transform_idx: 1 ext_op_transform_idx: 1
label_file_list: label_file_list:
- ./train_data/train_list.txt - ./train_data/train_list.txt

BIN
det.onnx Normal file

Binary file not shown.

BIN
det_shape.onnx Normal file

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,84 @@
{
"input_path": "/home/admin-root/haotian/康达瑞贝斯机器狗/data_image/001读表图片/3aee64cc1f90d93a5a45979f7b17cb4b_frame_001460.jpg",
"page_index": null,
"model_settings": {
"use_doc_preprocessor": true,
"use_textline_orientation": false
},
"doc_preprocessor_res": {
"input_path": null,
"page_index": null,
"model_settings": {
"use_doc_orientation_classify": false,
"use_doc_unwarping": false
},
"angle": -1
},
"dt_polys": [
[
[
813,
204
],
[
868,
204
],
[
868,
240
],
[
813,
240
]
]
],
"text_det_params": {
"limit_side_len": 64,
"limit_type": "min",
"thresh": 0.3,
"max_side_limit": 4000,
"box_thresh": 0.6,
"unclip_ratio": 1.5
},
"text_type": "general",
"textline_orientation_angles": [
-1
],
"text_rec_score_thresh": 0.0,
"rec_texts": [
"1.1"
],
"rec_scores": [
0.862824022769928
],
"rec_polys": [
[
[
813,
204
],
[
868,
204
],
[
868,
240
],
[
813,
240
]
]
],
"rec_boxes": [
[
813,
204,
868,
240
]
]
}