Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
SWHL committed May 18, 2024
2 parents 41a23c0 + 23b657e commit a8abd72
Show file tree
Hide file tree
Showing 26 changed files with 1,914 additions and 1,647 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/gen_whl_to_pypi_rapidocr_vino.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ name: Push rapidocr_openvino to pypi

on:
push:
# branches: [ main ]
# paths:
# - 'python/rapidocr_openvino/**'
# - 'docs/doc_whl_rapidocr_vino.md'
# - 'python/setup_openvino.py'
# - '.github/workflows/gen_whl_to_pypi_rapidocr_vino.yml'
tags:
- v*
branches: [ main ]
paths:
- 'python/rapidocr_openvino/**'
- 'docs/doc_whl_rapidocr_vino.md'
- 'python/setup_openvino.py'
- '.github/workflows/gen_whl_to_pypi_rapidocr_vino.yml'
# tags:
# - v*

env:
RESOURCES_URL: https://github.com/RapidAI/RapidOCR/releases/download/v1.1.0/required_for_whl_v1.3.0.zip
Expand Down Expand Up @@ -86,7 +86,7 @@ jobs:
cd ..
python -m pip install --upgrade pip
python setup_openvino.py bdist_wheel ${{ github.ref_name }}
python setup_openvino.py bdist_wheel "{{ github.event.head_commit.message }}"
mv dist ../
- name: Publish distribution 📦 to PyPI
Expand Down
10 changes: 6 additions & 4 deletions python/rapidocr_onnxruntime/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,15 @@
LoadImage,
UpdateParameters,
VisRes,
get_logger,
init_args,
read_yaml,
update_model_path,
)

root_dir = Path(__file__).resolve().parent
DEFAULT_CFG_PATH = root_dir / "config.yaml"
logger = get_logger("RapidOCR")


class RapidOCR:
Expand Down Expand Up @@ -246,10 +248,10 @@ def main():
use_cls=use_cls,
use_rec=use_rec,
)
print(result)
logger.info(result)

if args.print_cost:
print(elapse_list)
logger.info(elapse_list)

if args.vis_res:
vis = VisRes()
Expand All @@ -260,7 +262,7 @@ def main():
boxes, *_ = list(zip(*result))
vis_img = vis(args.img_path, boxes)
cv2.imwrite(str(save_path), vis_img)
print(f"The vis result has saved in {save_path}")
logger.info("The vis result has saved in %s", save_path)

elif use_det and use_rec:
font_path = Path(args.vis_font_path)
Expand All @@ -270,7 +272,7 @@ def main():
boxes, txts, scores = list(zip(*result))
vis_img = vis(args.img_path, boxes, txts, scores, font_path=font_path)
cv2.imwrite(str(save_path), vis_img)
print(f"The vis result has saved in {save_path}")
logger.info("The vis result has saved in %s", save_path)


if __name__ == "__main__":
Expand Down
Loading

0 comments on commit a8abd72

Please sign in to comment.