Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

polish infer_rec and add ic15_dict #4

Merged
merged 9 commits into from
May 12, 2020
Merged

Conversation

tink2123
Copy link
Collaborator

  • polish infer_rec to support infer dir
  • add ic15_dict and synchronous yml

@tink2123 tink2123 requested a review from LDOUBLEV May 11, 2020 10:14
@@ -0,0 +1,2077 @@
test/word_1.png JOINT
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

train_data里的文件提供给用户下载吧

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done thx~

set_env.sh Outdated
ldconfig↩
export CUDA_VISIBLE_DEVICES="0,1,2,3"
export FLAGS_fraction_of_gpu_memory_to_use=1.0
python_bin_dir="/opt/_internal/cpython-3.7.0/bin/"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

set_env.sh 这个文件应该不用放在repo里了

image_file_list = [self.infer_img]
elif os.path.isdir(self.infer_img):
for single_file in os.listdir(self.infer_img):
if single_file.endswith('png') or single_file.endswith('jpg'):
Copy link
Collaborator

@LDOUBLEV LDOUBLEV May 11, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

如果是其他图像文件是不是需要判断下,比如jpeg,bmp。如果图像是灰度图,还需要判断下并转换成彩色图

img_end = ['jpg', 'png', 'jpeg', 'JPEG', 'JPG', 'bmp']
    if os.path.isfile(img_file) and img_file.split('.')[-1] in img_end:
        imgs_lists.append(img_file)

img = cv2.imread(img_path)
            if img.shape[-1]==1 or len(list(img.shape))==2:
                img = cv2.cvtColor(img, cv2.COLOR_GRAY2BGR)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done thx~

pretrain_weights:

pretrain_weights:
infer_img: ./infer_img
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

移动reader里面

@@ -1,14 +1,13 @@
TrainReader:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

删掉该yml,保留ic15 reader

@@ -0,0 +1,13 @@
TrainReader:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

文件名称改为rec_icdar15_reader.yml

character_dict_path: ./ppocr/utils/ic15_dict.txt
loss_type: ctc
reader_yml: ./configs/rec/rec_ic15_reader.yml
pretrain_weights: ./pretrain_models/best_accuracy
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

路径修改

img = cv2.imread(self.infer_img)
norm_img = process_image(img, self.image_shape)
yield norm_img
image_file_list = []
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

和infer中的函数read image list统一

@@ -0,0 +1,86 @@
J
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

都用小写,26个字母+10个数字,总共36个类

set_env.sh Outdated
@@ -1,12 +1,10 @@
#. /paddle/set_env.sh↩
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

删除文件

@dyning dyning merged commit aa9bedf into PaddlePaddle:develop May 12, 2020
dyning pushed a commit that referenced this pull request Jul 24, 2020
dyning pushed a commit that referenced this pull request Aug 24, 2020
@rp-koayst rp-koayst mentioned this pull request Jan 26, 2021
BillDior pushed a commit to BillDior/PaddleOCR that referenced this pull request Aug 13, 2021
@linkewei0580 linkewei0580 mentioned this pull request Mar 4, 2022
an1018 pushed a commit to an1018/PaddleOCR that referenced this pull request Aug 17, 2022
mxihan pushed a commit to mxihan/PaddleOCR that referenced this pull request Jul 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants