diff --git a/.github/actions/common/pylint/action.yaml b/.github/actions/common/pylint/action.yaml index 821a7ebdf..b4d3b79a6 100644 --- a/.github/actions/common/pylint/action.yaml +++ b/.github/actions/common/pylint/action.yaml @@ -46,7 +46,7 @@ runs: echo "📝 Found Python files, running pylint..." # Save full output to temporary file first temp_output="${output_file}.full" - find "${path}" -name "*.py" -not -path "*/venv/*" -print0 | xargs -0 pylint 2>&1 | tee "${temp_output}" || true + find "${path}" -name "*.py" -not -path "*/venv/*" -print0 | xargs -0 pylint --rcfile="${path}/pylintrc" 2>&1 | tee "${temp_output}" || true # Filter only errors (E) and fatal (F) issues to the main output file if [ -f "${temp_output}" ]; then # Extract errors and fatal issues diff --git a/docs/scripts/generate_elements_page.py b/docs/scripts/generate_elements_page.py index 7c004c5ba..33b92f784 100755 --- a/docs/scripts/generate_elements_page.py +++ b/docs/scripts/generate_elements_page.py @@ -1,5 +1,5 @@ # ============================================================================== -# Copyright (C) 2023 Intel Corporation +# Copyright (C) 2023-2026 Intel Corporation # # SPDX-License-Identifier: MIT # ============================================================================== @@ -15,7 +15,8 @@ import sys import gi gi.require_version('Gst', '1.0') -from gi.repository import Gst +gi.require_version('GLib', '2.0') +from gi.repository import Gst, GLib # pylint: disable=no-name-in-module, wrong-import-position import inspect diff --git a/pylintrc b/pylintrc new file mode 100644 index 000000000..0066e94c6 --- /dev/null +++ b/pylintrc @@ -0,0 +1,10 @@ +[MAIN] +source-roots = python/gstgva + +[MESSAGES CONTROL] + +# E0401 = Unable to import module +disable=E0401 + +[FORMAT] +max-line-length=160 diff --git a/python/gstgva/audio/audio_event.py b/python/gstgva/audio/audio_event.py index 8eb3265d3..0ada9d4bd 100644 --- a/python/gstgva/audio/audio_event.py +++ b/python/gstgva/audio/audio_event.py @@ -1,5 +1,5 @@ # ============================================================================== -# Copyright (C) 2018-2021 Intel Corporation +# Copyright (C) 2018-2026 Intel Corporation # # SPDX-License-Identifier: MIT # ============================================================================== @@ -8,7 +8,6 @@ # @brief This file contains gstgva.audio_event.AudioEvent class to control audio events for particular gstgva.audio_frame.AudioFrame with gstgva.tensor.Tensor instances attached import ctypes -import numpy from typing import List from collections import namedtuple @@ -20,7 +19,9 @@ gi.require_version('GstAudio', '1.0') gi.require_version('GLib', '2.0') gi.require_version('Gst', '1.0') +# pylint: disable=no-name-in-module from gi.repository import GstAudio, GLib, GObject, Gst +# pylint: enable=no-name-in-module Segment = namedtuple("Segment", "start_time end_time") diff --git a/python/gstgva/audio/audio_frame.py b/python/gstgva/audio/audio_frame.py index 4a9b40f09..f5bfbfacd 100644 --- a/python/gstgva/audio/audio_frame.py +++ b/python/gstgva/audio/audio_frame.py @@ -1,5 +1,5 @@ # ============================================================================== -# Copyright (C) 2018-2021 Intel Corporation +# Copyright (C) 2018-2026 Intel Corporation # # SPDX-License-Identifier: MIT # ============================================================================== @@ -19,7 +19,9 @@ gi.require_version("GstAudio", "1.0") gi.require_version('GObject', '2.0') +# pylint: disable=no-name-in-module from gi.repository import GObject, Gst, GstAudio +# pylint: enable=no-name-in-module from .audio_event_meta import AudioEventMeta from .audio_event import AudioEvent from ..util import GVATensorMeta diff --git a/python/gstgva/tensor.py b/python/gstgva/tensor.py index ae8da9d33..d2fe4e180 100644 --- a/python/gstgva/tensor.py +++ b/python/gstgva/tensor.py @@ -16,7 +16,9 @@ gi.require_version("GstAnalytics", "1.0") from enum import Enum +# pylint: disable=no-name-in-module from gi.repository import GObject, GstAnalytics, GLib +# pylint: enable=no-name-in-module from .util import ( libgst, libgobject, diff --git a/python/gstgva/util.py b/python/gstgva/util.py index 988c6d207..ce45eaeb1 100644 --- a/python/gstgva/util.py +++ b/python/gstgva/util.py @@ -12,7 +12,9 @@ gi.require_version('GstVideo', '1.0') gi.require_version('GstAudio', '1.0') gi.require_version('Gst', '1.0') +# pylint: disable=no-name-in-module from gi.repository import GstVideo, GstAudio, GObject, Gst +# pylint: enable=no-name-in-module # libgstreamer if platform.system() == 'Windows': diff --git a/python/gstgva/video_frame.py b/python/gstgva/video_frame.py index ce095ce44..27be421f9 100644 --- a/python/gstgva/video_frame.py +++ b/python/gstgva/video_frame.py @@ -23,7 +23,9 @@ gi.require_version("GstAnalytics", "1.0") gi.require_version("GLib", "2.0") +# pylint: disable=no-name-in-module from gi.repository import Gst, GstVideo, GstAnalytics, GLib +# pylint: enable=no-name-in-module from .util import VideoRegionOfInterestMeta from .util import GVATensorMeta from .util import GVAJSONMeta diff --git a/samples/gstreamer/gst_launch/gvapython/face_detection_and_classification/postproc_callbacks/ssd_object_detection.py b/samples/gstreamer/gst_launch/gvapython/face_detection_and_classification/postproc_callbacks/ssd_object_detection.py index 477462193..f4edda5e7 100644 --- a/samples/gstreamer/gst_launch/gvapython/face_detection_and_classification/postproc_callbacks/ssd_object_detection.py +++ b/samples/gstreamer/gst_launch/gvapython/face_detection_and_classification/postproc_callbacks/ssd_object_detection.py @@ -1,5 +1,5 @@ # ============================================================================== -# Copyright (C) 2018-2021 Intel Corporation +# Copyright (C) 2018-2026 Intel Corporation # # SPDX-License-Identifier: MIT # ============================================================================== @@ -7,7 +7,7 @@ import sys import gi gi.require_version('Gst', '1.0') -from gi.repository import Gst, GObject +from gi.repository import Gst, GObject # pylint: disable=no-name-in-module, wrong-import-position from gstgva import VideoFrame diff --git a/samples/gstreamer/python/draw_face_attributes/draw_face_attributes.py b/samples/gstreamer/python/draw_face_attributes/draw_face_attributes.py index 474b3bffa..f523bd188 100755 --- a/samples/gstreamer/python/draw_face_attributes/draw_face_attributes.py +++ b/samples/gstreamer/python/draw_face_attributes/draw_face_attributes.py @@ -1,5 +1,5 @@ # ============================================================================== -# Copyright (C) 2018-2025 Intel Corporation +# Copyright (C) 2018-2026 Intel Corporation # # SPDX-License-Identifier: MIT # ============================================================================== @@ -16,7 +16,7 @@ gi.require_version('Gst', '1.0') gi.require_version('GstApp', '1.0') gi.require_version('GstVideo', '1.0') -from gi.repository import Gst, GLib, GstApp, GstVideo +from gi.repository import Gst, GLib, GstApp, GstVideo # pylint: disable=no-name-in-module, wrong-import-position parser = ArgumentParser(add_help=False) _args = parser.add_argument_group('Options') diff --git a/samples/gstreamer/python/face_detection_and_classification/face_detection_and_classification.py b/samples/gstreamer/python/face_detection_and_classification/face_detection_and_classification.py index 1f694cfb0..c0271d4f2 100644 --- a/samples/gstreamer/python/face_detection_and_classification/face_detection_and_classification.py +++ b/samples/gstreamer/python/face_detection_and_classification/face_detection_and_classification.py @@ -7,14 +7,15 @@ import os import subprocess import urllib.request -import gi -from gi.repository import Gst from huggingface_hub import hf_hub_download from ultralytics import YOLO +import gi gi.require_version("Gst", "1.0") gi.require_version("GstAnalytics", "1.0") +from gi.repository import Gst # pylint: disable=no-name-in-module, wrong-import-position + # Prepare input video file; download default if none provided diff --git a/samples/gstreamer/python/hello_dlstreamer/hello_dlstreamer.py b/samples/gstreamer/python/hello_dlstreamer/hello_dlstreamer.py index af0eac68e..65906eea0 100644 --- a/samples/gstreamer/python/hello_dlstreamer/hello_dlstreamer.py +++ b/samples/gstreamer/python/hello_dlstreamer/hello_dlstreamer.py @@ -1,5 +1,5 @@ # ============================================================================== -# Copyright (C) 2025 Intel Corporation +# Copyright (C) 2025-2026 Intel Corporation # # SPDX-License-Identifier: MIT # ============================================================================== @@ -10,7 +10,7 @@ gi.require_version("GLib", "2.0") gi.require_version("Gst", "1.0") gi.require_version("GstAnalytics", "1.0") -from gi.repository import GLib, Gst, GstAnalytics +from gi.repository import GLib, Gst, GstAnalytics # pylint: disable=no-name-in-module, wrong-import-position def watermark_sink_pad_buffer_probe(pad,info,u_data): obj_counter = {} diff --git a/samples/gstreamer/python/onvif_cameras_discovery/dls_onvif_sample.py b/samples/gstreamer/python/onvif_cameras_discovery/dls_onvif_sample.py index c47c241a3..d5f37ec0b 100644 --- a/samples/gstreamer/python/onvif_cameras_discovery/dls_onvif_sample.py +++ b/samples/gstreamer/python/onvif_cameras_discovery/dls_onvif_sample.py @@ -13,7 +13,7 @@ import subprocess import threading from typing import List -from onvif import ONVIFCamera # pylint: disable=import-error +from onvif import ONVIFCamera import dls_onvif_discovery_utils as dls_discovery def run_single_streamer(gst_command: List[str]) -> subprocess.Popen: diff --git a/samples/gstreamer/python/open_close_valve/open_close_valve_sample.py b/samples/gstreamer/python/open_close_valve/open_close_valve_sample.py index 9a14aee79..8fed53274 100644 --- a/samples/gstreamer/python/open_close_valve/open_close_valve_sample.py +++ b/samples/gstreamer/python/open_close_valve/open_close_valve_sample.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 # ============================================================================== -# Copyright (C) 2025 Intel Corporation +# Copyright (C) 2025-2026 Intel Corporation # # SPDX-License-Identifier: MIT # ============================================================================== @@ -17,7 +17,7 @@ import gi gi.require_version('Gst', '1.0') gi.require_version('GstAnalytics', '1.0') -from gi.repository import Gst, GLib, GstAnalytics +from gi.repository import Gst, GLib, GstAnalytics # pylint: disable=no-name-in-module, wrong-import-position class DualStreamController: diff --git a/samples/gstreamer/python/prompted_detection/prompted_detection.py b/samples/gstreamer/python/prompted_detection/prompted_detection.py index 3874e9ed5..a5b290702 100644 --- a/samples/gstreamer/python/prompted_detection/prompted_detection.py +++ b/samples/gstreamer/python/prompted_detection/prompted_detection.py @@ -6,11 +6,13 @@ import sys import os + +from ultralytics import YOLO import gi gi.require_version("Gst", "1.0") gi.require_version("GstAnalytics", "1.0") -from gi.repository import GLib, Gst, GstAnalytics -from ultralytics import YOLO +from gi.repository import GLib, Gst, GstAnalytics # pylint: disable=no-name-in-module, wrong-import-position + # wrapper to run the gstreamer pipeline loop def pipeline_loop(pipeline): diff --git a/scripts/optimizer/__init__.py b/scripts/optimizer/__init__.py index 833aa871e..57adecd5d 100644 --- a/scripts/optimizer/__init__.py +++ b/scripts/optimizer/__init__.py @@ -4,4 +4,4 @@ # SPDX-License-Identifier: MIT # ============================================================================== -__all__ = [DLSOptimizer, preprocess_pipeline] +__all__ = ['DLSOptimizer', 'preprocess_pipeline'] # pylint: disable=undefined-all-variable diff --git a/scripts/optimizer/__main__.py b/scripts/optimizer/__main__.py index e21bd98df..856e2384d 100644 --- a/scripts/optimizer/__main__.py +++ b/scripts/optimizer/__main__.py @@ -8,7 +8,7 @@ import logging import textwrap -from optimizer import DLSOptimizer +from optimizer import DLSOptimizer # pylint: disable=no-name-in-module parser = argparse.ArgumentParser( prog="DLStreamer Pipeline Optimization Tool", @@ -34,12 +34,12 @@ parser.add_argument("PIPELINE", nargs="+", help="Pipeline to be analyzed") parser.add_argument("--search-duration", default=300, type=float, - help="Duration in seconds of time which should be spent searching for optimized pipelines (default: %(default)s)") # pylint: disable=line-too-long + help="Duration in seconds of time which should be spent searching for optimized pipelines (default: %(default)s)") parser.add_argument("--sample-duration", default=10, type=float, - help="Duration in seconds of sampling individual pipelines. Longer duration should offer more stable results (default: %(default)s)") # pylint: disable=line-too-long + help="Duration in seconds of sampling individual pipelines. Longer duration should offer more stable results (default: %(default)s)") parser.add_argument("--multistream-fps-limit", default=30, type=float, - help="Minimum amount of fps allowed when optimizing for multiple streams (default: %(default)s)") # pylint: disable=line-too-long -parser.add_argument("--log-level", default="INFO", choices=["CRITICAL", "FATAL", "ERROR" ,"WARN", "INFO", "DEBUG"], # pylint: disable=line-too-long + help="Minimum amount of fps allowed when optimizing for multiple streams (default: %(default)s)") +parser.add_argument("--log-level", default="INFO", choices=["CRITICAL", "FATAL", "ERROR" ,"WARN", "INFO", "DEBUG"], help="Minimum used log level (default: %(default)s)") args=parser.parse_args() diff --git a/scripts/optimizer/optimizer.py b/scripts/optimizer/optimizer.py index 5dc071f8b..fb16881c5 100644 --- a/scripts/optimizer/optimizer.py +++ b/scripts/optimizer/optimizer.py @@ -14,7 +14,7 @@ import gi gi.require_version("Gst", "1.0") -from gi.repository import Gst +from gi.repository import Gst # pylint: disable=no-name-in-module ####################################### Init ###################################################### diff --git a/src/gst/python/inference_openvino.py b/src/gst/python/inference_openvino.py index 7b813a34e..e333c0d16 100644 --- a/src/gst/python/inference_openvino.py +++ b/src/gst/python/inference_openvino.py @@ -1,22 +1,22 @@ #!/usr/bin/python3 # ============================================================================== -# Copyright (C) 2022 Intel Corporation +# Copyright (C) 2022-2026 Intel Corporation # # SPDX-License-Identifier: MIT # ============================================================================== -import gi -gi.require_version('Gst', '1.0') -gi.require_version('GstBase', '1.0') -gi.require_version('GstVideo', '1.0') - -from gi.repository import Gst, GObject, GLib, GstBase, GstVideo import numpy as np from openvino.runtime import Core, Layout, Type, InferRequest, AsyncInferQueue from openvino.preprocess import PrePostProcessor +import gi +gi.require_version('Gst', '1.0') +gi.require_version('GstBase', '1.0') +gi.require_version('GstVideo', '1.0') +from gi.repository import Gst, GObject, GLib, GstBase, GstVideo # pylint: disable=no-name-in-module, wrong-import-position + Gst.init(None) TENSORS_CAPS = Gst.Caps.from_string("other/tensors") diff --git a/src/gst/python/python_object_association.py b/src/gst/python/python_object_association.py index abe8db4e1..8a690ac4b 100644 --- a/src/gst/python/python_object_association.py +++ b/src/gst/python/python_object_association.py @@ -1,7 +1,7 @@ #!/usr/bin/python3 # ============================================================================== -# Copyright (C) 2023 Intel Corporation +# Copyright (C) 2023-2026 Intel Corporation # # SPDX-License-Identifier: MIT # ============================================================================== @@ -10,7 +10,7 @@ gi.require_version('Gst', '1.0') gi.require_version('GstBase', '1.0') gi.require_version('GstVideo', '1.0') -from gi.repository import Gst, GObject, GstBase, GLib +from gi.repository import Gst, GObject, GstBase, GLib # pylint: disable=no-name-in-module, wrong-import-position from gstgva import VideoFrame diff --git a/src/gst/python/pytorch_tensor_inference.py b/src/gst/python/pytorch_tensor_inference.py index 88cdb1c6f..06ad1031d 100644 --- a/src/gst/python/pytorch_tensor_inference.py +++ b/src/gst/python/pytorch_tensor_inference.py @@ -1,18 +1,11 @@ #!/usr/bin/python3 # ============================================================================== -# Copyright (C) 2022-2024 Intel Corporation +# Copyright (C) 2022-2026 Intel Corporation # # SPDX-License-Identifier: MIT # ============================================================================== -import gi -gi.require_version('Gst', '1.0') -gi.require_version('GstBase', '1.0') -gi.require_version('GstVideo', '1.0') - -from gi.repository import Gst, GObject, GstBase - import torch import numpy as np import traceback @@ -22,6 +15,12 @@ from typing import List from torchvision.transforms._presets import ImageClassification +import gi +gi.require_version('Gst', '1.0') +gi.require_version('GstBase', '1.0') +gi.require_version('GstVideo', '1.0') +from gi.repository import Gst, GObject, GstBase # pylint: disable=no-name-in-module, wrong-import-position + Gst.init(None) diff --git a/tests/unit_tests/tests_gstgva/pipeline_runner.py b/tests/unit_tests/tests_gstgva/pipeline_runner.py index db62afb37..8fc7c0693 100644 --- a/tests/unit_tests/tests_gstgva/pipeline_runner.py +++ b/tests/unit_tests/tests_gstgva/pipeline_runner.py @@ -1,5 +1,5 @@ # ============================================================================== -# Copyright (C) 2020-2025 Intel Corporation +# Copyright (C) 2020-2026 Intel Corporation # # SPDX-License-Identifier: MIT # ============================================================================== @@ -11,12 +11,14 @@ import unittest import gi +import gstgva as va # noqa gi.require_version('Gst', '1.0') gi.require_version("GLib", "2.0") gi.require_version('GstApp', '1.0') gi.require_version("GstVideo", "1.0") +# pylint: disable=no-name-in-module from gi.repository import GLib, Gst, GstApp, GstVideo # noqa -import gstgva as va # noqa +# pylint: enable=no-name-in-module Gst.init(None) diff --git a/tests/unit_tests/tests_gstgva/test_audio_event.py b/tests/unit_tests/tests_gstgva/test_audio_event.py index cffa7bec5..4d252e3ba 100644 --- a/tests/unit_tests/tests_gstgva/test_audio_event.py +++ b/tests/unit_tests/tests_gstgva/test_audio_event.py @@ -1,18 +1,19 @@ # ============================================================================== -# Copyright (C) 2020-2025 Intel Corporation +# Copyright (C) 2020-2026 Intel Corporation # # SPDX-License-Identifier: MIT # ============================================================================== import ctypes import unittest -import gi -gi.require_version('GLib', '2.0') -from gi.repository import GLib from gstgva.util import GList, libgst, GLIST_POINTER from gstgva.tensor import Tensor from gstgva.audio.audio_event import AudioEvent from gstgva.audio.audio_event_meta import AudioEventMeta +import gi +gi.require_version('GLib', '2.0') +from gi.repository import GLib # pylint: disable=no-name-in-module, wrong-import-position + class TestAudioEvent(unittest.TestCase): tensors_count = 2 diff --git a/tests/unit_tests/tests_gstgva/test_audio_frame.py b/tests/unit_tests/tests_gstgva/test_audio_frame.py index 297a30021..d38e68141 100644 --- a/tests/unit_tests/tests_gstgva/test_audio_frame.py +++ b/tests/unit_tests/tests_gstgva/test_audio_frame.py @@ -1,5 +1,5 @@ # ============================================================================== -# Copyright (C) 2020-2025 Intel Corporation +# Copyright (C) 2020-2026 Intel Corporation # # SPDX-License-Identifier: MIT # ============================================================================== @@ -10,12 +10,13 @@ import gi import numpy as np +from gstgva.audio.audio_frame import AudioFrame +from gstgva.audio.audio_event_meta import AudioEventMeta + gi.require_version('Gst', '1.0') gi.require_version('GstAudio', '1.0') +from gi.repository import Gst, GstAudio # pylint: disable=no-name-in-module, wrong-import-position -from gi.repository import Gst, GstAudio -from gstgva.audio.audio_frame import AudioFrame -from gstgva.audio.audio_event_meta import AudioEventMeta Gst.init(sys.argv) diff --git a/tests/unit_tests/tests_gstgva/test_files/instance_segmentation_0002_postproc.py b/tests/unit_tests/tests_gstgva/test_files/instance_segmentation_0002_postproc.py index 308b86cfc..dccc7572a 100644 --- a/tests/unit_tests/tests_gstgva/test_files/instance_segmentation_0002_postproc.py +++ b/tests/unit_tests/tests_gstgva/test_files/instance_segmentation_0002_postproc.py @@ -1,5 +1,5 @@ # ============================================================================== -# Copyright (C) 2021-2025 Intel Corporation +# Copyright (C) 2021-2026 Intel Corporation # # SPDX-License-Identifier: MIT # ============================================================================== @@ -9,7 +9,7 @@ import numpy as np gi.require_version('Gst', '1.0') -from gi.repository import GLib, Gst, GObject +from gi.repository import GLib, Gst, GObject # pylint: disable=no-name-in-module from gstgva import VideoFrame, Tensor, RegionOfInterest Gst.init(sys.argv) diff --git a/tests/unit_tests/tests_gstgva/test_files/test_module.py b/tests/unit_tests/tests_gstgva/test_files/test_module.py index a6dfe5c93..e5e233e0f 100644 --- a/tests/unit_tests/tests_gstgva/test_files/test_module.py +++ b/tests/unit_tests/tests_gstgva/test_files/test_module.py @@ -1,11 +1,11 @@ # ============================================================================== -# Copyright (C) 2021-2025 Intel Corporation +# Copyright (C) 2021-2026 Intel Corporation # # SPDX-License-Identifier: MIT # ============================================================================== import gi gi.require_version('Gst', '1.0') -from gi.repository import Gst +from gi.repository import Gst # pylint: disable=no-name-in-module, wrong-import-position class MyClass: def __init__(self): diff --git a/tests/unit_tests/tests_gstgva/test_pipeline_color_formats.py b/tests/unit_tests/tests_gstgva/test_pipeline_color_formats.py index 72675407d..4b420194e 100644 --- a/tests/unit_tests/tests_gstgva/test_pipeline_color_formats.py +++ b/tests/unit_tests/tests_gstgva/test_pipeline_color_formats.py @@ -1,5 +1,5 @@ # ============================================================================== -# Copyright (C) 2021-2025 Intel Corporation +# Copyright (C) 2021-2026 Intel Corporation # # SPDX-License-Identifier: MIT # ============================================================================== @@ -8,7 +8,7 @@ import os from pipeline_runner import TestPipelineRunner -from utils import * +from utils import BBox, get_model_path SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__)) IMAGE_PATH = os.path.join(SCRIPT_DIR, "test_files", "dog_bike_car.jpg") diff --git a/tests/unit_tests/tests_gstgva/test_pipeline_detection_yolo_11s.py b/tests/unit_tests/tests_gstgva/test_pipeline_detection_yolo_11s.py index e2e9512fb..ff4bcaab1 100644 --- a/tests/unit_tests/tests_gstgva/test_pipeline_detection_yolo_11s.py +++ b/tests/unit_tests/tests_gstgva/test_pipeline_detection_yolo_11s.py @@ -8,7 +8,7 @@ import os from pipeline_runner import TestPipelineRunner -from utils import * +from utils import get_model_path, BBox SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__)) IMAGE_PATH = os.path.join(SCRIPT_DIR, "test_files", "dog_bike_car.jpg") diff --git a/tests/unit_tests/tests_gstgva/test_pipeline_detection_yolo_v10s.py b/tests/unit_tests/tests_gstgva/test_pipeline_detection_yolo_v10s.py index 820197c47..0186d2fe7 100644 --- a/tests/unit_tests/tests_gstgva/test_pipeline_detection_yolo_v10s.py +++ b/tests/unit_tests/tests_gstgva/test_pipeline_detection_yolo_v10s.py @@ -1,5 +1,5 @@ # ============================================================================== -# Copyright (C) 2025 Intel Corporation +# Copyright (C) 2025-2026 Intel Corporation # # SPDX-License-Identifier: MIT # ============================================================================== @@ -8,7 +8,7 @@ import os from pipeline_runner import TestPipelineRunner -from utils import * +from utils import BBox, get_model_path SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__)) IMAGE_PATH = os.path.join(SCRIPT_DIR, "test_files", "dog_bike_car.jpg") diff --git a/tests/unit_tests/tests_gstgva/test_pipeline_face_detection_and_emotions-recognition-retail-0003.py b/tests/unit_tests/tests_gstgva/test_pipeline_face_detection_and_emotions-recognition-retail-0003.py index 916902714..45a5f7373 100644 --- a/tests/unit_tests/tests_gstgva/test_pipeline_face_detection_and_emotions-recognition-retail-0003.py +++ b/tests/unit_tests/tests_gstgva/test_pipeline_face_detection_and_emotions-recognition-retail-0003.py @@ -1,5 +1,5 @@ # ============================================================================== -# Copyright (C) 2020-2025 Intel Corporation +# Copyright (C) 2020-2026 Intel Corporation # # SPDX-License-Identifier: MIT # ============================================================================== @@ -8,7 +8,7 @@ import os from pipeline_runner import TestPipelineRunner -from utils import * +from utils import BBox, get_model_path, get_model_proc_path SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__)) IMAGE_PATH = os.path.join(SCRIPT_DIR, "test_files", "face_detection.png") diff --git a/tests/unit_tests/tests_gstgva/test_pipeline_g3dradarprocess.py b/tests/unit_tests/tests_gstgva/test_pipeline_g3dradarprocess.py index c89599501..8a7830b56 100644 --- a/tests/unit_tests/tests_gstgva/test_pipeline_g3dradarprocess.py +++ b/tests/unit_tests/tests_gstgva/test_pipeline_g3dradarprocess.py @@ -10,10 +10,9 @@ import gi gi.require_version("Gst", "1.0") -from gi.repository import Gst +from gi.repository import Gst # pylint: disable=no-name-in-module, wrong-import-position -from pipeline_runner import TestGenericPipelineRunner -from utils import * +from pipeline_runner import TestGenericPipelineRunner # pylint: disable=wrong-import-position SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__)) diff --git a/tests/unit_tests/tests_gstgva/test_pipeline_gvafpsthrottle.py b/tests/unit_tests/tests_gstgva/test_pipeline_gvafpsthrottle.py index ea3fb5a93..176ddd4d1 100644 --- a/tests/unit_tests/tests_gstgva/test_pipeline_gvafpsthrottle.py +++ b/tests/unit_tests/tests_gstgva/test_pipeline_gvafpsthrottle.py @@ -8,13 +8,12 @@ import os from pipeline_runner import TestGenericPipelineRunner -from utils import * import gi gi.require_version("Gst", "1.0") gi.require_version("GLib", "2.0") -from gi.repository import Gst, GLib +from gi.repository import Gst, GLib # pylint: disable=no-name-in-module SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__)) diff --git a/tests/unit_tests/tests_gstgva/test_pipeline_gvainference_gvapython.py b/tests/unit_tests/tests_gstgva/test_pipeline_gvainference_gvapython.py index 0b31e5827..b140a98ec 100644 --- a/tests/unit_tests/tests_gstgva/test_pipeline_gvainference_gvapython.py +++ b/tests/unit_tests/tests_gstgva/test_pipeline_gvainference_gvapython.py @@ -1,5 +1,5 @@ # ============================================================================== -# Copyright (C) 2021-2025 Intel Corporation +# Copyright (C) 2021-2026 Intel Corporation # # SPDX-License-Identifier: MIT # ============================================================================== @@ -8,7 +8,7 @@ import os from pipeline_runner import TestPipelineRunner -from utils import * +from utils import BBox, get_model_path SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__)) IMAGE_PATH = os.path.join(SCRIPT_DIR, "test_files", "dog_bike_car.jpg") diff --git a/tests/unit_tests/tests_gstgva/test_pipeline_gvapython.py b/tests/unit_tests/tests_gstgva/test_pipeline_gvapython.py index bd6c06153..2c83baa62 100644 --- a/tests/unit_tests/tests_gstgva/test_pipeline_gvapython.py +++ b/tests/unit_tests/tests_gstgva/test_pipeline_gvapython.py @@ -1,5 +1,5 @@ # ============================================================================== -# Copyright (C) 2020-2025 Intel Corporation +# Copyright (C) 2020-2026 Intel Corporation # # SPDX-License-Identifier: MIT # ============================================================================== @@ -8,7 +8,6 @@ import os from pipeline_runner import TestGenericPipelineRunner -from utils import * SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__)) IMAGE_PATH = os.path.join(SCRIPT_DIR, "test_files", "dog_bike_car.jpg") diff --git a/tests/unit_tests/tests_gstgva/test_pipeline_optimizer.py b/tests/unit_tests/tests_gstgva/test_pipeline_optimizer.py index c1aeaaa98..3272af19c 100644 --- a/tests/unit_tests/tests_gstgva/test_pipeline_optimizer.py +++ b/tests/unit_tests/tests_gstgva/test_pipeline_optimizer.py @@ -5,7 +5,7 @@ # ============================================================================== import unittest -from optimizer import get_optimized_pipeline +from optimizer import get_optimized_pipeline # pylint: disable=no-name-in-module from utils import get_model_path class TestOptimizer(unittest.TestCase): diff --git a/tests/unit_tests/tests_gstgva/test_region_of_interest.py b/tests/unit_tests/tests_gstgva/test_region_of_interest.py index 7b2a567a1..edd2f1a6f 100644 --- a/tests/unit_tests/tests_gstgva/test_region_of_interest.py +++ b/tests/unit_tests/tests_gstgva/test_region_of_interest.py @@ -1,5 +1,5 @@ # ============================================================================== -# Copyright (C) 2018-2025 Intel Corporation +# Copyright (C) 2018-2026 Intel Corporation # # SPDX-License-Identifier: MIT # ============================================================================== @@ -16,7 +16,7 @@ from gstgva.region_of_interest import RegionOfInterest, Tensor from gstgva.util import VideoRegionOfInterestMeta, libgst from gstgva.video_frame import VideoFrame -from gi.repository import GstVideo, GLib, GObject, Gst +from gi.repository import GstVideo, GLib, GObject, Gst # pylint: disable=no-name-in-module Gst.init(sys.argv) diff --git a/tests/unit_tests/tests_gstgva/test_tensor.py b/tests/unit_tests/tests_gstgva/test_tensor.py index 59755267a..0a41b68cb 100644 --- a/tests/unit_tests/tests_gstgva/test_tensor.py +++ b/tests/unit_tests/tests_gstgva/test_tensor.py @@ -1,5 +1,5 @@ # ============================================================================== -# Copyright (C) 2018-2025 Intel Corporation +# Copyright (C) 2018-2026 Intel Corporation # # SPDX-License-Identifier: MIT # ============================================================================== @@ -10,7 +10,7 @@ gi.require_version('Gst', '1.0') gi.require_version("GstVideo", "1.0") gi.require_version("GLib", "2.0") -from gi.repository import GstVideo, GLib, Gst, GObject +from gi.repository import GstVideo, GLib, Gst, GObject # pylint: disable=no-name-in-module from gstgva.util import libgst from gstgva.tensor import Tensor diff --git a/tests/unit_tests/tests_gstgva/test_video_frame.py b/tests/unit_tests/tests_gstgva/test_video_frame.py index e02d1e48d..7bf81d79a 100644 --- a/tests/unit_tests/tests_gstgva/test_video_frame.py +++ b/tests/unit_tests/tests_gstgva/test_video_frame.py @@ -1,5 +1,5 @@ # ============================================================================== -# Copyright (C) 2018-2025 Intel Corporation +# Copyright (C) 2018-2026 Intel Corporation # # SPDX-License-Identifier: MIT # ============================================================================== @@ -9,12 +9,14 @@ import numpy as np import gi +import gstgva as va gi.require_version('Gst', '1.0') gi.require_version("GstVideo", "1.0") gi.require_version("GLib", "2.0") +# pylint: disable=no-name-in-module, wrong-import-position from gi.repository import Gst, GstVideo, GLib +# pylint: enable=no-name-in-module, wrong-import-position -import gstgva as va Gst.init(sys.argv)