25 lines
574 B
Python
25 lines
574 B
Python
|
import subprocess
|
||
|
from helpers.app_settings import get_app_settings
|
||
|
|
||
|
settings = get_app_settings()
|
||
|
|
||
|
input_path = f"{settings.app.build_dir}/inference_recognition_model.onnx"
|
||
|
|
||
|
|
||
|
optimization_style = settings.app.optimization_style
|
||
|
target_platform = settings.app.optimization_style
|
||
|
|
||
|
# Build the command
|
||
|
command = [
|
||
|
"python",
|
||
|
"-m",
|
||
|
"onnxruntime.tools.convert_onnx_models_to_ort",
|
||
|
input_path,
|
||
|
"--output_dir", "ort_files",
|
||
|
"--optimization_style", optimization_style,
|
||
|
"--target_platform", target_platform
|
||
|
]
|
||
|
|
||
|
# Run it
|
||
|
subprocess.run(command, check=True)
|