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

clean code for inference #64

Merged
merged 1 commit into from
Mar 16, 2023
Merged

clean code for inference #64

merged 1 commit into from
Mar 16, 2023

Conversation

liangxhao
Copy link
Contributor

@liangxhao liangxhao commented Mar 16, 2023

Thank you for your contribution to the MindOCR repo.
Before submitting this PR, please make sure:

Motivation

  1. clean code according to pylint for inference
  2. optimize some error messages

Test Plan

(How should this PR be tested? Do you require special setup to run the test or repro the fixed bug?)

Related Issues and PRs

(Is this PR part of a group of changes? Link the other relevant PRs and Issues here. Use https://help.github.com/en/articles/closing-issues-using-keywords for help on GitHub syntax)

setattr(args, 'save_vis_det_save_dir', True if args.vis_det_save_dir else False)
setattr(args, 'save_vis_pipeline_save_dir', True if args.vis_pipeline_save_dir else False)
raise ValueError(
f"Only support det、rec、det+rec and det+cls+rec, but got det_model_path={args.det_model_path}, "
Copy link
Collaborator

Choose a reason for hiding this comment

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

英文中用逗号代替顿号

@@ -102,7 +117,8 @@ def check_args(args):
if args.cls_model_path and not os.path.isfile(args.cls_model_path):
raise ValueError(f"cls_model_path must be a model file path for classification.")

if args.rec_model_path and (os.path.isdir(args.rec_model_path) and len(os.listdir(args.rec_model_path)) == 0):
if args.rec_model_path and (not os.path.exists(args.rec_model_path) or (
os.path.isdir(args.rec_model_path) and not os.listdir(args.rec_model_path))):
raise ValueError(f"rec_model_path must a model file or dir containing model file for recognition model.")
Copy link
Collaborator

Choose a reason for hiding this comment

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

typo: must -> must be

@HaoyangLee HaoyangLee merged commit 2cf5e5d into mindspore-lab:main Mar 16, 2023
@liangxhao liangxhao deleted the main_dev branch March 30, 2023 01:12
colawyee pushed a commit that referenced this pull request Jan 2, 2024
…_steps is less than or equal to 0 (#64)

Co-authored-by: songyuanwei <song.yuanwei@huawei.com>
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.

2 participants