Skip to content

Commit

Permalink
Test OpenVINO export (openvinotoolkit#1681)
Browse files Browse the repository at this point in the history
Signed-off-by: Adrian Boguszewski <adrian.boguszewski@intel.com>
Co-authored-by: Samet Akcay <samet.akcay@intel.com>
  • Loading branch information
adrianboguszewski and samet-akcay authored Feb 13, 2024
1 parent 13b6a7c commit a892215
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions tests/integration/model/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ def models() -> list[str]:
return get_available_models()


def export_types() -> list[ExportType]:
"""Return all available export frameworks."""
return list(ExportType)


class TestAPI:
"""Do sanity check on all models."""

Expand Down Expand Up @@ -116,11 +121,19 @@ def test_predict(self, model_name: str, dataset_path: Path, project_path: Path)
)

@pytest.mark.parametrize("model_name", models())
def test_export(self, model_name: str, dataset_path: Path, project_path: Path) -> None:
@pytest.mark.parametrize("export_type", export_types())
def test_export(
self,
model_name: str,
export_type: ExportType,
dataset_path: Path,
project_path: Path,
) -> None:
"""Export model from checkpoint.
Args:
model_name (str): Name of the model.
export_type (ExportType): Framework to export to.
dataset_path (Path): Root to dataset from fixture.
project_path (Path): Path to temporary project folder from fixture.
"""
Expand All @@ -145,7 +158,7 @@ def test_export(self, model_name: str, dataset_path: Path, project_path: Path) -
model=model,
datamodule=dataset,
ckpt_path=f"{project_path}/{model_name}/dummy/weights/last.ckpt",
export_type=ExportType.ONNX,
export_type=export_type,
input_size=input_size,
)

Expand Down

0 comments on commit a892215

Please sign in to comment.