@@ -622,11 +622,39 @@ def filtered(launcher, targets, args):
622
622
return targets and launcher .get ('device' , '' ).lower () not in targets
623
623
624
624
625
+ def complete_openvino_launchers (launchers , use_new_api ):
626
+ if use_new_api is None :
627
+ return launchers
628
+ orig_ov_launchers = []
629
+ updated_ov_launchers = []
630
+
631
+ for idx , launcher in enumerate (launchers ):
632
+ fwk = launcher .get ('framework' )
633
+ if fwk not in ['openvino' , 'dlsdk' ]:
634
+ continue
635
+ if use_new_api :
636
+ if fwk == 'openvino' :
637
+ orig_ov_launchers .append (idx )
638
+ else :
639
+ updated_ov_launchers .append (idx )
640
+ else :
641
+ if fwk == 'openvino' :
642
+ updated_ov_launchers .append (idx )
643
+ else :
644
+ orig_ov_launchers .append (idx )
645
+ if not orig_ov_launchers :
646
+ for idx in updated_ov_launchers :
647
+ launchers [idx ]['framework' ] = 'openvino' if use_new_api else 'dlsdk'
648
+ return launchers
649
+
650
+
625
651
def filter_models (config , target_devices , args ):
626
652
models_after_filtration = []
627
653
for model in config ['models' ]:
628
654
launchers_after_filtration = []
629
655
launchers = model ['launchers' ]
656
+ if 'use_new_api' in args :
657
+ launchers = complete_openvino_launchers (launchers , args ['use_new_api' ])
630
658
for launcher in launchers :
631
659
if 'device' not in launcher and target_devices :
632
660
for device in target_devices :
@@ -661,6 +689,8 @@ def filter_modules(config, target_devices, args):
661
689
continue
662
690
module_config = evaluation ['module_config' ]
663
691
launchers = module_config ['launchers' ]
692
+ if 'use_new_api' in args :
693
+ launchers = complete_openvino_launchers (launchers , args ['use_new_api' ])
664
694
if target_devices :
665
695
launchers_without_device = [launcher for launcher in launchers if 'device' not in launcher ]
666
696
for launcher in launchers_without_device :
@@ -856,11 +886,6 @@ def _async_evaluation_args(launcher_entry):
856
886
857
887
if launcher_entry ['framework' ].lower () not in ['dlsdk' , 'openvino' ]:
858
888
return launcher_entry
859
- if 'use_new_api' in arguments and arguments .use_new_api is not None :
860
- if launcher_entry ['framework' ].lower () == 'dlsdk' and arguments .use_new_api :
861
- launcher_entry ['framework' ] = 'openvino'
862
- elif launcher_entry ['framework' ].lower () == 'openvino' and not arguments .use_new_api :
863
- launcher_entry ['framework' ] = 'dlsdk'
864
889
865
890
launcher_entry .update (update_launcher_entry )
866
891
_convert_models_args (launcher_entry )
0 commit comments