Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions external/anomaly/tasks/inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import io
import os
import shutil
import subprocess # nosec
import subprocess
import tempfile
from glob import glob
from typing import Dict, List, Optional, Union
Expand Down Expand Up @@ -242,8 +242,8 @@ def export(self, export_type: ExportType, output_model: ModelEntity) -> None:
logger.info("Exporting the OpenVINO model.")
onnx_path = os.path.join(self.config.project.path, "onnx_model.onnx")
self._export_to_onnx(onnx_path)
optimize_command = "mo --input_model " + onnx_path + " --output_dir " + self.config.project.path
subprocess.call(optimize_command, shell=True)
optimize_command = ["mo", "--input_model", onnx_path, "--output_dir", self.config.project.path]
subprocess.run(optimize_command, check=True)
bin_file = glob(os.path.join(self.config.project.path, "*.bin"))[0]
xml_file = glob(os.path.join(self.config.project.path, "*.xml"))[0]
with open(bin_file, "rb") as file:
Expand Down