|
58 | 58 | OTETestNNCFAction,
|
59 | 59 | OTETestNNCFEvaluationAction,
|
60 | 60 | OTETestNNCFExportAction,
|
61 |
| - OTETestNNCFExportEvaluationAction) |
| 61 | + OTETestNNCFExportEvaluationAction, |
| 62 | + OTETestNNCFGraphAction) |
62 | 63 |
|
63 | 64 | logger = get_logger(__name__)
|
64 | 65 |
|
@@ -119,6 +120,7 @@ def get_anomaly_test_action_classes() -> List[Type[BaseOTETestAction]]:
|
119 | 120 | OTETestNNCFEvaluationAction,
|
120 | 121 | OTETestNNCFExportAction,
|
121 | 122 | OTETestNNCFExportEvaluationAction,
|
| 123 | + OTETestNNCFGraphAction, |
122 | 124 | ]
|
123 | 125 |
|
124 | 126 |
|
@@ -294,7 +296,8 @@ def get_list_of_tests(cls, usecase: Optional[str] = None):
|
294 | 296 |
|
295 | 297 | @pytest.fixture
|
296 | 298 | def params_factories_for_test_actions_fx(self, current_test_parameters_fx,
|
297 |
| - dataset_definitions_fx, template_paths_fx) -> Dict[str,Callable[[], Dict]]: |
| 299 | + dataset_definitions_fx,ote_current_reference_dir_fx, |
| 300 | + template_paths_fx) -> Dict[str,Callable[[], Dict]]: |
298 | 301 | logger.debug('params_factories_for_test_actions_fx: begin')
|
299 | 302 |
|
300 | 303 | test_parameters = deepcopy(current_test_parameters_fx)
|
@@ -323,8 +326,36 @@ def _training_params_factory() -> Dict:
|
323 | 326 | 'patience': patience,
|
324 | 327 | 'batch_size': batch_size,
|
325 | 328 | }
|
| 329 | + |
| 330 | + def _nncf_graph_params_factory() -> Dict: |
| 331 | + if dataset_definitions is None: |
| 332 | + pytest.skip('The parameter "--dataset-definitions" is not set') |
| 333 | + |
| 334 | + model_name = test_parameters['model_name'] |
| 335 | + dataset_name = test_parameters['dataset_name'] |
| 336 | + |
| 337 | + dataset_params = _get_dataset_params_from_dataset_definitions(dataset_definitions, dataset_name) |
| 338 | + |
| 339 | + if model_name not in template_paths: |
| 340 | + raise ValueError(f'Model {model_name} is absent in template_paths, ' |
| 341 | + f'template_paths.keys={list(template_paths.keys())}') |
| 342 | + template_path = make_path_be_abs(template_paths[model_name], template_paths[ROOT_PATH_KEY]) |
| 343 | + |
| 344 | + logger.debug('training params factory: Before creating dataset and labels_schema') |
| 345 | + dataset, labels_schema = _create_anomaly_classification_dataset_and_labels_schema(dataset_params, dataset_name) |
| 346 | + logger.debug('training params factory: After creating dataset and labels_schema') |
| 347 | + |
| 348 | + return { |
| 349 | + 'dataset': dataset, |
| 350 | + 'labels_schema': labels_schema, |
| 351 | + 'template_path': template_path, |
| 352 | + 'reference_dir': ote_current_reference_dir_fx, |
| 353 | + 'fn_get_compressed_model': None #NNCF not yet implemented in Anomaly |
| 354 | + } |
| 355 | + |
326 | 356 | params_factories_for_test_actions = {
|
327 |
| - 'training': _training_params_factory |
| 357 | + 'training': _training_params_factory, |
| 358 | + 'nncf_graph': _nncf_graph_params_factory, |
328 | 359 | }
|
329 | 360 | logger.debug('params_factories_for_test_actions_fx: end')
|
330 | 361 | return params_factories_for_test_actions
|
|
0 commit comments