OCRv4文字检测微调后推理模型和训模型检测框不一致 #12201
Unanswered
1061302569
asked this question in
Q&A
Replies: 1 comment
-
我v3微调使用的是你的第一种方式,是可以的,断点跟踪一下,看看两个在数据预处理上有什么区别 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
请提供下述完整信息以便快速定位问题/Please provide the following information to quickly locate the problem
不知道如何调参让他们能一致
目前尝试的方法一(失败):

注释这两个参数
目前尝试的方法二(失败)

训练模型的配置没有image_shape加了这个也统一不了参数
下面使用的是v4检测模型配置,调了一下学习率其他都是默认参数,求指教推理模型和训练模型不一致,搜了所有教程也无法调好
{
"Global": {
"debug": false,
"use_gpu": true,
"epoch_num": 500,
"log_smooth_window": 20,
"print_batch_step": 100,
"save_model_dir": "output",
"save_epoch_step": 1,
"eval_batch_step": [
0,
1500
],
"cal_metric_during_train": false,
"checkpoints": null,
"pretrained_model": "https://paddleocr.bj.bcebos.com/pretrained/PPHGNet_small_ocr_det.pdparams",
"save_inference_dir": null,
"use_visualdl": false,
"distributed": true
},
"Architecture": {
"model_type": "det",
"algorithm": "DB",
"Transform": null,
"Backbone": {
"name": "PPHGNet_small",
"det": true
},
"Neck": {
"name": "LKPAN",
"out_channels": 256,
"intracl": true
},
"Head": {
"name": "PFHeadLocal",
"k": 50,
"mode": "large"
}
},
"Loss": {
"name": "DBLoss",
"balance_loss": true,
"main_loss_type": "DiceLoss",
"alpha": 5,
"beta": 10,
"ohem_ratio": 3
},
"Optimizer": {
"name": "Adam",
"beta1": 0.9,
"beta2": 0.999,
"lr": {
"name": "Cosine",
"learning_rate": 0.001,
"warmup_epoch": 2
},
"regularizer": {
"name": "L2",
"factor": "1e-6"
}
},
"PostProcess": {
"name": "DBPostProcess",
"thresh": 0.3,
"box_thresh": 0.6,
"max_candidates": 1000,
"unclip_ratio": 1.5
},
"Metric": {
"name": "DetMetric",
"main_indicator": "hmean"
},
"Train": {
"dataset": {
"name": "TextDetDataset",
"data_dir": "datasets/ICDAR2015",
"label_file_list": [
"datasets/ICDAR2015/train.txt"
],
"transforms": [
{
"DecodeImage": {
"img_mode": "BGR",
"channel_first": false
}
},
{
"DetLabelEncode": null
},
{
"CopyPaste": null
},
{
"IaaAugment": {
"augmenter_args": [
{
"type": "Fliplr",
"args": {
"p": 0.5
}
},
{
"type": "Affine",
"args": {
"rotate": [
-10,
10
]
}
},
{
"type": "Resize",
"args": {
"size": [
0.5,
3
]
}
}
]
}
},
{
"EastRandomCropData": {
"size": [
640,
640
],
"max_tries": 50,
"keep_ratio": true
}
},
{
"MakeBorderMap": {
"shrink_ratio": 0.4,
"thresh_min": 0.3,
"thresh_max": 0.7,
"total_epoch": 500
}
},
{
"MakeShrinkMap": {
"shrink_ratio": 0.4,
"min_text_size": 8,
"total_epoch": 500
}
},
{
"NormalizeImage": {
"scale": "1./255.",
"mean": [
0.485,
0.456,
0.406
],
"std": [
0.229,
0.224,
0.225
],
"order": "hwc"
}
},
{
"ToCHWImage": null
},
{
"KeepKeys": {
"keep_keys": [
"image",
"threshold_map",
"threshold_mask",
"shrink_map",
"shrink_mask"
]
}
}
]
},
"loader": {
"shuffle": true,
"drop_last": false,
"batch_size_per_card": 8,
"num_workers": 3
}
},
"Eval": {
"dataset": {
"name": "TextDetDataset",
"data_dir": "datasets/ICDAR2015",
"label_file_list": [
"datasets/ICDAR2015/val.txt"
],
"transforms": [
{
"DecodeImage": {
"img_mode": "BGR",
"channel_first": false
}
},
{
"DetLabelEncode": null
},
{
"DetResizeForTest": null
},
{
"NormalizeImage": {
"scale": "1./255.",
"mean": [
0.485,
0.456,
0.406
],
"std": [
0.229,
0.224,
0.225
],
"order": "hwc"
}
},
{
"ToCHWImage": null
},
{
"KeepKeys": {
"keep_keys": [
"image",
"shape",
"polys",
"ignore_tags"
]
}
}
]
},
"loader": {
"shuffle": false,
"drop_last": false,
"batch_size_per_card": 1,
"num_workers": 0
}
},
"profiler_options": null
}
Beta Was this translation helpful? Give feedback.
All reactions