-
Notifications
You must be signed in to change notification settings - Fork 7.8k
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
Conversation
tink2123
commented
May 11, 2020
- polish infer_rec to support infer dir
- add ic15_dict and synchronous yml
train_data/gt_test.txt
Outdated
@@ -0,0 +1,2077 @@ | |||
test/word_1.png JOINT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
train_data里的文件提供给用户下载吧
There was a problem hiding this comment.
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/" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
set_env.sh 这个文件应该不用放在repo里了
ppocr/data/rec/dataset_traversal.py
Outdated
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'): |
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
删掉该yml,保留ic15 reader
configs/rec/rec_ic15_reader.yml
Outdated
@@ -0,0 +1,13 @@ | |||
TrainReader: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
文件名称改为rec_icdar15_reader.yml
configs/rec/rec_ic15_train.yml
Outdated
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
路径修改
ppocr/data/rec/dataset_traversal.py
Outdated
img = cv2.imread(self.infer_img) | ||
norm_img = process_image(img, self.image_shape) | ||
yield norm_img | ||
image_file_list = [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
和infer中的函数read image list统一
ppocr/utils/ic15_dict.txt
Outdated
@@ -0,0 +1,86 @@ | |||
J |
There was a problem hiding this comment.
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↩ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
删除文件
test=develop
Add Travis CI