Created
September 7, 2021 16:18
-
-
Save J3698/3b6d70fc766549785a62e89a777de888 to your computer and use it in GitHub Desktop.
Optimize model for OAK-1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def optimize_model(name): | |
optimizer_path = "/opt/intel/openvino_2020.1.023/" + \ | |
"deployment_tools/model_optimizer/mo.py" | |
subprocess.run(["python3", optimizer_path, | |
"--input_model", f"./exports/{name}.onnx", | |
"--data_type", "FP16"]) | |
os.rename(name + ".bin", os.path.join("./exports", name + ".bin")) | |
os.rename(name + ".xml", os.path.join("./exports", name + ".xml")) | |
os.rename(name + ".mapping", os.path.join("./exports", name + ".mapping")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment