Skip to content

Commit adbf8e9

Browse files
committed
ci: Add GitHub Actions workflow for build and release
1 parent f761f54 commit adbf8e9

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

python_src/build_license_plate_runtime.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030

3131
REQUIREMENTS_DIR = PY_SRC_ROOT / "requirements"
3232
REQUIREMENTS_CPU = REQUIREMENTS_DIR / "requirements_cpu.txt"
33+
REQUIREMENTS_CPU_LINUX = REQUIREMENTS_DIR / "requirements_cpu_linux.txt"
3334
REQUIREMENTS_DML = REQUIREMENTS_DIR / "requirements_dml.txt"
3435

3536

@@ -192,9 +193,16 @@ def build_runtime(args: argparse.Namespace) -> None:
192193
create_venv(args.python, venv_path)
193194
venv_python = get_venv_python(venv_path)
194195

195-
requirements_file = Path(args.requirements) if args.requirements else (
196-
REQUIREMENTS_DML if args.provider == "dml" else REQUIREMENTS_CPU
197-
)
196+
if args.requirements:
197+
requirements_file = Path(args.requirements)
198+
else:
199+
if args.provider == "dml":
200+
requirements_file = REQUIREMENTS_DML
201+
else:
202+
if platform_tag.startswith("linux") and REQUIREMENTS_CPU_LINUX.exists():
203+
requirements_file = REQUIREMENTS_CPU_LINUX
204+
else:
205+
requirements_file = REQUIREMENTS_CPU
198206
pip_install(venv_python, requirements_file, upgrade_pip=not args.skip_pip_upgrade)
199207

200208
strip_unneeded_files(venv_path)
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
onnxruntime==1.17.1
2+
opencv-python-headless
3+
numpy<2.0
4+
easyocr
5+
pytesseract
6+
pillow

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
-r python_src/requirements/requirements_cpu.txt
22
-r python_src/requirements/requirements_dml.txt
3+
-r python_src/requirements/requirements_cpu_linux.txt

0 commit comments

Comments
 (0)