Skip to content

Commit edf2b51

Browse files
committed
Add Support for POT and NNCF Compression in OpenVINO Export
Signed-off-by: Haroon <[email protected]>
1 parent 22d0558 commit edf2b51

File tree

1 file changed

+16
-13
lines changed

1 file changed

+16
-13
lines changed

tests/integration/cli/test_cli.py

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -160,33 +160,36 @@ def test_predict_with_image_path(self, project_path: Path) -> None:
160160
[
161161
(ExportType.TORCH, None),
162162
(ExportType.ONNX, None),
163-
(ExportType.OPENVIVO, None),
164-
(ExportType.OPENVIVO, CompressionType.POT),
165-
(ExportType.OPENVIVO, CompressionType.NNCF),
163+
(ExportType.OPENVINO, None),
164+
(ExportType.OPENVINO, CompressionType.POT),
165+
(ExportType.OPENVINO, CompressionType.NNCF),
166166
],
167167
)
168168
def test_export(
169169
self,
170170
project_path: Path,
171171
export_type: ExportType,
172+
compression_type: CompressionType | None,
172173
) -> None:
173174
"""Test the export method of the CLI.
174175
175176
Args:
176177
dataset_path (Path): Root of the synthetic/original dataset.
177178
project_path (Path): Path to temporary project folder.
178179
export_type (ExportType): Export type.
180+
compression_type (CompressionType): Compression type (if any).
179181
"""
180-
AnomalibCLI(
181-
args=[
182-
"export",
183-
"--export_type",
184-
export_type,
185-
*self._get_common_cli_args(None, project_path),
186-
"--ckpt_path",
187-
f"{project_path}/Padim/MVTec/dummy/v0/weights/lightning/model.ckpt",
188-
],
189-
)
182+
args = [
183+
"export",
184+
"--export_type",
185+
export_type,
186+
*self._get_common_cli_args(None, project_path),
187+
"--ckpt_path",
188+
f"{project_path}/Padim/MVTec/dummy/v0/weights/lightning/model.ckpt",
189+
]
190+
if compression_type:
191+
args += ["--compression_type", str(compression_type)]
192+
AnomalibCLI(args=args)
190193

191194
@staticmethod
192195
def _get_common_cli_args(dataset_path: Path | None, project_path: Path) -> list[str]:

0 commit comments

Comments
 (0)