repo stringclasses 454
values | file_path stringlengths 5 201 | extension stringclasses 1
value | content stringlengths 8 509k | num_lines int64 3 16.9k | size_bytes int64 8 511k |
|---|---|---|---|---|---|
openvino | tests/e2e_tests/common/model_loader/load_pytorch_model.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import logging as log
import os
import torch
from e2e_tests.test_utils.pytorch_loaders import *
from e2e_tests.common.model_loader.provider import ClassProvider
class PyTorchModelLoader(ClassProvider):
"""PyTorch models loader ru... | 50 | 1,682 |
openvino | tests/e2e_tests/common/infer/provider.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import inspect
from e2e_tests.test_utils.test_utils import log_timestamp
from e2e_tests.common.common.base_provider import BaseProvider, BaseStepProvider
class ClassProvider(BaseProvider):
registry = {}
@classmethod
def va... | 36 | 1,257 |
openvino | tests/e2e_tests/common/infer/__init__.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
from .dummy_infer_class import use_dummy
from .provider import StepProvider
try:
from .common_inference import Infer
except ImportError as e:
Infer = use_dummy('ie_sync', str(e))
| 11 | 271 |
openvino | tests/e2e_tests/common/infer/common_inference.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
"""Inference engine runners."""
# pylint:disable=import-error
import logging as log
import os
import platform
import sys
from pprint import pformat
import numpy as np
from e2e_tests.utils.test_utils import align_input_names, get_shapes_... | 247 | 10,016 |
openvino | tests/e2e_tests/common/infer/dummy_infer_class.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
"""
Dummy infer provider to be used when real provider is unavailable due to absence of IE Python API
e.g. for IR collection environment
"""
from .provider import ClassProvider
def use_dummy(name, message):
class DummyInfer(ClassPr... | 22 | 529 |
openvino | tests/e2e_tests/common/infer/network_modifiers/container.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import inspect
from e2e_tests.common.common.base_provider import BaseProvider
class ClassProvider(BaseProvider):
registry = {}
@classmethod
def validate(cls):
methods = [
f[0] for f in inspect.getmember... | 31 | 914 |
openvino | tests/e2e_tests/common/infer/network_modifiers/network_modifiers.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
"""IE network modifiers applied to IE network."""
import logging as log
import sys
from e2e_tests.utils.test_utils import align_input_names
from e2e_tests.common.test_utils import get_shapes_from_data, convert_shapes_to_partial_shape
f... | 141 | 4,582 |
openvino | tests/e2e_tests/common/common/pipeline.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import e2e_tests.common.readers
import e2e_tests.common.preprocessors
import e2e_tests.common.preprocessors_tf_hub
import e2e_tests.common.ir_provider
import e2e_tests.common.infer
import e2e_tests.common.postprocessors
import e2e_tests.... | 65 | 2,676 |
openvino | tests/e2e_tests/common/common/base_provider.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
class BaseProviderMeta(type):
def __new__(mcs, name, bases, attrs, **kwargs):
cls = super().__new__(mcs, name, bases, attrs)
# do not create container for abstract provider
if '_is_base_provider' in attrs:
... | 65 | 2,116 |
openvino | tests/e2e_tests/common/common/dummy_comparator.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
from collections import OrderedDict
from e2e_tests.common.common.common_base_class import CommonConfig
from e2e_tests.pipelines.pipeline_templates.comparators_template import dummy_comparators
from e2e_tests.pipelines.pipeline_templates... | 35 | 1,733 |
openvino | tests/e2e_tests/common/common/e2e_utils.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
from openvino import Core, Model
import torch
from typing import Any
import logging
log = logging.getLogger(__name__)
def collect_tensor_names(instance: Model, tensor_type_name: str, out: dict) -> dict:
"""
@param instance: Re... | 77 | 2,746 |
openvino | tests/e2e_tests/common/common/common_base_class.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import os
import re
from copy import deepcopy
from pathlib import Path
from tempfile import TemporaryDirectory
from logging import getLogger
import numpy as np
import pytest
from e2e_tests.test_utils.path_utils import resolve_file_path... | 211 | 9,553 |
openvino | tests/e2e_tests/common/readers/provider.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import inspect
from e2e_tests.common.common.base_provider import BaseProvider, BaseStepProvider
class ClassProvider(BaseProvider):
registry = {}
@classmethod
def validate(cls):
methods = [
f[0] for f i... | 39 | 1,230 |
openvino | tests/e2e_tests/common/readers/readers.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
"""File readers."""
# pylint:disable=no-member
import numpy as np
import cv2
import logging as log
import sys
from copy import deepcopy
from e2e_tests.test_utils.path_utils import resolve_file_path
from e2e_tests.test_utils.tf_hub_utils... | 171 | 5,802 |
openvino | tests/e2e_tests/common/plugins/reshape_tests/conftest.py | .py | import inspect
import itertools
import logging as log
import os
import sys
import traceback
from contextlib import contextmanager
from copy import copy, deepcopy
from types import SimpleNamespace
import pytest
import yaml
import e2e_tests.common.plugins.common.base_conftest as base
from e2e_tests.test_utils.reshape_t... | 217 | 10,797 |
openvino | tests/e2e_tests/common/plugins/common/base_conftest.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
"""Local pytest plugins shared code."""
import importlib.util
import inspect
import os
from fnmatch import fnmatch
from glob import glob
from inspect import getsourcefile
from _pytest.mark import MarkDecorator
from e2e_tests.common.pyt... | 122 | 4,445 |
openvino | tests/e2e_tests/common/plugins/common/conftest.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
"""
Basic high-level plugin file for pytest.
See [Writing plugins](https://docs.pytest.org/en/latest/writing_plugins.html)
for more information.
This plugin adds the following command-line options:
* `--modules` - Paths to modules to ... | 612 | 21,318 |
openvino | tests/e2e_tests/common/plugins/ref_collect/conftest.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
"""Local pytest plugin for reference collection."""
import logging as log
import yaml
import e2e_tests.common.plugins.common.base_conftest as base
from e2e_tests.common.env_utils import fix_env_conf
from e2e_tests.test_utils.env_tools... | 57 | 2,178 |
openvino | tests/e2e_tests/common/plugins/e2e_test/conftest.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
"""Local pytest plugin for tests execution."""
import inspect
import itertools
import logging as log
# pylint:disable=import-error
import re
import os
import sys
import traceback
from copy import copy
from pathlib import Path
import py... | 411 | 17,173 |
openvino | tests/e2e_tests/common/postprocessors/provider.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import inspect
import torch
from e2e_tests.common.common.base_provider import BaseProvider, BaseStepProvider
class ClassProvider(BaseProvider):
registry = {}
@classmethod
def validate(cls):
methods = [
... | 49 | 1,606 |
openvino | tests/e2e_tests/common/postprocessors/ctc.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
"""CTC output postprocessor"""
import string
import numpy as np
from tensorflow.keras import backend as k
from .provider import ClassProvider
class ParseCTCOutput(ClassProvider):
"""Transforms CTC output to dictionary {"predictio... | 60 | 2,251 |
openvino | tests/e2e_tests/common/postprocessors/filters.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import numpy as np
from .provider import ClassProvider
class FilterByLabels(ClassProvider):
__action_name__ = 'classes_filter'
def __init__(self, config):
self.classes = config.get("classes", [])
def apply(self, d... | 90 | 3,120 |
openvino | tests/e2e_tests/common/postprocessors/semantic_segmentation.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
"""Semantic segmentation postprocessor"""
from .provider import ClassProvider
import numpy as np
import logging as log
class ParseSemanticSegmentation(ClassProvider):
"""Semantic segmentation parser"""
__action_name__ = "parse_... | 32 | 1,128 |
openvino | tests/e2e_tests/common/postprocessors/classification.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
"""Classification postprocessor."""
from .provider import ClassProvider
import numpy as np
from collections import OrderedDict
class ParseClassification(ClassProvider):
"""Classification parser."""
__action_name__ = "parse_clas... | 38 | 1,578 |
openvino | tests/e2e_tests/common/postprocessors/mask_rcnn.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
"""Mask RCNN postprocessor"""
import logging as log
import sys
import cv2
import numpy as np
from .provider import ClassProvider
class ParseMaskRCNN(ClassProvider):
"""Semantic segmentation parser
returns new "score" layer, c... | 70 | 3,160 |
openvino | tests/e2e_tests/common/postprocessors/image_modifications.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
"""Postprocessor for image modification tasks such as super-resolution, style transfer.
It takes normalized image and converts it back to colored picture"""
from .provider import ClassProvider
import numpy as np
import logging as log
... | 31 | 1,219 |
openvino | tests/e2e_tests/common/postprocessors/common.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
"""Common postprocessors."""
import numpy as np
from e2e_tests.common.preprocessors.preprocessors import SliceData, Normalize, CustomPreproc, RemoveLayersFromInputData, \
RenameInputs, Squeeze
from .provider import ClassProvider
c... | 230 | 6,367 |
openvino | tests/e2e_tests/common/postprocessors/object_detection.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
"""Object detection postprocessor."""
import logging as log
import numpy as np
from .provider import ClassProvider
class ParseBeforeODParser(ClassProvider):
"""Prepare the pipeline output to right state before parse_object_detect... | 227 | 9,313 |
openvino | tests/e2e_tests/common/postprocessors/YOLO.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import math
import numpy as np
from .provider import ClassProvider
PRECOMPUTED_ANCHORS = {
'yolo_v2': [1.3221, 1.73145, 3.19275, 4.00944, 5.05587, 8.09892, 9.47112, 4.84053, 11.2364, 10.0071],
'tiny_yolo_v2': [1.08, 1.19, 3.42... | 311 | 12,969 |
openvino | tests/e2e_tests/common/comparator/provider.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import inspect
from e2e_tests.common.common.base_provider import BaseProvider
class ClassProvider(BaseProvider):
__step_name__ = "compare"
registry = {}
@classmethod
def validate(cls):
methods = [
f... | 21 | 623 |
openvino | tests/e2e_tests/common/comparator/container.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
""" Postprocessors and comparators container.
Applies specified postprocessors to reference and IE results.
Applies specified comparators to reference and IE results.
Typical flow:
1. Initialize with `config` that specifies comparators... | 92 | 3,717 |
openvino | tests/e2e_tests/common/comparator/ocr.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
"""Optical character recognition output comparator.
Compares reference and IE model results for top-N paths.
Basic result example: list of paths with probabilities
"""
import logging as log
import sys
from .threshold_utils import get_... | 84 | 3,719 |
openvino | tests/e2e_tests/common/comparator/threshold_utils.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import sys
import logging as log
# default thresholds for comparators
DEFAULT_THRESHOLDS = {
"FP32": (1e-4, 1e-4, None),
"BF16": (2, 2, None),
"FP16": (0.01, 2, None)
}
DEFAULT_IOU_THRESHOLDS = {
"FP32": 0.9,
"BF16"... | 87 | 3,164 |
openvino | tests/e2e_tests/common/comparator/ssim.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import logging as log
import sys
import numpy as np
from skimage.metrics import structural_similarity as ssim
from .provider import ClassProvider
from e2e_tests.common.comparator.threshold_utils import get_default_ssim_threshold
class... | 85 | 4,336 |
openvino | tests/e2e_tests/common/comparator/semantic_segmentation.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import logging as log
import sys
import numpy as np
from e2e_tests.common.table_utils import make_table
from .provider import ClassProvider
from e2e_tests.common.comparator.threshold_utils import get_default_iou_threshold
class Seman... | 74 | 3,559 |
openvino | tests/e2e_tests/common/comparator/classification.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
"""Classification results comparator.
Compares reference and IE models results for top-N classes (usually, top-1 or
top-5).
Basic result example: list of 1000 class probabilities for ImageNet
classification dataset.
"""
import logging ... | 86 | 3,806 |
openvino | tests/e2e_tests/common/comparator/dummy.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import logging as log
from e2e_tests.common.table_utils import make_table
from .provider import ClassProvider
import sys
class Dummy(ClassProvider):
__action_name__ = "dummy"
log.basicConfig(
format="[ %(levelname)s ] ... | 39 | 1,388 |
openvino | tests/e2e_tests/common/comparator/ssim_4d.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import logging as log
import sys
from statistics import mean
from skimage.metrics import structural_similarity as ssim
from .provider import ClassProvider
from e2e_tests.common.comparator.threshold_utils import get_default_ssim_thresho... | 73 | 3,315 |
openvino | tests/e2e_tests/common/comparator/eltwise.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import logging as log
import re
import sys
import numpy as np
from e2e_tests.common.table_utils import make_table
from .provider import ClassProvider
from .threshold_utils import get_default_thresholds
class EltwiseComparator(ClassPr... | 131 | 6,679 |
openvino | tests/e2e_tests/common/comparator/object_detection.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import copy
import logging as log
import sys
from collections import OrderedDict
import numpy as np
from .threshold_utils import get_default_thresholds, get_default_iou_threshold
from e2e_tests.common.table_utils import make_table
from... | 267 | 14,324 |
openvino | tests/e2e_tests/common/preprocessors/provider.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import inspect
import numpy as np
import torch
from e2e_tests.common.common.base_provider import BaseProvider, BaseStepProvider
class ClassProvider(BaseProvider):
registry = {}
@classmethod
def validate(cls):
met... | 51 | 1,644 |
openvino | tests/e2e_tests/common/preprocessors/preprocessors.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
"""Data preprocessors applied to target layers in given data dictionary."""
import logging as log
import sys
# pylint:disable=no-member
import cv2
import numpy as np
from e2e_tests.test_utils.path_utils import resolve_file_path
from .p... | 502 | 18,334 |
openvino | tests/e2e_tests/common/preprocessors/transformers.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
from .provider import ClassProvider
import cv2
from random import randint
import numpy as np
import logging as log
import sys
log.basicConfig(format="[ %(levelname)s ] %(message)s", level=log.INFO, stream=sys.stdout)
class CVFlip(Clas... | 188 | 8,665 |
openvino | tests/conditional_compilation/test_cc.py | .py | #!/usr/bin/env python3
# Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
""" Test conditional compilation.
"""
import glob
import logging
import os
import sys
from pathlib import Path
import numpy as np
import pytest
from proc_utils import cmd_exec # pylint: disable=import-error
fr... | 147 | 5,788 |
openvino | tests/conditional_compilation/test_utils.py | .py | #!/usr/bin/env python3
# Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
""" Utility functions for work with json test configuration file.
"""
import os
import json
import multiprocessing
import sys
from inspect import getsourcefile
from pathlib import Path
from install_pkg import get_... | 93 | 3,237 |
openvino | tests/conditional_compilation/conftest.py | .py | #!/usr/bin/env python3
# Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
# pylint: disable=line-too-long
"""Pytest configuration for compilation tests."""
import json
import logging
import sys
from inspect import getsourcefile
from pathlib import Path
# add utils folder to imports
sy... | 287 | 9,486 |
openvino | tests/conditional_compilation/tools/infer_tool.py | .py | # !/usr/bin/env python3
# Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
# pylint:disable=invalid-name,no-name-in-module,logging-format-interpolation,redefined-outer-name
""" Tool for running inference and storing results in npz files.
"""
import argparse
import logging as log
import... | 89 | 2,880 |
openvino | tests/utils/utils.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
"""Utility module."""
from pathlib import Path
import yaml
from pymongo import MongoClient
from copy import deepcopy
import requests
import logging
import re
# constants
DATABASES = ['timetests', 'memorytests']
DB_COLLECTIONS = ["comm... | 91 | 3,452 |
openvino | tests/utils/proc_utils.py | .py | #!/usr/bin/env python3
# Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
""" Common utilities for working with processes.
"""
import logging
import subprocess
def cmd_exec(args, timeout=None, env=None, log=None, verbose=True, shell=False):
""" Run cmd using subprocess with loggi... | 47 | 1,220 |
openvino | tests/utils/path_utils.py | .py | #!/usr/bin/env python3
# Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
""" Common utilities for working with paths
"""
import argparse
import os
import sys
from pathlib import Path
# add utils folder to imports
UTILS_DIR = os.path.dirname(os.path.abspath(__file__))
sys.path.insert(... | 56 | 1,592 |
openvino | tests/utils/platform_utils.py | .py | #!/usr/bin/env python3
# Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
""" Common utilities for working with OSes or platforms
"""
import platform
import subprocess
import sys
from enum import Enum
import distro
class UnsupportedOsError(Exception):
"""Exception for unsupporte... | 107 | 2,820 |
openvino | tests/utils/install_pkg.py | .py | #!/usr/bin/env python3
# Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
""" Common utilities for OpenVINO install package.
"""
import errno
import os
from pathlib import Path
import subprocess
import sys
def get_openvino_environment(install_prefix: Path):
""" Get OpenVINO enviro... | 37 | 1,097 |
openvino | tests/stress_tests/scripts/get_testdata.py | .py | #!/usr/bin/env python3
# Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
""" Script to acquire model IRs for stress tests.
Usage: ./scrips/get_testdata.py
"""
# pylint:disable=line-too-long
import argparse
import json
import logging as log
import os
import shutil
import subprocess
imp... | 240 | 10,606 |
openvino | tests/stress_tests/scripts/run_memcheck.py | .py | #!/usr/bin/env python3
# Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
"""
This script runs memcheck tests isolated with help of gtest_parallel. It can
upload memory measurment results to database and generate reports.
"""
import argparse
import json
import logging
import os
import ... | 225 | 9,553 |
openvino | tests/stress_tests/scripts/memcheck_upload.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
"""
Upload metrics gathered by MemCheckTests into Mongo DB
Usage: ./scrips/memcheck_upload.py https://ci.intel.com/job/memchek/1234/ \
./gtest-parallel-logs/**/*.log \
--artifact_root ./gtest-parallel-logs --dryrun
"""
import a... | 366 | 13,627 |
openvino | tests/stress_tests/scripts/compare_memcheck_2_runs.py | .py | #!/usr/bin/env python3
# Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
"""
Create comparison table based on MemCheckTests results from 2 runs
Usage: ./scrips/compare_memcheck_2_runs.py cur_source ref_source \
--db_collection collection_name --out_file file_name
"""
# pylint:di... | 208 | 8,785 |
openvino | tests/fuzz/scripts/init_corpus.py | .py | #!/usr/bin/env python3
# Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
# Sample usage:
# ./scripts/init_corpus.py ./paddle_layer_models/**/*.pdmodel --join pdiparams
# mkdir -p corpus && find ./paddle_layer_models/ -name "*.fuzz" -exec cp \{\} .//import_paddle-corpus \;
import ar... | 57 | 1,918 |
openvino | scripts/utils/utils.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import os
import subprocess # nosec B404
import tarfile
from datetime import datetime
from shutil import copyfile, copytree, rmtree
major_version = 0
minor_version = 3
class Automation:
@staticmethod
def parse_bom(bom_path):
... | 60 | 2,151 |
openvino | thirdparty/itt_collector/runtool/sea_runtool.py | .py | # Intel® Single Event API
#
# This file is provided under the BSD 3-Clause license.
# Copyright (c) 2021, Intel Corporation
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
# Redistri... | 2,149 | 86,325 |
openvino | thirdparty/itt_collector/runtool/sea.py | .py | # Intel® Single Event API
#
# This file is provided under the BSD 3-Clause license.
# Copyright (c) 2021, Intel Corporation
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
# Redistri... | 302 | 12,987 |
openvino | thirdparty/itt_collector/runtool/python_compat.py | .py | # Intel® Single Event API
#
# This file is provided under the BSD 3-Clause license.
# Copyright (c) 2021, Intel Corporation
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
# Redistri... | 42 | 2,262 |
openvino | thirdparty/itt_collector/runtool/exporters/Stat.py | .py | # Intel® Single Event API
#
# This file is provided under the BSD 3-Clause license.
# Copyright (c) 2021, Intel Corporation
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
# Redistri... | 44 | 2,534 |
openvino | src/frontends/tensorflow_lite/tests/test_models/gen_wrapper.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import os
import subprocess
import sys
if len(sys.argv) < 4:
print("Script[model in pbtxt format], output folder and mark file must be specified as arguments", str(sys.argv))
exit(1)
gen_script = sys.argv[1]
out_folder = sys.ar... | 27 | 745 |
openvino | src/frontends/tensorflow_lite/tests/test_models/gen_scripts/generate_oob_builtin_opcode.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
# SDL505 fuzzing finding: generate minimal .tflite models with out-of-bounds
# builtin operator codes to test that the frontend rejects them cleanly (CWE-125).
#
# oob_deprecated_builtin_code.tflite — deprecated_builtin_code=-1 (0xFF as ... | 146 | 6,153 |
openvino | src/frontends/tensorflow_lite/tests/test_models/gen_scripts/generate_malformed_tensor_name.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
# Generate a crafted .tflite model whose Tensor.name field is absent.
#
# In the FlatBuffer schema for TensorFlow Lite, every table field is implicitly
# optional - the field is absent when its vtable slot offset is 0. The schema-
# gene... | 178 | 6,886 |
openvino | src/frontends/tensorflow_lite/tests/test_models/gen_scripts/generate_2in_2out.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import numpy as np
import os
import sys
# do not print messages from TensorFlow
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
import tensorflow as tf
tf.compat.v1.reset_default_graph()
# Create the graph and model
with tf.compat.v1.Session... | 53 | 1,869 |
openvino | src/frontends/tensorflow_lite/tests/test_models/gen_scripts/generate_bad_header.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import os
import sys
path_to_model_dir = os.path.join(sys.argv[1], "bad_header")
if not os.path.exists(path_to_model_dir):
os.makedirs(path_to_model_dir, exist_ok=True)
# Correct FOURCC is 'TFL3', it should be in first 4 bytes or
#... | 35 | 1,126 |
openvino | src/frontends/tensorflow_lite/tests/test_models/gen_scripts/generate_quantize.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import os
import sys
import tensorflow as tf
# Model:
# (float32)tensor_0[12] -> QUANTIZE -> (int8)tensor_1[12]
# QUANTIZE:
# scale: 0.25
# zero point: 16
sm_path = os.path.join(sys.argv[1], "quantize_int8")
tflite_model = b'\x08\x... | 28 | 3,675 |
openvino | src/frontends/tensorflow_lite/tests/test_models/gen_scripts/generate_malformed_indices.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
# Generate crafted .tflite model files with out-of-bounds tensor/buffer/opcode indices.
# These models test that the TFLite frontend properly validates all FlatBuffer
# vector indices before use, preventing CWE-125 (Out-of-bounds Read).
... | 205 | 8,397 |
openvino | src/frontends/tensorflow_lite/tests/test_models/gen_scripts/generate_dequantize.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import os
import struct
import sys
import flatbuffers
from flatbuffers import builder as flatbuffers_builder
import tensorflow as tf
# Create the graph and model
class SampleGraph(tf.Module):
def __init__(self):
super(SampleGrap... | 213 | 7,987 |
openvino | src/frontends/tensorflow_lite/tests/test_models/gen_scripts/generate_sparse_oob.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
# Generates malicious .tflite files for testing sparse tensor index validation.
# These files are structurally valid FlatBuffers but contain semantically invalid
# sparse index values that should be rejected during deserialization.
#
# T... | 365 | 12,676 |
openvino | src/frontends/tensorflow_lite/tests/test_models/gen_scripts/generate_densify.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import os
import sys
import tensorflow as tf
# Create the graph and model
class SampleGraph(tf.Module):
def __init__(self):
super(SampleGraph, self).__init__()
self.var1 = tf.constant([[[[0,0,1,0],[0,0,0,0],[0,2,1,0]],[[0,0,0... | 35 | 1,287 |
openvino | src/frontends/tensorflow_lite/tests/test_models/gen_scripts/generate_oob_quantized_dimension.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
# Generate crafted .tflite model files with out-of-bounds quantized_dimension
# field values. These models test that the TFLite frontend properly validates
# the quantized_dimension field in QuantizationParameters before using it as
# a ... | 226 | 9,544 |
openvino | src/frontends/tensorflow_lite/tests/test_models/gen_scripts/generate_sparse_incomplete.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
# WHAT:
# Generates a family of small .tflite test models in which a constant
# tensor carries a non-null SparsityParameters table with sub-fields that
# are either incomplete (missing/empty traversal_order, dim_metadata,
# dim_f... | 462 | 18,925 |
openvino | src/frontends/tensorflow_lite/tests/test_models/gen_scripts/generate_bad_buffer_size.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import os
import struct
import sys
class FlatBufferBuilder:
"""Minimal FlatBuffer builder for crafting test .tflite files."""
def __init__(self, initial_size=8192):
self.buf = bytearray(initial_size)
self.head ... | 363 | 11,996 |
openvino | src/frontends/tensorflow_lite/tests/test_models/gen_scripts/generate_qdq.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import os
import sys
import tensorflow as tf
# Model:
# (float32)tensor_0[12] -> QUANTIZE -> (int8)tensor[12] -> DEQUANTIZE -> (float32)tensor_1[12]
# QUANTIZE:
# scale: 0.25
# zero point: 16
sm_path = os.path.join(sys.argv[1], "qd... | 28 | 4,691 |
openvino | src/frontends/pytorch/src/scripts/get_supported_ops.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import os
import re
def get_ops_in_specific_map(map_name: str, lines: list) -> list:
ops = []
start_found = False
for line in lines:
if start_found:
if "};" in line:
break
res... | 34 | 1,021 |
openvino | src/frontends/paddle/tests/paddle_pip_check.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import re
import sys
import os
from importlib.metadata import PackageNotFoundError, version as _installed_version
from packaging.requirements import Requirement
req_file=sys.argv[1]
constraints = {}
constraints_path = []
requirements ... | 79 | 2,972 |
openvino | src/frontends/paddle/tests/test_models/gen_wrapper.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import glob
import os
import subprocess
import sys
print(sys.argv)
if len(sys.argv) < 3:
print("Gen folder and output folder must be specified as arguments")
sys.exit(1)
gen_folder = sys.argv[1]
out_folder = sys.argv[2]
mark_fi... | 30 | 853 |
openvino | src/frontends/paddle/tests/test_models/gen_scripts/generate_softmax.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
#
# softmax paddle model generator
#
import numpy as np
import sys
from save_model import saveModel
def softmax(name: str, x, axis):
import paddle
paddle.enable_static()
node_x = paddle.static.data(name='x', shape=x.shape,... | 49 | 1,189 |
openvino | src/frontends/paddle/tests/test_models/gen_scripts/generate_index_select.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
#
# index_select paddle model generator
#
import numpy as np
from save_model import saveModel
import paddle
import sys
data_type = "float32"
def index_select(name: str, x, index, axis):
paddle.enable_static()
with paddle.stat... | 60 | 1,659 |
openvino | src/frontends/paddle/tests/test_models/gen_scripts/generate_grid_sampler.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
#
# grid_sampler paddle model generator
#
import paddle
import numpy as np
from save_model import saveModel
import sys
def grid_sampler(name: str, x, grid, mode="bilinear", padding_mode="zeros", align_corners=True, not_empty=True,
... | 62 | 2,555 |
openvino | src/frontends/paddle/tests/test_models/gen_scripts/generate_not_equal.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
#
# not_equal paddle model generator
#
import numpy as np
from save_model import saveModel
import sys
def not_equal(name: str, x, y, data_type, cast_to_fp32=False):
import paddle
paddle.enable_static()
with paddle.static.pr... | 58 | 1,762 |
openvino | src/frontends/paddle/tests/test_models/gen_scripts/generate_full.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
#
# fill_const paddle model generator
#
import numpy as np
from save_model import saveModel
import paddle
import sys
def full(name : str, shape : list, dtype, value):
paddle.enable_static()
with paddle.static.program_guard(padd... | 119 | 5,257 |
openvino | src/frontends/paddle/tests/test_models/gen_scripts/generate_reduce_prod.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
#
# reduce_prod paddle model generator
#
import numpy as np
import sys
from save_model import saveModel
def reduce_prod(name : str, x, axis=None, keepdim=False):
import paddle
paddle.enable_static()
with paddle.static.pro... | 47 | 1,490 |
openvino | src/frontends/paddle/tests/test_models/gen_scripts/generate_2in_2out_dynbatch.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import paddle
import numpy as np
import os
import sys
from save_model import saveModel
if paddle.__version__ >= '2.6.0':
import paddle.base as fluid
else:
from paddle import fluid
paddle.enable_static()
inp_blob1 = np.random.... | 71 | 2,772 |
openvino | src/frontends/paddle/tests/test_models/gen_scripts/generate_tensorarray.py | .py | import os
import sys
import numpy as np
import paddle
from save_model import exportModel
""""""""""""""""""""""""""""""""""""""""""""""""""""""
# tensorarray case: conditional_block + slice[0]
""""""""""""""""""""""""""""""""""""""""""""""""""""""
def test_conditional_block_slice0():
def test(model_name, inputs:... | 361 | 14,068 |
openvino | src/frontends/paddle/tests/test_models/gen_scripts/generate_dropout.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
#
# pool2d paddle model generator
#
import numpy as np
from save_model import saveModel
import sys
def paddle_dropout(name : str, x, p, paddle_attrs):
import paddle
paddle.enable_static()
with paddle.static.program_guard(p... | 51 | 1,463 |
openvino | src/frontends/paddle/tests/test_models/gen_scripts/generate_gelu.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
#
# gelu paddle model generator
#
import numpy as np
from save_model import saveModel
import paddle
import sys
data_type = 'float32'
def gelu(name:str, x, approximate=False):
paddle.enable_static()
with paddle.static.program_g... | 45 | 1,264 |
openvino | src/frontends/paddle/tests/test_models/gen_scripts/generate_shape.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
#
# pool2d paddle model generator
#
import numpy as np
from save_model import saveModel
import sys
def paddle_shape(name : str, x):
import paddle
paddle.enable_static()
with paddle.static.program_guard(paddle.static.Progra... | 42 | 1,099 |
openvino | src/frontends/paddle/tests/test_models/gen_scripts/generate_reduce_max.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
#
# reduce_max paddle model generator
#
import numpy as np
import sys
from save_model import saveModel
def reduce_max(name : str, x, axis=None, keepdim=False):
import paddle
paddle.enable_static()
with paddle.static.progr... | 47 | 1,475 |
openvino | src/frontends/paddle/tests/test_models/gen_scripts/generate_relu6.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
#
# relu6 paddle model generator
#
import numpy as np
from save_model import saveModel
import paddle
import sys
def relu6(name: str, x, threshold: float = 6.0, data_type='float32'):
paddle.enable_static()
with paddle.static.pr... | 47 | 1,300 |
openvino | src/frontends/paddle/tests/test_models/gen_scripts/generate_gather_nd.py | .py | #
# gather_nd paddle model generator
#
import numpy as np
from save_model import saveModel
import paddle
import sys
def gather_nd(name: str, x, y):
paddle.enable_static()
with paddle.static.program_guard(paddle.static.Program(), paddle.static.Program()):
data = paddle.static.data(name="x", shape=x.sh... | 76 | 2,048 |
openvino | src/frontends/paddle/tests/test_models/gen_scripts/generate_gather.py | .py | #
# gather paddle model generator
#
import numpy as np
from save_model import saveModel
import paddle
import sys
def gather(name: str, x, y, z):
paddle.enable_static()
with paddle.static.program_guard(paddle.static.Program(), paddle.static.Program()):
data = paddle.static.data(name='x', shape=x.shape... | 101 | 2,894 |
openvino | src/frontends/paddle/tests/test_models/gen_scripts/generate_hard_sigmoid.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
#
# hard_sigmoid paddle model generator
#
import numpy as np
from save_model import saveModel
import paddle
import sys
def hard_sigmoid(name: str, x, slope: float = 0.2, offset: float = 0.5, data_type='float32'):
paddle.enable_stat... | 44 | 1,270 |
openvino | src/frontends/paddle/tests/test_models/gen_scripts/generate_atan2.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
#
# fill_const paddle model generator
#
import numpy as np
from save_model import saveModel
import paddle
import sys
def atan2(name , x , y):
paddle.enable_static()
with paddle.static.program_guard(paddle.static.Program(), padd... | 40 | 1,331 |
openvino | src/frontends/paddle/tests/test_models/gen_scripts/generate_tanh_shrink.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
#
# tanh_shrink paddle model generator
#
import numpy as np
import sys
from save_model import saveModel
def tanh_shrink(name: str, x):
import paddle
paddle.enable_static()
with paddle.static.program_guard(paddle.static.Pr... | 52 | 1,271 |
openvino | src/frontends/paddle/tests/test_models/gen_scripts/generate_rnn_lstm.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import numpy as np
import os
from save_model import saveModel
import sys
def _get_framework_pb2():
try:
from paddle.fluid.proto import framework_pb2
return framework_pb2
except Exception:
pass
try:
... | 152 | 5,070 |
openvino | src/frontends/paddle/tests/test_models/gen_scripts/generate_rsqrt.py | .py | import sys
import paddle
import numpy as np
from save_model import saveModel
def rsqrt(name: str, x):
paddle.enable_static()
with paddle.static.program_guard(paddle.static.Program(), paddle.static.Program()):
node_x = paddle.static.data(name="x", shape=x.shape, dtype=x.dtype)
out = paddle.rsq... | 46 | 1,212 |
openvino | src/frontends/paddle/tests/test_models/gen_scripts/generate_group_norm.py | .py | # Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
#
# group norm paddle model generator
#
import numpy as np
from save_model import saveModel
import paddle
import sys
data_type = "float32"
def group_norm(name: str, x, groups, epsilon, scale, bias, data_layout):
paddle.enable_stati... | 71 | 2,298 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.