From 497ce43261cbfce4770704b2ffe2fc3942c41547 Mon Sep 17 00:00:00 2001 From: LDOUBLEV Date: Tue, 12 Oct 2021 17:57:53 +0800 Subject: [PATCH 1/4] fix BGR --- configs/e2e/e2e_r50_vd_pg.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configs/e2e/e2e_r50_vd_pg.yml b/configs/e2e/e2e_r50_vd_pg.yml index 4a6e19f446..c4c5226e79 100644 --- a/configs/e2e/e2e_r50_vd_pg.yml +++ b/configs/e2e/e2e_r50_vd_pg.yml @@ -94,7 +94,7 @@ Eval: label_file_list: [./train_data/total_text/test/test.txt] transforms: - DecodeImage: # load image - img_mode: RGB + img_mode: BGR channel_first: False - E2ELabelEncodeTest: - E2EResizeForTest: @@ -111,4 +111,4 @@ Eval: shuffle: False drop_last: False batch_size_per_card: 1 # must be 1 - num_workers: 2 \ No newline at end of file + num_workers: 2 From 7fbe65e80f5ff2d856b35ed8ae55b417b950ee98 Mon Sep 17 00:00:00 2001 From: LDOUBLEV Date: Tue, 12 Oct 2021 18:17:26 +0800 Subject: [PATCH 2/4] BGR not RGB --- tools/infer/predict_e2e.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/infer/predict_e2e.py b/tools/infer/predict_e2e.py index 8ff279d743..5029d60593 100755 --- a/tools/infer/predict_e2e.py +++ b/tools/infer/predict_e2e.py @@ -141,7 +141,6 @@ if __name__ == "__main__": img, flag = check_and_read_gif(image_file) if not flag: img = cv2.imread(image_file) - img = img[:, :, ::-1] if img is None: logger.info("error in loading image:{}".format(image_file)) continue From e28521e3019cd82792cb2729c3ac849b54d3516d Mon Sep 17 00:00:00 2001 From: LDOUBLEV Date: Wed, 13 Oct 2021 16:26:26 +0800 Subject: [PATCH 3/4] fix bug --- ppocr/modeling/necks/rnn.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ppocr/modeling/necks/rnn.py b/ppocr/modeling/necks/rnn.py index de87b3d989..86e649028f 100644 --- a/ppocr/modeling/necks/rnn.py +++ b/ppocr/modeling/necks/rnn.py @@ -51,7 +51,7 @@ class EncoderWithFC(nn.Layer): super(EncoderWithFC, self).__init__() self.out_channels = hidden_size weight_attr, bias_attr = get_para_bias_attr( - l2_decay=0.00001, k=in_channels, name='reduce_encoder_fea') + l2_decay=0.00001, k=in_channels) self.fc = nn.Linear( in_channels, hidden_size, From 008876d482751f470772f1fbfa7be6a5cb40c29f Mon Sep 17 00:00:00 2001 From: LDOUBLEV Date: Wed, 13 Oct 2021 19:19:44 +0800 Subject: [PATCH 4/4] add copy paste and fix bug --- configs/det/ch_PP-OCRv2/ch_PP-OCR_det_cml.yml | 1 + configs/det/ch_PP-OCRv2/ch_PP-OCR_det_distill.yml | 4 ++-- configs/det/ch_PP-OCRv2/ch_PP-OCR_det_dml.yml | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/configs/det/ch_PP-OCRv2/ch_PP-OCR_det_cml.yml b/configs/det/ch_PP-OCRv2/ch_PP-OCR_det_cml.yml index 0f08909add..ab484a4483 100644 --- a/configs/det/ch_PP-OCRv2/ch_PP-OCR_det_cml.yml +++ b/configs/det/ch_PP-OCRv2/ch_PP-OCR_det_cml.yml @@ -141,6 +141,7 @@ Train: img_mode: BGR channel_first: False - DetLabelEncode: # Class handling label + - CopyPaste: - IaaAugment: augmenter_args: - { 'type': Fliplr, 'args': { 'p': 0.5 } } diff --git a/configs/det/ch_PP-OCRv2/ch_PP-OCR_det_distill.yml b/configs/det/ch_PP-OCRv2/ch_PP-OCR_det_distill.yml index 1159d71bf9..46daeeb86d 100644 --- a/configs/det/ch_PP-OCRv2/ch_PP-OCR_det_distill.yml +++ b/configs/det/ch_PP-OCRv2/ch_PP-OCR_det_distill.yml @@ -68,8 +68,7 @@ Loss: ohem_ratio: 3 - DistillationDBLoss: weight: 1.0 - model_name_list: ["Student", "Teacher"] - # key: maps + model_name_list: ["Student"] name: DBLoss balance_loss: true main_loss_type: DiceLoss @@ -116,6 +115,7 @@ Train: img_mode: BGR channel_first: False - DetLabelEncode: # Class handling label + - CopyPaste: - IaaAugment: augmenter_args: - { 'type': Fliplr, 'args': { 'p': 0.5 } } diff --git a/configs/det/ch_PP-OCRv2/ch_PP-OCR_det_dml.yml b/configs/det/ch_PP-OCRv2/ch_PP-OCR_det_dml.yml index 7fe2d2e1a0..bfbc3b6268 100644 --- a/configs/det/ch_PP-OCRv2/ch_PP-OCR_det_dml.yml +++ b/configs/det/ch_PP-OCRv2/ch_PP-OCR_det_dml.yml @@ -118,6 +118,7 @@ Train: img_mode: BGR channel_first: False - DetLabelEncode: # Class handling label + - CopyPaste: - IaaAugment: augmenter_args: - { 'type': Fliplr, 'args': { 'p': 0.5 } }