diff --git a/.github/workflows/accuracy_checker.yml b/.github/workflows/accuracy_checker.yml index 54cb9b41c13..d6abfd28611 100644 --- a/.github/workflows/accuracy_checker.yml +++ b/.github/workflows/accuracy_checker.yml @@ -25,3 +25,13 @@ jobs: run: | python -m pip install pylint==2.10.2 PYTHONPATH=. python -m pylint --rcfile=.pylintrc `find -wholename '?*/**/*.py' -not -path "./tests/*" -not -path "./build/*"` + + check-basics: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 + with: {python-version: 3.12} + - run: python -m pip install --requirement ./ci/requirements-check-basics.in --requirement ./ci/requirements-documentation.in + - run: python ./ci/check-basics.py + - run: python ./ci/prepare-documentation.py ./prepared-documentation/ diff --git a/.github/workflows/cpp_gapi-demos.yml b/.github/workflows/cpp_gapi-demos.yml index f4e24b24232..8b01acde5b9 100644 --- a/.github/workflows/cpp_gapi-demos.yml +++ b/.github/workflows/cpp_gapi-demos.yml @@ -40,7 +40,7 @@ jobs: rm -rf cache/opencv/.git/ # Minimize cache mkdir cache/opencv/build cd cache/opencv/build - cmake -DCMAKE_BUILD_TYPE=Release -DWITH_INF_ENGINE=y -DOpenVINO_DIR=$GITHUB_WORKSPACE/ov/runtime/cmake/ -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_LINKER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_C_LINKER_LAUNCHER=ccache -DBUILD_TESTS=y -DVIDEOIO_ENABLE_PLUGINS=y -DBUILD_PERF_TESTS=n -DBUILD_EXAMPLES=n -DBUILD_opencv_apps=y -DWITH_OPENCL=n -DWITH_OPENCLAMDBLAS=n -DWITH_GSTREAMER=n -DWITH_V4L=ON -DWITH_LIBV4L=ON -DWITH_OPENCLAMDFFT=n -DWITH_VA=n -DWITH_VA_INTEL=n -DWITH_PROTOBUF=n -DBUILD_PROTOBUF=n -DBUILD_JAVA=n -DBUILD_opencv_java_bindings_generator=n -DBUILD_opencv_python2=n -DBUILD_opencv_python3=n -DWITH_IMGCODEC_HDR=y -DWITH_IMGCODEC_SUNRASTER=y -DWITH_IMGCODEC_PXM=y -DWITH_IMGCODEC_PFM=y -DWITH_PNG=y -DWITH_TIFF=n -DWITH_WEBP=n -DWITH_OPENJPEG=n -DWITH_JASPER=n -DWITH_OPENEXR=n -DBUILD_opencv_dnn=n -DBUILD_opencv_features2d=n -DBUILD_opencv_flann=n -DWITH_TBB=n -DBUILD_INFO_SKIP_EXTRA_MODULES=n -DBUILD_JASPER=n -DBUILD_PNG=n -DBUILD_OPENEXR=n -DBUILD_WEBP=n -DBUILD_ZLIB=n -DWITH_CUDA=n -DWITH_EIGEN=n -DWITH_GPHOTO2=n -DOPENCV_GAPI_GSTREAMER=n -DWITH_LAPACK=n -DWITH_MATLAB=n -DWITH_MFX=n -DWITH_QUIRC=n -DWITH_VTK=n -DINSTALL_PDB=n -DINSTALL_TESTS=n -DINSTALL_C_EXAMPLES=n -DINSTALL_PYTHON_EXAMPLES=n -DOPENCV_GENERATE_SETUPVARS=n -DWITH_1394=n -DWITH_FFMPEG=y -DWITH_GTK_2_X=y -DBUILD_JPEG=y -DWITH_IPP=y -DENABLE_CONFIG_VERIFICATION=y -DBUILD_LIST=core,gapi,highgui,imgcodecs,imgproc,videoio,video .. + cmake -DCMAKE_BUILD_TYPE=Release -DWITH_INF_ENGINE=y -DOpenVINO_DIR=$GITHUB_WORKSPACE/ov/runtime/cmake/ -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_LINKER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_C_LINKER_LAUNCHER=ccache -DBUILD_TESTS=y -DVIDEOIO_ENABLE_PLUGINS=y -DBUILD_PERF_TESTS=n -DBUILD_EXAMPLES=n -DBUILD_opencv_apps=y -DWITH_AVIF=n -DWITH_OPENCL=n -DWITH_OPENCLAMDBLAS=n -DWITH_GSTREAMER=n -DWITH_V4L=ON -DWITH_LIBV4L=ON -DWITH_OPENCLAMDFFT=n -DWITH_VA=n -DWITH_VA_INTEL=n -DWITH_PROTOBUF=n -DBUILD_PROTOBUF=n -DBUILD_JAVA=n -DBUILD_opencv_java_bindings_generator=n -DBUILD_opencv_python2=n -DBUILD_opencv_python3=n -DWITH_IMGCODEC_HDR=y -DWITH_IMGCODEC_SUNRASTER=y -DWITH_IMGCODEC_PXM=y -DWITH_IMGCODEC_PFM=y -DWITH_PNG=y -DWITH_TIFF=n -DWITH_WEBP=n -DWITH_OPENJPEG=n -DWITH_JASPER=n -DWITH_OPENEXR=n -DBUILD_opencv_dnn=n -DBUILD_opencv_features2d=n -DBUILD_opencv_flann=n -DWITH_TBB=n -DBUILD_INFO_SKIP_EXTRA_MODULES=n -DBUILD_JASPER=n -DBUILD_PNG=n -DBUILD_OPENEXR=n -DBUILD_WEBP=n -DBUILD_ZLIB=n -DWITH_CUDA=n -DWITH_EIGEN=n -DWITH_GPHOTO2=n -DOPENCV_GAPI_GSTREAMER=n -DWITH_LAPACK=n -DWITH_MATLAB=n -DWITH_MFX=n -DWITH_QUIRC=n -DWITH_VTK=n -DINSTALL_PDB=n -DINSTALL_TESTS=n -DINSTALL_C_EXAMPLES=n -DINSTALL_PYTHON_EXAMPLES=n -DOPENCV_GENERATE_SETUPVARS=n -DWITH_1394=n -DWITH_FFMPEG=y -DWITH_GTK_2_X=y -DBUILD_JPEG=y -DWITH_IPP=y -DENABLE_CONFIG_VERIFICATION=y -DBUILD_LIST=core,gapi,highgui,imgcodecs,imgproc,videoio,video .. cmake --build . -j $((`nproc`*2+2)) - name: build_demos.sh run: | diff --git a/ci/dependencies.yml b/ci/dependencies.yml index 68224fa089a..60032066f6b 100644 --- a/ci/dependencies.yml +++ b/ci/dependencies.yml @@ -1,4 +1,4 @@ -openvino_linux: 'https://storage.openvinotoolkit.org/repositories/openvino/packages/2023.1/linux/l_openvino_toolkit_ubuntu20_2023.1.0.12185.47b736f63ed_x86_64.tgz' -openvino_windows: 'https://storage.openvinotoolkit.org/repositories/openvino/packages/2023.1/windows/w_openvino_toolkit_windows_2023.1.0.12185.47b736f63ed_x86_64.zip' -wheel_linux: '2023.1.0' -wheel_windows: '2023.1.0' +openvino_linux: 'https://storage.openvinotoolkit.org/repositories/openvino/packages/2024.4/linux/l_openvino_toolkit_ubuntu20_2024.4.0.16579.c3152d32c9c_x86_64.tgz' +openvino_windows: 'https://storage.openvinotoolkit.org/repositories/openvino/packages/2024.4.1/windows/w_openvino_toolkit_windows_2024.4.1.16618.643f23d1318_x86_64.zip' +wheel_linux: '2024.4.0' +wheel_windows: '2024.4.0' diff --git a/demos/common/python/model_zoo/model_api/pipelines/async_pipeline.py b/demos/common/python/model_zoo/model_api/pipelines/async_pipeline.py index b565f2adb78..c9be4f0ac83 100644 --- a/demos/common/python/model_zoo/model_api/pipelines/async_pipeline.py +++ b/demos/common/python/model_zoo/model_api/pipelines/async_pipeline.py @@ -83,7 +83,6 @@ def get_user_config(flags_d: str, flags_nstreams: str, flags_nthreads: int)-> Di # multi-device execution with the CPU + GPU performs best with GPU throttling hint, # which releases another CPU thread (that is otherwise used by the GPU driver for active polling) config['GPU_PLUGIN_THROTTLE'] = '1' - return config diff --git a/tools/accuracy_checker/accuracy_checker/annotation_converters/convert.py b/tools/accuracy_checker/accuracy_checker/annotation_converters/convert.py index 3053e28c9f3..4c1e3ea7747 100644 --- a/tools/accuracy_checker/accuracy_checker/annotation_converters/convert.py +++ b/tools/accuracy_checker/accuracy_checker/annotation_converters/convert.py @@ -328,7 +328,7 @@ def save_annotation(annotation, meta, annotation_file, meta_file, dataset_config annotation_dir = annotation_file.parent if not annotation_dir.exists(): annotation_dir.mkdir(parents=True) - with AtomicWriteFileHandle(annotation_file,'wb') as file: + with AtomicWriteFileHandle(annotation_file, 'wb') as file: if conversion_meta: pickle.dump(conversion_meta, file) for representation in annotation: diff --git a/tools/accuracy_checker/accuracy_checker/config/config_reader.py b/tools/accuracy_checker/accuracy_checker/config/config_reader.py index 02fca94078b..b2e56d0c044 100644 --- a/tools/accuracy_checker/accuracy_checker/config/config_reader.py +++ b/tools/accuracy_checker/accuracy_checker/config/config_reader.py @@ -472,7 +472,7 @@ def _separate_modules_evaluations(modules_config): @staticmethod def _previous_configuration_parameters_sharing(config, mode='models'): def _share_params_models(models_config): - shared_params = {parameter: None for parameter in CONFIG_SHARED_PARAMETERS} + shared_params = dict.fromkeys(CONFIG_SHARED_PARAMETERS, None) for model in models_config['models']: launchers = model['launchers'] if not launchers: @@ -485,7 +485,7 @@ def _share_params_models(models_config): shared_params[parameter] = launcher[parameter] def _share_params_modules(modules_config): - shared_params = {parameter: None for parameter in CONFIG_SHARED_PARAMETERS} + shared_params = dict.fromkeys(CONFIG_SHARED_PARAMETERS, None) for evaluation in modules_config['evaluations']: if 'module_config' not in evaluation: continue diff --git a/tools/accuracy_checker/accuracy_checker/data_readers/data_reader.py b/tools/accuracy_checker/accuracy_checker/data_readers/data_reader.py index cb6b2a6f3fb..8c77a2bb597 100644 --- a/tools/accuracy_checker/accuracy_checker/data_readers/data_reader.py +++ b/tools/accuracy_checker/accuracy_checker/data_readers/data_reader.py @@ -29,7 +29,7 @@ BaseField, StringField, ConfigValidator, ConfigError, DictField, BoolField, PathField ) -REQUIRES_ANNOTATIONS = ['annotation_features_extractor' ,'disk_features_extractor' ] +REQUIRES_ANNOTATIONS = ['annotation_features_extractor', 'disk_features_extractor' ] DOES_NOT_REQUIRED_DATA_SOURCE = REQUIRES_ANNOTATIONS + ['ncf_reader'] DATA_SOURCE_IS_FILE = ['opencv_capture'] @@ -325,7 +325,7 @@ def read_item(self, data_id): meta = { 'input_is_dict_type' : self.config.get('input_is_dict_type', False), 'output_is_dict_type' : self.config.get('output_is_dict_type', False), - } + } data_rep = DataRepresentation( self.read_dispatcher(data_id), meta = meta, diff --git a/tools/accuracy_checker/accuracy_checker/launcher/pytorch_launcher.py b/tools/accuracy_checker/accuracy_checker/launcher/pytorch_launcher.py index 193327379d7..f5c857b0a56 100644 --- a/tools/accuracy_checker/accuracy_checker/launcher/pytorch_launcher.py +++ b/tools/accuracy_checker/accuracy_checker/launcher/pytorch_launcher.py @@ -87,7 +87,7 @@ def __init__(self, config_entry: dict, *args, **kwargs): backend = self.compile_kwargs.get('backend', None) if self.use_torch_compile and backend == 'openvino': try: - import openvino.torch # pylint: disable=C0415, W0611 + importlib.import_module('openvino.torch') # pylint: disable=C0415, W0611 except ImportError as import_error: raise ValueError("torch.compile is supported from OpenVINO 2023.1\n{}".format( import_error.msg)) from import_error @@ -153,7 +153,7 @@ def load_module(self, model_cls, module_args, module_kwargs, checkpoint=None, st if checkpoint: if isinstance(checkpoint, str) and re.match(CHECKPOINT_URL_REGEX, checkpoint): - checkpoint = urllib.request.urlretrieve(checkpoint)[0] + checkpoint = urllib.request.urlretrieve(checkpoint)[0] # nosec B310 # disable urllib-urlopen check checkpoint = self._torch.load( checkpoint, map_location=None if self.cuda else self._torch.device('cpu') ) diff --git a/tools/accuracy_checker/accuracy_checker/launcher/pytorch_launcher_readme.md b/tools/accuracy_checker/accuracy_checker/launcher/pytorch_launcher_readme.md index acfbc5dfaff..dac346ecd76 100644 --- a/tools/accuracy_checker/accuracy_checker/launcher/pytorch_launcher_readme.md +++ b/tools/accuracy_checker/accuracy_checker/launcher/pytorch_launcher_readme.md @@ -54,4 +54,3 @@ launchers: adapter: classification ``` - diff --git a/tools/accuracy_checker/tests/test_preprocessor.py b/tools/accuracy_checker/tests/test_preprocessor.py index 26f4ec9e57c..b5cee9a5fa9 100644 --- a/tools/accuracy_checker/tests/test_preprocessor.py +++ b/tools/accuracy_checker/tests/test_preprocessor.py @@ -18,7 +18,6 @@ import cv2 import numpy as np import pytest -import warnings from accuracy_checker.config import ConfigError from accuracy_checker.preprocessor import ( Crop, diff --git a/tools/model_tools/requirements-tensorflow.in b/tools/model_tools/requirements-tensorflow.in index 53d853970f3..f0a55ca8042 100644 --- a/tools/model_tools/requirements-tensorflow.in +++ b/tools/model_tools/requirements-tensorflow.in @@ -1,2 +1,3 @@ tensorflow>=2.5,<2.18.0; platform_system != 'darwin' or python_version != '3.8' tensorflow>=2.5,<2.18.0,!=2.13.1; platform_system == 'darwin' and python_version == '3.8' # Explanation: 151865 +tf-keras