Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tests for --output parameter for demo (CLI and exportable) #2043

Merged
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion otx/api/usecases/exportable_code/demo/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
openvino==2022.3.0
openmodelzoo-modelapi==2022.3.0
otx @ git+https://github.com/openvinotoolkit/training_extensions/@2663e4ad1f4819d1de8b32ff77e0b24cc803b9c6#egg=otx
otx==1.2.0
numpy>=1.21.0,<=1.23.5 # np.bool was removed in 1.24.0 which was used in openvino runtime
15 changes: 14 additions & 1 deletion tests/test_suite/run_test_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,8 +323,11 @@ def otx_demo_testing(template, root, otx_dir, args):
os.path.join(otx_dir, args["--input"]),
"--delay",
"-1",
"--output",
os.path.join(template_work_dir, "output"),
]
check_run(command_line)
assert os.path.exists(os.path.join(template_work_dir, "output"))


def otx_demo_openvino_testing(template, root, otx_dir, args):
Expand All @@ -339,8 +342,11 @@ def otx_demo_openvino_testing(template, root, otx_dir, args):
os.path.join(otx_dir, args["--input"]),
"--delay",
"-1",
"--output",
os.path.join(template_work_dir, "output"),
]
check_run(command_line)
assert os.path.exists(os.path.join(template_work_dir, "output"))


def otx_deploy_openvino_testing(template, root, otx_dir, args):
Expand Down Expand Up @@ -394,9 +400,12 @@ def otx_deploy_openvino_testing(template, root, otx_dir, args):
"-i",
os.path.join(otx_dir, args["--input"]),
"--no_show",
"--output",
os.path.join(deployment_dir, "output"),
],
cwd=os.path.join(deployment_dir, "python"),
)
assert os.path.exists(os.path.join(deployment_dir, "output"))


def otx_eval_deployment_testing(template, root, otx_dir, args, threshold=0.0):
Expand Down Expand Up @@ -429,18 +438,22 @@ def otx_eval_deployment_testing(template, root, otx_dir, args, threshold=0.0):

def otx_demo_deployment_testing(template, root, otx_dir, args):
template_work_dir = get_template_dir(template, root)
deployment_dir = f"{template_work_dir}/deployed_{template.model_template_id}"
command_line = [
"otx",
"demo",
template.model_template_path,
"--load-weights",
f"{template_work_dir}/deployed_{template.model_template_id}/openvino.zip",
f"{deployment_dir}/openvino.zip",
"--input",
os.path.join(otx_dir, args["--input"]),
"--delay",
"-1",
"--output",
os.path.join(deployment_dir, "output"),
]
check_run(command_line)
assert os.path.exists(os.path.join(deployment_dir, "output"))


def pot_optimize_testing(template, root, otx_dir, args):
Expand Down