Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/actions/common/pylint/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions docs/scripts/generate_elements_page.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ==============================================================================
# Copyright (C) 2023 Intel Corporation
# Copyright (C) 2023-2026 Intel Corporation
#
# SPDX-License-Identifier: MIT
# ==============================================================================
Expand All @@ -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

Expand Down
10 changes: 10 additions & 0 deletions pylintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[MAIN]
source-roots = python/gstgva

[MESSAGES CONTROL]

# E0401 = Unable to import module
disable=E0401

[FORMAT]
max-line-length=160
5 changes: 3 additions & 2 deletions python/gstgva/audio/audio_event.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ==============================================================================
# Copyright (C) 2018-2021 Intel Corporation
# Copyright (C) 2018-2026 Intel Corporation
#
# SPDX-License-Identifier: MIT
# ==============================================================================
Expand All @@ -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

Expand All @@ -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")

Expand Down
4 changes: 3 additions & 1 deletion python/gstgva/audio/audio_frame.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ==============================================================================
# Copyright (C) 2018-2021 Intel Corporation
# Copyright (C) 2018-2026 Intel Corporation
#
# SPDX-License-Identifier: MIT
# ==============================================================================
Expand All @@ -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
Expand Down
2 changes: 2 additions & 0 deletions python/gstgva/tensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 2 additions & 0 deletions python/gstgva/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -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':
Expand Down
2 changes: 2 additions & 0 deletions python/gstgva/video_frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# ==============================================================================
# Copyright (C) 2018-2021 Intel Corporation
# Copyright (C) 2018-2026 Intel Corporation
#
# SPDX-License-Identifier: MIT
# ==============================================================================

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
Comment thread
mholowni marked this conversation as resolved.

from gstgva import VideoFrame

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ==============================================================================
# Copyright (C) 2018-2025 Intel Corporation
# Copyright (C) 2018-2026 Intel Corporation
#
# SPDX-License-Identifier: MIT
# ==============================================================================
Expand All @@ -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
Comment thread
mholowni marked this conversation as resolved.
Comment thread
mholowni marked this conversation as resolved.

parser = ArgumentParser(add_help=False)
_args = parser.add_argument_group('Options')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ==============================================================================
# Copyright (C) 2025 Intel Corporation
# Copyright (C) 2025-2026 Intel Corporation
#
# SPDX-License-Identifier: MIT
# ==============================================================================
Expand All @@ -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 = {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
# ==============================================================================
# Copyright (C) 2025 Intel Corporation
# Copyright (C) 2025-2026 Intel Corporation
#
# SPDX-License-Identifier: MIT
# ==============================================================================
Expand All @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion scripts/optimizer/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
# SPDX-License-Identifier: MIT
# ==============================================================================

__all__ = [DLSOptimizer, preprocess_pipeline]
__all__ = ['DLSOptimizer', 'preprocess_pipeline'] # pylint: disable=undefined-all-variable
10 changes: 5 additions & 5 deletions scripts/optimizer/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion scripts/optimizer/optimizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Comment thread
mholowni marked this conversation as resolved.

####################################### Init ######################################################

Expand Down
14 changes: 7 additions & 7 deletions src/gst/python/inference_openvino.py
Original file line number Diff line number Diff line change
@@ -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
Comment thread
mholowni marked this conversation as resolved.
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
Comment thread
mholowni marked this conversation as resolved.
Comment thread
mholowni marked this conversation as resolved.

Gst.init(None)

TENSORS_CAPS = Gst.Caps.from_string("other/tensors")
Expand Down
4 changes: 2 additions & 2 deletions src/gst/python/python_object_association.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/python3

# ==============================================================================
# Copyright (C) 2023 Intel Corporation
# Copyright (C) 2023-2026 Intel Corporation
#
# SPDX-License-Identifier: MIT
# ==============================================================================
Expand All @@ -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

Expand Down
15 changes: 7 additions & 8 deletions src/gst/python/pytorch_tensor_inference.py
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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)

Expand Down
6 changes: 4 additions & 2 deletions tests/unit_tests/tests_gstgva/pipeline_runner.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ==============================================================================
# Copyright (C) 2020-2025 Intel Corporation
# Copyright (C) 2020-2026 Intel Corporation
#
# SPDX-License-Identifier: MIT
# ==============================================================================
Expand All @@ -11,12 +11,14 @@
import unittest

import gi
import gstgva as va # noqa
Comment thread
mholowni marked this conversation as resolved.
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)

Expand Down
9 changes: 5 additions & 4 deletions tests/unit_tests/tests_gstgva/test_audio_event.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Loading
Loading