diff --git a/configs/det/det_mv3_db.yml b/configs/det/det_mv3_db.yml index 75500f9e1c0f40be56b2494f8ea7ddcc167913e9..8efa66a92d6e8c031efef48d738d9690bcc5554c 100755 --- a/configs/det/det_mv3_db.yml +++ b/configs/det/det_mv3_db.yml @@ -9,7 +9,6 @@ Global: eval_batch_step: 5000 train_batch_size_per_card: 16 test_batch_size_per_card: 16 - drop_last: false image_shape: [3, 640, 640] reader_yml: ./configs/det/det_db_icdar15_reader.yml pretrain_weights: ./pretrain_models/MobileNetV3_large_x0_5_pretrained/ diff --git a/configs/det/det_mv3_east.yml b/configs/det/det_mv3_east.yml index efb32d4987538099fb4d5ea7d823132480ededa2..b6f37256291912757cd1d5b98d1f745d08452fd6 100755 --- a/configs/det/det_mv3_east.yml +++ b/configs/det/det_mv3_east.yml @@ -9,7 +9,6 @@ Global: eval_batch_step: 5000 train_batch_size_per_card: 16 test_batch_size_per_card: 16 - drop_last: false image_shape: [3, 512, 512] reader_yml: ./configs/det/det_east_icdar15_reader.yml pretrain_weights: ./pretrain_models/MobileNetV3_large_x0_5_pretrained/ diff --git a/configs/det/det_r50_vd_db.yml b/configs/det/det_r50_vd_db.yml index eaad7fbda4978951acff06801d5710a23a60dbb9..6e3b3b9e264b29fcac2b2b9b20ee2f88d5c975f3 100755 --- a/configs/det/det_r50_vd_db.yml +++ b/configs/det/det_r50_vd_db.yml @@ -10,7 +10,6 @@ Global: train_batch_size_per_card: 8 test_batch_size_per_card: 16 image_shape: [3, 640, 640] - drop_last: false reader_yml: ./configs/det/det_db_icdar15_reader.yml pretrain_weights: ./pretrain_models/ResNet50_vd_ssld_pretrained/ save_res_path: ./output/det_db/predicts_db.txt diff --git a/configs/det/det_r50_vd_east.yml b/configs/det/det_r50_vd_east.yml index e05bce3f5965c9831c51cda9d7ba96d6a45256b2..bb16f9fa12424db293ba498e78b00f279f1a7ff6 100755 --- a/configs/det/det_r50_vd_east.yml +++ b/configs/det/det_r50_vd_east.yml @@ -10,7 +10,6 @@ Global: train_batch_size_per_card: 8 test_batch_size_per_card: 16 image_shape: [3, 512, 512] - drop_last: false reader_yml: ./configs/det/det_east_icdar15_reader.yml pretrain_weights: ./pretrain_models/ResNet50_vd_ssld_pretrained/ save_res_path: ./output/det_east/predicts_east.txt diff --git a/configs/rec/rec_benchmark_reader.yml b/configs/rec/rec_benchmark_reader.yml index 524f2f68bac92ff6ffe3ff3b34e461d2adc81e41..ef4dd909c7d255cac484e2e87eadc69f6b32b9d2 100755 --- a/configs/rec/rec_benchmark_reader.yml +++ b/configs/rec/rec_benchmark_reader.yml @@ -1,7 +1,7 @@ TrainReader: reader_function: ppocr.data.rec.dataset_traversal,LMDBReader num_workers: 8 - lmdb_sets_dir: ./train_data/data_lmdb_release/training/ + lmdb_sets_dir: ./train_data/data_lmdb_release/evaluation/ EvalReader: reader_function: ppocr.data.rec.dataset_traversal,LMDBReader diff --git a/configs/rec/rec_icdar15_train.yml b/configs/rec/rec_icdar15_train.yml index 934a94109cb304c5dd5e8db281f1fbf00d928e39..b3b22985d46848f677a8cd000e88687984371223 100755 --- a/configs/rec/rec_icdar15_train.yml +++ b/configs/rec/rec_icdar15_train.yml @@ -1,20 +1,20 @@ Global: algorithm: CRNN - use_gpu: true + use_gpu: false epoch_num: 1000 log_smooth_window: 20 print_batch_step: 10 save_model_dir: ./output/rec_CRNN save_epoch_step: 300 eval_batch_step: 500 - train_batch_size_per_card: 256 - test_batch_size_per_card: 256 + train_batch_size_per_card: 2 + test_batch_size_per_card: 2 image_shape: [3, 32, 100] max_text_length: 25 character_type: en loss_type: ctc reader_yml: ./configs/rec/rec_icdar15_reader.yml - pretrain_weights: ./pretrain_models/rec_mv3_none_bilstm_ctc/best_accuracy + pretrain_weights: checkpoints: save_inference_dir: infer_img: diff --git a/configs/rec/rec_mv3_tps_bilstm_attn.yml b/configs/rec/rec_mv3_tps_bilstm_attn.yml index 7fc4f6799459bf9fbcd25e1609aeca5e3fd12a74..a9dbce6a6c24c19ef07205cf73686a5357d89b7c 100755 --- a/configs/rec/rec_mv3_tps_bilstm_attn.yml +++ b/configs/rec/rec_mv3_tps_bilstm_attn.yml @@ -1,14 +1,14 @@ Global: algorithm: RARE - use_gpu: true + use_gpu: false epoch_num: 72 log_smooth_window: 20 print_batch_step: 10 save_model_dir: output/rec_RARE save_epoch_step: 3 eval_batch_step: 2000 - train_batch_size_per_card: 256 - test_batch_size_per_card: 256 + train_batch_size_per_card: 2 + test_batch_size_per_card: 2 image_shape: [3, 32, 100] max_text_length: 25 character_type: en diff --git a/ppocr/data/det/dataset_traversal.py b/ppocr/data/det/dataset_traversal.py index 76fa6408fee93a25cdebdd1cca05e1dfaab4169c..ab635de3e9f22cd0556c651bf9c70654bd83be77 100644 --- a/ppocr/data/det/dataset_traversal.py +++ b/ppocr/data/det/dataset_traversal.py @@ -32,7 +32,6 @@ class TrainReader(object): self.num_workers = params['num_workers'] self.label_file_path = params['label_file_path'] self.batch_size = params['train_batch_size_per_card'] - self.drop_last = params['drop_last'] assert 'process_function' in params,\ "absence process_function in Reader" self.process = create_module(params['process_function'])(params) @@ -62,9 +61,6 @@ class TrainReader(object): if len(batch_outs) == self.batch_size: yield batch_outs batch_outs = [] - if not self.drop_last: - if len(batch_outs) != 0: - yield batch_outs return batch_iter_reader diff --git a/ppocr/modeling/architectures/rec_model.py b/ppocr/modeling/architectures/rec_model.py index af651e9ac2314f9bc44403e5df30359463e8b014..e80a50ab6504c80aa7f10759576208486caf7c3f 100755 --- a/ppocr/modeling/architectures/rec_model.py +++ b/ppocr/modeling/architectures/rec_model.py @@ -94,9 +94,9 @@ class RecModel(object): logger.info( "WARNRNG!!!\n" "TPS does not support variable shape in chinese!" - "We set default shape=[3,32,320], it may affect the inference effect" + "We set img_shape to be the same , it may affect the inference effect" ) - image_shape[-1] = 320 + image_shape = deepcopy(self.image_shape) image = fluid.data(name='image', shape=image_shape, dtype='float32') labels = None loader = None