diff --git a/configs/rec/rec_r45_visionlan.yml b/configs/rec/rec_r45_visionlan.yml index 4c3fb4a80b8e5b73cdb05c30054fda6420470801..f3a3661f5344f3c48b4948fb1037d185b94ad376 100644 --- a/configs/rec/rec_r45_visionlan.yml +++ b/configs/rec/rec_r45_visionlan.yml @@ -3,12 +3,12 @@ Global: epoch_num: 8 log_smooth_window: 200 print_batch_step: 200 - save_model_dir: /paddle/backup/visionlan/LA_v2 + save_model_dir: ./output/rec/r45_visionlan save_epoch_step: 1 # evaluation is run every 2000 iterations eval_batch_step: [0, 2000] cal_metric_during_train: True - pretrained_model: ./pretrained_model/LF_2_ocr + pretrained_model: checkpoints: save_inference_dir: use_visualdl: True diff --git a/tools/infer/predict_rec.py b/tools/infer/predict_rec.py index 2b92430623586724ebe82e346445998529752501..1da9f2572258e08e76b855d0ed9402fbc331ae86 100755 --- a/tools/infer/predict_rec.py +++ b/tools/infer/predict_rec.py @@ -157,17 +157,6 @@ class TextRecognizer(object): padding_im[:, :, 0:resized_w] = resized_image return padding_im - def resize_norm_img_svtr(self, img, image_shape): - - imgC, imgH, imgW = image_shape - resized_image = cv2.resize( - img, (imgW, imgH), interpolation=cv2.INTER_LINEAR) - resized_image = resized_image.astype('float32') - resized_image = resized_image.transpose((2, 0, 1)) / 255 - resized_image -= 0.5 - resized_image /= 0.5 - return resized_image - def resize_norm_img_vl(self, img, image_shape): imgC, imgH, imgW = image_shape