import logging as log from common.samples_common_test_clas import SamplesCommonTestClass from common.samples_common_test_clas import get_tests from common.common_comparations import check_image_if_box from common.samples_common_test_clas import Environment log.basicConfig(format="[ %(levelname)s ] %(message)s", level=log.INFO, stream=sys.stdout) test_data_ssd_person_and_bicycles_detection_fp32 = \ get_tests(cmd_params={'i': [os.path.join('any', 'person_detection.png')], 'm': [os.path.join('FP32', 'pedestrian-detection-adas-0002.xml'), os.path.join('FP32', 'person-vehicle-bike-detection-crossroad-1016.xml'), os.path.join('FP32', 'pedestrian-and-vehicle-detector-adas-0001.xml')], 'batch': [1], 'd': ['CPU'], 'sample_type': ['C++', 'C']}, use_device=['d'] ) test_data_ssd_person_and_bicycles_detection_vehicle_fp32 = \ get_tests(cmd_params={'i': [os.path.join('any', 'car.bmp')], 'm': [os.path.join('FP32', 'vehicle-detection-adas-0002.xml')], 'batch': [1], 'd': ['CPU'], 'sample_type': ['C++', 'C']}, use_device=['d'] )
import pytest import sys import logging as log from common.samples_common_test_clas import SamplesCommonTestClass from common.samples_common_test_clas import get_tests from common.common_utils import parse_avg_err log.basicConfig(format="[ %(levelname)s ] %(message)s", level=log.INFO, stream=sys.stdout) test_data = get_tests(cmd_params={ 'i': [os.path.join('ark', 'dev93_10.ark')], 'm': [os.path.join('wsj', 'FP32', 'wsj_dnn5b.xml')], 'bs': [1, 2], 'o': ['res_output.ark'], 'r': [os.path.join('ark', 'dev93_scores_10.ark')], 'qb': [8, 16], 'd': ['GNA_SW_EXACT'] }, use_device=False) class TestSpeechSample(SamplesCommonTestClass): @classmethod def setup_class(cls): cls.sample_name = 'speech_sample' cls.threshold = 0.06 super().setup_class() @pytest.mark.parametrize("param", test_data) def test_speech_sample_nthreads(self, param):
import sys import logging as log from common.samples_common_test_clas import SamplesCommonTestClass from common.samples_common_test_clas import get_tests from common.common_utils import parse_avg_err log.basicConfig(format="[ %(levelname)s ] %(message)s", level=log.INFO, stream=sys.stdout) test_data_nthreads = get_tests(cmd_params={ 'i': [os.path.join('ark', 'dev93_10.ark')], 'm': [os.path.join('FP32', 'wsj_dnn5b.xml')], 'bs': [1, 2], 'o': ['res_output.ark'], 'r': [os.path.join('ark', 'dev93_scores_10.ark')], 'qb': [8, 16], 'nthreads': [1], 'd': ['GNA_SW'] }, use_device=False) test_data_nthreads_negative = get_tests(cmd_params={ 'i': [os.path.join('ark', 'dev93_10.ark')], 'm': [os.path.join('FP32', 'wsj_dnn5b.xml')], 'bs': [1], 'o': ['res_output.ark'], 'r': [os.path.join('ark', 'dev93_scores_10.ark')], 'qb': [8], 'nthreads': [0, -2], 'd': ['GNA_SW']
import re import sys import logging as log from common.samples_common_test_clas import SamplesCommonTestClass from common.samples_common_test_clas import get_tests log.basicConfig(format="[ %(levelname)s ] %(message)s", level=log.INFO, stream=sys.stdout) test_data_fp32 = get_tests(cmd_params={ 'i': [os.path.join('227x227', 'dog.bmp')], 'm': [ os.path.join('squeezenet1.1', 'caffe_squeezenet_v1_1_FP32_batch_1_seqlen_[1]_v10.xml') ], 'nt': ['1'], 'sample_type': ['C++', 'Python'], 'batch': [1, 2, 4], 'd': ['CPU'] }, use_device=['d']) test_data_fp16 = get_tests(cmd_params={ 'i': [os.path.join('227x227', 'dog.bmp')], 'm': [ os.path.join('squeezenet1.1', 'caffe_squeezenet_v1_1_FP16_batch_1_seqlen_[1]_v10.xml') ], 'nt': ['1'], 'sample_type': ['C++', 'Python'], 'batch': [1, 2, 4],
import os import pytest import re import sys import logging as log from common.samples_common_test_clas import SamplesCommonTestClass from common.samples_common_test_clas import get_tests log.basicConfig(format="[ %(levelname)s ] %(message)s", level=log.INFO, stream=sys.stdout) test_data_fp32 = get_tests(cmd_params={ 'i': [os.path.join('227x227', 'dog.bmp')], 'm': [os.path.join('squeezenet1.1', 'FP32', 'squeezenet1.1.xml')], 'sample_type': ['C++', 'Python'], 'batch': [1, 2, 4], 'd': ['CPU'] }, use_device=['d']) test_data_fp16 = get_tests(cmd_params={ 'i': [os.path.join('227x227', 'dog.bmp')], 'm': [os.path.join('squeezenet1.1', 'FP16', 'squeezenet1.1.xml')], 'sample_type': ['C++', 'Python'], 'batch': [1, 2, 4], 'd': ['CPU'] }, use_device=['d']) class TestClassification(SamplesCommonTestClass):
limitations under the License. """ import os import pytest import re import sys import logging as log from common.samples_common_test_clas import get_tests from common.samples_common_test_clas import SamplesCommonTestClass log.basicConfig(format="[ %(levelname)s ] %(message)s", level=log.INFO, stream=sys.stdout) test_data_fp32 = get_tests(cmd_params={'i': [os.path.join('224x224', 'dog6.yuv')], 'm': [os.path.join('squeezenet1.1', 'FP32', 'squeezenet1.1.xml')], 'size': ['224x224'], 'sample_type': ['C++', 'C'], 'd': ['CPU']}, use_device=['d'] ) class TestHelloNV12Input(SamplesCommonTestClass): @classmethod def setup_class(cls): cls.sample_name = 'hello_nv12_input_classification' super().setup_class() @pytest.mark.parametrize("param", test_data_fp32) def test_hello_nv12_input_classification_fp32(self, param): _check_output(self, param=param)
See the License for the specific language governing permissions and limitations under the License. """ import os import pytest import logging as log import sys from common.samples_common_test_clas import get_tests from common.samples_common_test_clas import SamplesCommonTestClass from common.specific_samples_parsers import parse_hello_reshape_ssd log.basicConfig(format="[ %(levelname)s ] %(message)s", level=log.INFO, stream=sys.stdout) test_data_fp32 = get_tests(cmd_params={'i': [os.path.join('500x500', 'cat.bmp')], 'm': [os.path.join('ssd512', 'FP32', 'ssd512.xml')], 'd': ['CPU']}, use_device=['d'], use_batch=False ) class TestHelloShape(SamplesCommonTestClass): @classmethod def setup_class(cls): cls.sample_name = 'hello_reshape_ssd' super().setup_class() @pytest.mark.parametrize("param", test_data_fp32) def test_hello_reshape_ssd_fp32(self, param): """ Hello_reshape_ssd has functional testing. This function get stdout from hello_reshape_ssd (already splitted by new line)
import os import pytest import logging as log import sys from common.samples_common_test_clas import get_tests from common.samples_common_test_clas import SamplesCommonTestClass from common.specific_samples_parsers import parse_hello_reshape_ssd log.basicConfig(format="[ %(levelname)s ] %(message)s", level=log.INFO, stream=sys.stdout) test_data_fp32 = get_tests(cmd_params={ 'i': [os.path.join('500x500', 'cat.bmp')], 'm': [os.path.join('ssd300', 'caffe_ssd_300_FP32_v10.xml')], 'd': ['CPU'], 'batch': [1, 2, 4] }, use_device=['d'], use_batch=True) class TestHelloShape(SamplesCommonTestClass): @classmethod def setup_class(cls): cls.sample_name = 'hello_reshape_ssd' super().setup_class() @pytest.mark.parametrize("param", test_data_fp32) def test_hello_reshape_ssd_fp32(self, param): """ Hello_reshape_ssd has functional testing.
import subprocess from common.samples_common_test_clas import get_tests from common.samples_common_test_clas import SamplesCommonTestClass from common.samples_common_test_clas import Environment from common.common_utils import shell from pathlib import Path import shutil log.basicConfig(format="[ %(levelname)s ] %(message)s", level=log.INFO, stream=sys.stdout) test_data_fp32 = get_tests(cmd_params={ 'i': [os.path.join('227x227', 'dog.bmp')], 'm': [os.path.join('squeezenet1.1', 'FP32', 'squeezenet1.1.xml')], 'd': ['CPU'], 'sample_type': ['C++', 'C'] }, use_device=['d']) test_data_fp32_unicode = get_tests(cmd_params={ 'i': [os.path.join('227x227', 'dog.bmp')], 'm': [os.path.join('squeezenet1.1', 'FP32', 'squeezenet1.1.xml')], 'd': ['CPU'], 'sample_type': ['C++', 'C'] }, use_device=['d']) class TestHello(SamplesCommonTestClass): @classmethod
import re import sys import logging as log from common.samples_common_test_clas import get_tests from common.samples_common_test_clas import SamplesCommonTestClass log.basicConfig(format="[ %(levelname)s ] %(message)s", level=log.INFO, stream=sys.stdout) test_data_fp32 = get_tests(cmd_params={ 'i': [os.path.join('224x224', 'dog6.yuv')], 'm': [ os.path.join('squeezenet1.1', 'caffe_squeezenet_v1_1_FP32_batch_1_seqlen_[1]_v10.xml') ], 'size': ['224x224'], 'sample_type': ['C++', 'C'], 'd': ['CPU'] }, use_device=['d']) class TestHelloNV12Input(SamplesCommonTestClass): @classmethod def setup_class(cls): cls.sample_name = 'hello_nv12_input_classification' super().setup_class() @pytest.mark.parametrize("param", test_data_fp32) def test_hello_nv12_input_classification_fp32(self, param):
from common.samples_common_test_clas import SamplesCommonTestClass from common.samples_common_test_clas import Environment from common.samples_common_test_clas import get_tests from common.common_utils import parse_avg_err log.basicConfig(format="[ %(levelname)s ] %(message)s", level=log.INFO, stream=sys.stdout) test_data = get_tests(cmd_params={ 'i': [os.path.join('ark', 'dev93_10.ark')], 'm': [os.path.join('wsj', 'FP32', 'wsj_dnn5b.xml')], 'layout': ["[NC]"], 'bs': [1, 2], 'o': ['res_output.ark'], 'r': [os.path.join('ark', 'dev93_scores_10.ark')], 'qb': [8, 16], 'sf': ["2175.43"], 'q': ["static", "user"], 'd': ['GNA_SW_EXACT'] }, use_device=False) new_format_test_data = get_tests(cmd_params={ 'i': [ 'Parameter=' + os.path.join(Environment.env['test_data'], 'ark', 'dev93_10.ark') ], 'm': [os.path.join('wsj', 'FP32', 'wsj_dnn5b.xml')], 'layout': ["[NC]"], 'bs': [1],
See the License for the specific language governing permissions and limitations under the License. """ import os import pytest import re import sys import logging as log from common.samples_common_test_clas import get_tests from common.samples_common_test_clas import SamplesCommonTestClass log.basicConfig(format="[ %(levelname)s ] %(message)s", level=log.INFO, stream=sys.stdout) test_data = get_tests(cmd_params={'sample_type': ['Python', 'C++']}) class TestHelloQueryDevice(SamplesCommonTestClass): @classmethod def setup_class(cls): cls.sample_name = 'hello_query_device' super().setup_class() @pytest.mark.parametrize("param", test_data) def test_hello_query_device(self, param): """ Hello Query Device test has functional and accuracy tests. For accuracy find in output line available devices """
import os import pytest import sys import logging as log from common.samples_common_test_clas import SamplesCommonTestClass from common.samples_common_test_clas import get_tests from common.common_utils import parse_avg_err log.basicConfig(format="[ %(levelname)s ] %(message)s", level=log.INFO, stream=sys.stdout) test_data = get_tests(cmd_params={'i': [os.path.join('ark', 'dev93_10.ark')], 'm': [os.path.join('wsj', 'FP32', 'wsj_dnn5b.xml')], 'layout': ["[NC]"], 'bs': [1, 2], 'o': ['res_output.ark'], 'r': [os.path.join('ark', 'dev93_scores_10.ark')], 'qb': [8, 16], 'sf': ["Parameter:2175.43", "2175.43"], 'q': ["static", "user"], 'd': ['GNA_SW_EXACT']}, use_device=False ) class TestSpeechSample(SamplesCommonTestClass): @classmethod def setup_class(cls): cls.sample_name = 'speech_sample' cls.threshold = 0.06 super().setup_class() @pytest.mark.parametrize("param", test_data) def test_speech_sample_nthreads(self, param):