From 991e194e7038495ac5f8555cf59cced4ed981dec Mon Sep 17 00:00:00 2001 From: andyjpaddle Date: Wed, 20 Jul 2022 06:28:00 +0000 Subject: [PATCH] add vl --- configs/rec/rec_r45_visionlan.yml | 4 ++-- tools/infer/predict_rec.py | 11 ----------- 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/configs/rec/rec_r45_visionlan.yml b/configs/rec/rec_r45_visionlan.yml index 4c3fb4a8..f3a3661f 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 2b924306..1da9f257 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 -- GitLab