From c25c636d2323bba42a96242bb6657e66e3d3698b Mon Sep 17 00:00:00 2001 From: littletomatodonkey Date: Thu, 25 Jun 2020 18:41:22 +0000 Subject: [PATCH] fix ch comment to support py2 and some other typo --- doc/doc_ch/recognition.md | 2 +- doc/doc_en/recognition_en.md | 2 +- ppocr/modeling/architectures/__init__.py | 13 +++++++++++++ ppocr/modeling/backbones/__init__.py | 13 +++++++++++++ ppocr/modeling/heads/__init__.py | 13 +++++++++++++ ppocr/modeling/losses/__init__.py | 13 +++++++++++++ ppocr/modeling/stns/__init__.py | 13 +++++++++++++ tools/eval_utils/eval_det_utils.py | 3 ++- tools/eval_utils/eval_rec_utils.py | 2 +- 9 files changed, 70 insertions(+), 4 deletions(-) create mode 100755 ppocr/modeling/architectures/__init__.py create mode 100755 ppocr/modeling/backbones/__init__.py create mode 100755 ppocr/modeling/heads/__init__.py create mode 100755 ppocr/modeling/losses/__init__.py create mode 100755 ppocr/modeling/stns/__init__.py diff --git a/doc/doc_ch/recognition.md b/doc/doc_ch/recognition.md index ffb99840..b5dc484f 100644 --- a/doc/doc_ch/recognition.md +++ b/doc/doc_ch/recognition.md @@ -10,7 +10,7 @@ PaddleOCR 支持两种数据格式: `lmdb` 用于训练公开数据,调试算 训练数据的默认存储路径是 `PaddleOCR/train_data`,如果您的磁盘上已有数据集,只需创建软链接至数据集目录: ``` -ln -sf /train_data/dataset +ln -sf /train_data/dataset ``` diff --git a/doc/doc_en/recognition_en.md b/doc/doc_en/recognition_en.md index 097bcc6d..49643fd6 100644 --- a/doc/doc_en/recognition_en.md +++ b/doc/doc_en/recognition_en.md @@ -10,7 +10,7 @@ Please organize the dataset as follows: The default storage path for training data is `PaddleOCR/train_data`, if you already have a dataset on your disk, just create a soft link to the dataset directory: ``` -ln -sf /train_data/dataset +ln -sf /train_data/dataset ``` diff --git a/ppocr/modeling/architectures/__init__.py b/ppocr/modeling/architectures/__init__.py new file mode 100755 index 00000000..abf198b9 --- /dev/null +++ b/ppocr/modeling/architectures/__init__.py @@ -0,0 +1,13 @@ +# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/ppocr/modeling/backbones/__init__.py b/ppocr/modeling/backbones/__init__.py new file mode 100755 index 00000000..abf198b9 --- /dev/null +++ b/ppocr/modeling/backbones/__init__.py @@ -0,0 +1,13 @@ +# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/ppocr/modeling/heads/__init__.py b/ppocr/modeling/heads/__init__.py new file mode 100755 index 00000000..abf198b9 --- /dev/null +++ b/ppocr/modeling/heads/__init__.py @@ -0,0 +1,13 @@ +# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/ppocr/modeling/losses/__init__.py b/ppocr/modeling/losses/__init__.py new file mode 100755 index 00000000..abf198b9 --- /dev/null +++ b/ppocr/modeling/losses/__init__.py @@ -0,0 +1,13 @@ +# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/ppocr/modeling/stns/__init__.py b/ppocr/modeling/stns/__init__.py new file mode 100755 index 00000000..abf198b9 --- /dev/null +++ b/ppocr/modeling/stns/__init__.py @@ -0,0 +1,13 @@ +# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/tools/eval_utils/eval_det_utils.py b/tools/eval_utils/eval_det_utils.py index ba275eca..276e6c31 100644 --- a/tools/eval_utils/eval_det_utils.py +++ b/tools/eval_utils/eval_det_utils.py @@ -65,6 +65,7 @@ def cal_det_res(exe, config, eval_info_dict): err = "concatenate error usually caused by different input image shapes in evaluation or testing.\n \ Please set \"test_batch_size_per_card\" in main yml as 1\n \ or add \"test_image_shape: [h, w]\" in reader yml for EvalReader." + raise Exception(err) outs = exe.run(eval_info_dict['program'], \ feed={'image': img_list}, \ @@ -113,7 +114,7 @@ def cal_det_metrics(gt_label_path, save_res_path): gt_label_path(string): The groundtruth detection label file path save_res_path(string): The saved predicted detection label path return: - claculated metrics including Hmean、precision and recall + claculated metrics including Hmean, precision and recall """ evaluator = DetectionIoUEvaluator() gt_label_infor = load_label_infor(gt_label_path, do_ignore=True) diff --git a/tools/eval_utils/eval_rec_utils.py b/tools/eval_utils/eval_rec_utils.py index 2d7d7e1d..a8845543 100644 --- a/tools/eval_utils/eval_rec_utils.py +++ b/tools/eval_utils/eval_rec_utils.py @@ -83,7 +83,7 @@ def eval_rec_run(exe, config, eval_info_dict, mode): def test_rec_benchmark(exe, config, eval_info_dict): - " 评估lmdb 数据" + " Evaluate lmdb dataset " eval_data_list = ['IIIT5k_3000', 'SVT', 'IC03_860', 'IC03_867', \ 'IC13_857', 'IC13_1015', 'IC15_1811', 'IC15_2077', 'SVTP', 'CUTE80'] eval_data_dir = config['TestReader']['lmdb_sets_dir'] -- GitLab