Skip to content

πŸ“„ Awesome OCR multiple programing languages toolkits based on ONNX Runtime, OpenVINO, MNN, PaddlePaddle, TensorRT and PyTorch.

Fix bug

SWHL162f7f99fd04
diff --git a/.github/workflows/gen_whl_to_pypi_rapid_orientation.yml b/.github/workflows/gen_whl_to_pypi_rapid_orientation.yml
index 8e56b00..07195ce 100644
--- a/.github/workflows/gen_whl_to_pypi_rapid_orientation.yml
+++ b/.github/workflows/gen_whl_to_pypi_rapid_orientation.yml
@@ -12,12 +12,8 @@ on:
jobs:
UnitTesting:
- runs-on: windows-latest
+ runs-on: ubuntu-latest
steps:
- - name: Install 7Zip PowerShell Module
- shell: powershell
- run: Install-Module 7Zip4PowerShell -Force -Verbose
-
- name: Pull latest code
uses: actions/checkout@v3
@@ -33,13 +29,7 @@ jobs:
run: |
Expand-7Zip -ArchiveFileName ./rapid_orientation_models.zip -TargetPath .\
- - name: List all file
- shell: cmd
- run: |
- dir .
-
- name: Unit testings
- shell: cmd
run: |
set git_keep_path=%cur_dir%\python\rapid_structure\rapid_orientation\models\.gitkeep
del %git_keep_path%
diff --git a/python/rapid_structure/demo.py b/python/rapid_structure/demo.py
index d69a5d5..a1879f0 100644
--- a/python/rapid_structure/demo.py
+++ b/python/rapid_structure/demo.py
@@ -74,7 +74,7 @@ def demo_table():
def demo_orientation():
orientation_engine = RapidOrientation()
- img = cv2.imread('test_images/table.jpg')
+ img = cv2.imread('tests/test_files/img_rot180_demo.jpg')
cls_result, _ = orientation_engine(img)
print(cls_result)
diff --git a/python/rapid_structure/rapid_orientation/rapid_orientation.py b/python/rapid_structure/rapid_orientation/rapid_orientation.py
index 3fd712a..a2f35dd 100644
--- a/python/rapid_structure/rapid_orientation/rapid_orientation.py
+++ b/python/rapid_structure/rapid_orientation/rapid_orientation.py
@@ -47,6 +47,7 @@ class RapidOrientation():
for ops in self.preprocess_ops:
images = ops(images)
image = np.array(images)
+ image = image[np.newaxis, ...]
input_dict = {self.input_name: image}
pred_output = self.predictor.run(None, input_feed=input_dict)[0]