Skip to content

Commit

Permalink
Merge pull request #1221 from openvinotoolkit/fix/ashwin/remove_shell
Browse files Browse the repository at this point in the history
[Anomaly Task] Change OpenVINO MO Command
chuneuny-emily authored Aug 30, 2022

Unverified

This user has not yet uploaded their public signing key.
2 parents 2dc9515 + 489fa45 commit 1022e47
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions external/anomaly/tasks/inference.py
Original file line number Diff line number Diff line change
@@ -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
@@ -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:

0 comments on commit 1022e47

Please sign in to comment.