gst-python-ml 1.0.1__tar.gz → 1.0.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. {gst_python_ml-1.0.1 → gst_python_ml-1.0.3}/COPYING +1 -1
  2. {gst_python_ml-1.0.1/plugins/python/gst_python_ml.egg-info → gst_python_ml-1.0.3}/PKG-INFO +80 -43
  3. {gst_python_ml-1.0.1 → gst_python_ml-1.0.3}/README.md +75 -42
  4. {gst_python_ml-1.0.1 → gst_python_ml-1.0.3/plugins/python/gst_python_ml.egg-info}/PKG-INFO +80 -43
  5. {gst_python_ml-1.0.1 → gst_python_ml-1.0.3}/plugins/python/gst_python_ml.egg-info/requires.txt +4 -0
  6. {gst_python_ml-1.0.1 → gst_python_ml-1.0.3}/pyproject.toml +6 -2
  7. {gst_python_ml-1.0.1 → gst_python_ml-1.0.3}/MANIFEST.in +0 -0
  8. {gst_python_ml-1.0.1 → gst_python_ml-1.0.3}/plugins/python/__init__.py +0 -0
  9. {gst_python_ml-1.0.1 → gst_python_ml-1.0.3}/plugins/python/base_aggregator.py +0 -0
  10. {gst_python_ml-1.0.1 → gst_python_ml-1.0.3}/plugins/python/base_caption.py +0 -0
  11. {gst_python_ml-1.0.1 → gst_python_ml-1.0.3}/plugins/python/base_classifier.py +0 -0
  12. {gst_python_ml-1.0.1 → gst_python_ml-1.0.3}/plugins/python/base_llm.py +0 -0
  13. {gst_python_ml-1.0.1 → gst_python_ml-1.0.3}/plugins/python/base_objectdetector.py +0 -0
  14. {gst_python_ml-1.0.1 → gst_python_ml-1.0.3}/plugins/python/base_separate.py +0 -0
  15. {gst_python_ml-1.0.1 → gst_python_ml-1.0.3}/plugins/python/base_transcribe.py +0 -0
  16. {gst_python_ml-1.0.1 → gst_python_ml-1.0.3}/plugins/python/base_transform.py +0 -0
  17. {gst_python_ml-1.0.1 → gst_python_ml-1.0.3}/plugins/python/base_translate.py +0 -0
  18. {gst_python_ml-1.0.1 → gst_python_ml-1.0.3}/plugins/python/base_tts.py +0 -0
  19. {gst_python_ml-1.0.1 → gst_python_ml-1.0.3}/plugins/python/caption_phi.py +0 -0
  20. {gst_python_ml-1.0.1 → gst_python_ml-1.0.3}/plugins/python/caption_qwen.py +0 -0
  21. {gst_python_ml-1.0.1 → gst_python_ml-1.0.3}/plugins/python/classifier.py +0 -0
  22. {gst_python_ml-1.0.1 → gst_python_ml-1.0.3}/plugins/python/coquitts.py +0 -0
  23. {gst_python_ml-1.0.1 → gst_python_ml-1.0.3}/plugins/python/data/soccer/app.py +0 -0
  24. {gst_python_ml-1.0.1 → gst_python_ml-1.0.3}/plugins/python/data/soccer/botsort_people_reid.yaml +0 -0
  25. {gst_python_ml-1.0.1 → gst_python_ml-1.0.3}/plugins/python/data/soccer/bytetrack_ball.yaml +0 -0
  26. {gst_python_ml-1.0.1 → gst_python_ml-1.0.3}/plugins/python/demo_soccer.py +0 -0
  27. {gst_python_ml-1.0.1 → gst_python_ml-1.0.3}/plugins/python/demucs.py +0 -0
  28. {gst_python_ml-1.0.1 → gst_python_ml-1.0.3}/plugins/python/engine/__init__.py +0 -0
  29. {gst_python_ml-1.0.1 → gst_python_ml-1.0.3}/plugins/python/engine/device_queue_pool.py +0 -0
  30. {gst_python_ml-1.0.1 → gst_python_ml-1.0.3}/plugins/python/engine/engine_factory.py +0 -0
  31. {gst_python_ml-1.0.1 → gst_python_ml-1.0.3}/plugins/python/engine/engine_manager.py +0 -0
  32. {gst_python_ml-1.0.1 → gst_python_ml-1.0.3}/plugins/python/engine/litert_engine.py +0 -0
  33. {gst_python_ml-1.0.1 → gst_python_ml-1.0.3}/plugins/python/engine/ml_engine.py +0 -0
  34. {gst_python_ml-1.0.1 → gst_python_ml-1.0.3}/plugins/python/engine/onnx_engine.py +0 -0
  35. {gst_python_ml-1.0.1 → gst_python_ml-1.0.3}/plugins/python/engine/openvino_engine.py +0 -0
  36. {gst_python_ml-1.0.1 → gst_python_ml-1.0.3}/plugins/python/engine/pytorch_engine.py +0 -0
  37. {gst_python_ml-1.0.1 → gst_python_ml-1.0.3}/plugins/python/engine/pytorch_vision_engine.py +0 -0
  38. {gst_python_ml-1.0.1 → gst_python_ml-1.0.3}/plugins/python/engine/tensorflow_engine.py +0 -0
  39. {gst_python_ml-1.0.1 → gst_python_ml-1.0.3}/plugins/python/gst_python_ml.egg-info/SOURCES.txt +0 -0
  40. {gst_python_ml-1.0.1 → gst_python_ml-1.0.3}/plugins/python/gst_python_ml.egg-info/dependency_links.txt +0 -0
  41. {gst_python_ml-1.0.1 → gst_python_ml-1.0.3}/plugins/python/gst_python_ml.egg-info/top_level.txt +0 -0
  42. {gst_python_ml-1.0.1 → gst_python_ml-1.0.3}/plugins/python/kafkasink.py +0 -0
  43. {gst_python_ml-1.0.1 → gst_python_ml-1.0.3}/plugins/python/llm.py +0 -0
  44. {gst_python_ml-1.0.1 → gst_python_ml-1.0.3}/plugins/python/llm_stream_filter.py +0 -0
  45. {gst_python_ml-1.0.1 → gst_python_ml-1.0.3}/plugins/python/log/__init__.py +0 -0
  46. {gst_python_ml-1.0.1 → gst_python_ml-1.0.3}/plugins/python/log/global_logger.py +0 -0
  47. {gst_python_ml-1.0.1 → gst_python_ml-1.0.3}/plugins/python/log/gst_logger.py +0 -0
  48. {gst_python_ml-1.0.1 → gst_python_ml-1.0.3}/plugins/python/log/logger.py +0 -0
  49. {gst_python_ml-1.0.1 → gst_python_ml-1.0.3}/plugins/python/log/logger_factory.py +0 -0
  50. {gst_python_ml-1.0.1 → gst_python_ml-1.0.3}/plugins/python/mariantranslate.py +0 -0
  51. {gst_python_ml-1.0.1 → gst_python_ml-1.0.3}/plugins/python/maskrcnn.py +0 -0
  52. {gst_python_ml-1.0.1 → gst_python_ml-1.0.3}/plugins/python/objectdetector.py +0 -0
  53. {gst_python_ml-1.0.1 → gst_python_ml-1.0.3}/plugins/python/overlay.py +0 -0
  54. {gst_python_ml-1.0.1 → gst_python_ml-1.0.3}/plugins/python/overlay_counter.py +0 -0
  55. {gst_python_ml-1.0.1 → gst_python_ml-1.0.3}/plugins/python/overlay_helper/__init__.py +0 -0
  56. {gst_python_ml-1.0.1 → gst_python_ml-1.0.3}/plugins/python/overlay_helper/overlay_cairo.py +0 -0
  57. {gst_python_ml-1.0.1 → gst_python_ml-1.0.3}/plugins/python/overlay_helper/overlay_opengl.py +0 -0
  58. {gst_python_ml-1.0.1 → gst_python_ml-1.0.3}/plugins/python/overlay_helper/overlay_skia.py +0 -0
  59. {gst_python_ml-1.0.1 → gst_python_ml-1.0.3}/plugins/python/overlay_helper/overlay_utils.py +0 -0
  60. {gst_python_ml-1.0.1 → gst_python_ml-1.0.3}/plugins/python/overlay_helper/overlay_utils_interface.py +0 -0
  61. {gst_python_ml-1.0.1 → gst_python_ml-1.0.3}/plugins/python/overlay_helper/overlay_vulkan.py +0 -0
  62. {gst_python_ml-1.0.1 → gst_python_ml-1.0.3}/plugins/python/sepformer.py +0 -0
  63. {gst_python_ml-1.0.1 → gst_python_ml-1.0.3}/plugins/python/stablediffusion.py +0 -0
  64. {gst_python_ml-1.0.1 → gst_python_ml-1.0.3}/plugins/python/streamdemux.py +0 -0
  65. {gst_python_ml-1.0.1 → gst_python_ml-1.0.3}/plugins/python/streammux.py +0 -0
  66. {gst_python_ml-1.0.1 → gst_python_ml-1.0.3}/plugins/python/utils/__init__.py +0 -0
  67. {gst_python_ml-1.0.1 → gst_python_ml-1.0.3}/plugins/python/utils/analytics_utils.py +0 -0
  68. {gst_python_ml-1.0.1 → gst_python_ml-1.0.3}/plugins/python/utils/caption_utils.py +0 -0
  69. {gst_python_ml-1.0.1 → gst_python_ml-1.0.3}/plugins/python/utils/format_converter.py +0 -0
  70. {gst_python_ml-1.0.1 → gst_python_ml-1.0.3}/plugins/python/utils/gst_feature_manager.py +0 -0
  71. {gst_python_ml-1.0.1 → gst_python_ml-1.0.3}/plugins/python/utils/metadata.py +0 -0
  72. {gst_python_ml-1.0.1 → gst_python_ml-1.0.3}/plugins/python/utils/muxed_buffer_processor.py +0 -0
  73. {gst_python_ml-1.0.1 → gst_python_ml-1.0.3}/plugins/python/utils/runtime_utils.py +0 -0
  74. {gst_python_ml-1.0.1 → gst_python_ml-1.0.3}/plugins/python/video_transform.py +0 -0
  75. {gst_python_ml-1.0.1 → gst_python_ml-1.0.3}/plugins/python/whisperlive.py +0 -0
  76. {gst_python_ml-1.0.1 → gst_python_ml-1.0.3}/plugins/python/whisperspeechtts.py +0 -0
  77. {gst_python_ml-1.0.1 → gst_python_ml-1.0.3}/plugins/python/whispertranscribe.py +0 -0
  78. {gst_python_ml-1.0.1 → gst_python_ml-1.0.3}/plugins/python/yolo.py +0 -0
  79. {gst_python_ml-1.0.1 → gst_python_ml-1.0.3}/setup.cfg +0 -0
  80. {gst_python_ml-1.0.1 → gst_python_ml-1.0.3}/tests/test_pipelines.py +0 -0
@@ -1,4 +1,4 @@
1
- Copyright (C) 2024-2025 Collabora Ltd.
1
+ Copyright (C) 2024-2026 Collabora Ltd.
2
2
 
3
3
  This library is free software; you can redistribute it and/or
4
4
  modify it under the terms of the GNU Library General Public
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: gst-python-ml
3
- Version: 1.0.1
3
+ Version: 1.0.3
4
4
  Summary: An ML package for GStreamer
5
5
  Author-email: Aaron Boxer <aaron.boxer@collabora.com>
6
6
  Project-URL: Homepage, https://github.com/collabora/gst-python-ml
@@ -19,6 +19,8 @@ Requires-Dist: qwen-vl-utils[decord]==0.0.8
19
19
  Requires-Dist: autoawq==0.2.9
20
20
  Requires-Dist: accelerate==1.12.0
21
21
  Requires-Dist: bitsandbytes==0.46.1
22
+ Requires-Dist: opencv-python==4.10.0.84
23
+ Requires-Dist: opencv-contrib-python==4.10.0.84
22
24
  Requires-Dist: numpy
23
25
  Requires-Dist: huggingface-hub
24
26
  Requires-Dist: lap
@@ -35,7 +37,9 @@ Requires-Dist: whisperspeech
35
37
  Requires-Dist: webdataset
36
38
  Requires-Dist: easydict
37
39
  Requires-Dist: pyflann-py3
40
+ Requires-Dist: soundfile
38
41
  Requires-Dist: speechbrain
42
+ Requires-Dist: pyopengl
39
43
  Provides-Extra: language
40
44
  Dynamic: license-file
41
45
 
@@ -81,13 +85,22 @@ sudo apt install -y python3-pip python3-venv \
81
85
  ```
82
86
 
83
87
  ##### Fedora
88
+
89
+ (adjust Fedora version from 42 to match your version number)
90
+
91
+ ```
92
+ sudo dnf install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-42.noarch.rpm https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-42.noarch.rpm
93
+ sudo dnf update -y
94
+ sudo dnf install akmod-nvidia xorg-x11-drv-nvidia-cuda -y
95
+ ```
96
+
84
97
  ```
85
98
  sudo dnf upgrade -y
86
99
  sudo dnf install -y python3-pip \
100
+ python3-devel cairo cairo-devel cairo-gobject-devel pkgconfig git \
87
101
  gstreamer1-plugins-base gstreamer1-plugins-base-tools \
88
102
  gstreamer1-plugins-good gstreamer1-plugins-bad-free \
89
- gstreamer1-plugins-bad-free-devel python3-gstreamer1 \
90
- cairo cairo-devel git
103
+ gstreamer1-plugins-bad-free-devel python3-gstreamer1
91
104
  ```
92
105
 
93
106
 
@@ -102,6 +115,7 @@ curl -LsSf https://astral.sh/uv/install.sh | sh
102
115
  ```
103
116
  uv venv --system-site-packages
104
117
  source .venv/bin/activate
118
+ uv pip install --upgrade pip
105
119
  uv sync
106
120
  ```
107
121
 
@@ -124,7 +138,7 @@ git clone https://github.com/collabora/gst-python-ml.git
124
138
  #### Update .bashrc
125
139
 
126
140
  ```
127
- echo 'export GST_PLUGIN_PATH=$HOME/src/gst-python-ml/plugins:$GST_PLUGIN_PATH' >> ~/.bashrc
141
+ echo 'export GST_PLUGIN_PATH=$HOME/src/gst-python-ml/demos:$HOME/src/gst-python-ml/plugins:$GST_PLUGIN_PATH' >> ~/.bashrc
128
142
  source ~/.bashrc
129
143
  ```
130
144
 
@@ -156,55 +170,76 @@ sudo systemctl restart docker
156
170
  ```
157
171
 
158
172
  ##### Fedora
159
- ```
160
- curl -s -L https://nvidia.github.io/libnvidia-container/stable/rpm/nvidia-container-toolkit.repo | sudo tee /etc/yum.repos.d/
161
- nvidia-container-toolkit.repo
162
173
 
163
- sudo dnf install nvidia-container-toolkit
164
- sudo nvidia-ctk runtime configure --runtime=docker
165
- sudo nvidia-ctk runtime configure --runtime=containerd
166
- sudo systemctl restart containerd
167
- sudo systemctl restart docker
174
+ ```
175
+ sudo dnf install docker
176
+ sudo usermod -aG docker $USER
177
+ # Then either log out/in completely, or:
178
+ newgrp docker
168
179
  ```
169
180
 
170
- ##### Testing GPU Support
171
181
 
172
182
  ```
173
- docker pull nvidia/cuda:12.0.0-base-ubuntu22.04
174
- docker run --rm --runtime=nvidia --gpus all nvidia/cuda:12.0.0-base-ubuntu22.04 nvidia-smi
183
+ # 1. Add NVIDIA Container Toolkit repository
184
+ curl -s -L https://nvidia.github.io/libnvidia-container/stable/rpm/nvidia-container-toolkit.repo | \
185
+ sudo tee /etc/yum.repos.d/nvidia-container-toolkit.repo
175
186
 
176
- ```
187
+ # 2. Remove Fedora's conflicting partial package (if present)
188
+ sudo dnf remove -y golang-github-nvidia-container-toolkit 2>/dev/null || true
177
189
 
190
+ # 3. Install the full NVIDIA Container Toolkit
191
+ sudo dnf install -y nvidia-container-toolkit
178
192
 
179
- #### Build Ubuntu 24.04 Container
193
+ # 4. Configure Docker to use the NVIDIA runtime as default
194
+ sudo mkdir -p /etc/docker
195
+ sudo tee /etc/docker/daemon.json > /dev/null <<EOF
196
+ {
197
+ "runtimes": {
198
+ "nvidia": {
199
+ "path": "/usr/bin/nvidia-container-runtime",
200
+ "runtimeArgs": []
201
+ }
202
+ },
203
+ "default-runtime": "nvidia"
204
+ }
205
+ EOF
180
206
 
181
- `docker build -f ./Dockerfile -t ubuntu24:latest .`
207
+ # 5. Fix Fedora's broken dockerd ExecStart (required!)
208
+ sudo mkdir -p /etc/systemd/system/docker.service.d
209
+ sudo tee /etc/systemd/system/docker.service.d/override.conf >/dev/null <<EOF
210
+ [Service]
211
+ ExecStart=
212
+ ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock
213
+ EOF
182
214
 
183
- #### Run Docker Container
215
+ # 6. Reload and restart Docker
216
+ sudo systemctl daemon-reload
217
+ sudo systemctl restart docker
184
218
 
185
- a) If running on CPU, just remove `--gpus all` from command below
219
+ # 7. Verify it works
220
+ docker info --format '{{.DefaultRuntime}}' # → should print: nvidia
221
+ docker run --rm --gpus all nvidia/cuda:12.0.0-base-ubuntu22.04 nvidia-smi
222
+ ```
186
223
 
187
- b) This command assumes you have set up a Kafka network as described below
188
224
 
189
- `docker run -v ~/src/gst-python-ml/:/root/gst-python-ml -it --rm --gpus all --name ubuntu24 ubuntu24:latest /bin/bash`
225
+ #### Build Container
190
226
 
191
- In the container shell, install `uv` following steps above
227
+ `docker build -f ./Dockerfile_ubuntu24 -t ubuntu24:latest .`
192
228
 
193
- `cd gst-python-ml` to run the pipelines below.
229
+ `docker build -f ./Dockerfile_fedora42 -t fedora42:latest .`
194
230
 
195
- To persist the container, run `docker ps` to get the container id, and then run
196
231
 
197
- `docker commit $CONTAINER_ID` to commit the changes, where `$CONTAINER_ID`
198
- is the id for your docker instance.
232
+ #### Run Docker Container
199
233
 
200
- #### Docker Cleanup
234
+ Note: If running on CPU, just remove `--gpus all` from commands below:
201
235
 
202
- If you want to purge existing docker containers and images:
236
+ `docker run -v ~/src/gst-python-ml/:/root/gst-python-ml -it --rm --gpus all --name ubuntu24 ubuntu24:latest /bin/bash`
203
237
 
204
- ```
205
- docker container prune -f
206
- docker image prune -a -f
207
- ```
238
+ or
239
+
240
+ `docker run -v ~/src/gst-python-ml/:/root/gst-python-ml -it --rm --gpus all --name fedora42 fedora42:latest /bin/bash`
241
+
242
+ Now, in the container shell, set up `uv` `venv` as detailed above.
208
243
 
209
244
  ## IMPORTANT NOTES
210
245
 
@@ -220,24 +255,26 @@ Run `gst-inspect-1.0 python` to list pyml elements.
220
255
  # Building PyPI Package
221
256
 
222
257
  ## Setup
223
- 1. Generate token on PyPI and add to `.pypirc` :
258
+ 1. Generate token on PyPI and copy to `.pypirc`
224
259
 
225
260
  ```
226
261
  [pypi]
227
262
  username = __token__
228
- password = FOOBAR
263
+ password = $TOKEN
229
264
  ```
230
265
 
231
- 2. `pip install setuptools wheel twine`
232
-
233
- ## Build
266
+ 2. Install build dependencies
234
267
 
235
- `python -m build`
236
-
237
- ## Upload
238
-
239
- `twine upload dist/*`
268
+ ```
269
+ pip install setuptools wheel twine
270
+ pip install --upgrade build
271
+ ```
272
+ ## Build and Upoad
240
273
 
274
+ ```
275
+ python -m build
276
+ twine upload dist/*
277
+ ```
241
278
 
242
279
  ## Using GStreamer Python ML Elements
243
280
 
@@ -40,13 +40,22 @@ sudo apt install -y python3-pip python3-venv \
40
40
  ```
41
41
 
42
42
  ##### Fedora
43
+
44
+ (adjust Fedora version from 42 to match your version number)
45
+
46
+ ```
47
+ sudo dnf install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-42.noarch.rpm https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-42.noarch.rpm
48
+ sudo dnf update -y
49
+ sudo dnf install akmod-nvidia xorg-x11-drv-nvidia-cuda -y
50
+ ```
51
+
43
52
  ```
44
53
  sudo dnf upgrade -y
45
54
  sudo dnf install -y python3-pip \
55
+ python3-devel cairo cairo-devel cairo-gobject-devel pkgconfig git \
46
56
  gstreamer1-plugins-base gstreamer1-plugins-base-tools \
47
57
  gstreamer1-plugins-good gstreamer1-plugins-bad-free \
48
- gstreamer1-plugins-bad-free-devel python3-gstreamer1 \
49
- cairo cairo-devel git
58
+ gstreamer1-plugins-bad-free-devel python3-gstreamer1
50
59
  ```
51
60
 
52
61
 
@@ -61,6 +70,7 @@ curl -LsSf https://astral.sh/uv/install.sh | sh
61
70
  ```
62
71
  uv venv --system-site-packages
63
72
  source .venv/bin/activate
73
+ uv pip install --upgrade pip
64
74
  uv sync
65
75
  ```
66
76
 
@@ -83,7 +93,7 @@ git clone https://github.com/collabora/gst-python-ml.git
83
93
  #### Update .bashrc
84
94
 
85
95
  ```
86
- echo 'export GST_PLUGIN_PATH=$HOME/src/gst-python-ml/plugins:$GST_PLUGIN_PATH' >> ~/.bashrc
96
+ echo 'export GST_PLUGIN_PATH=$HOME/src/gst-python-ml/demos:$HOME/src/gst-python-ml/plugins:$GST_PLUGIN_PATH' >> ~/.bashrc
87
97
  source ~/.bashrc
88
98
  ```
89
99
 
@@ -115,55 +125,76 @@ sudo systemctl restart docker
115
125
  ```
116
126
 
117
127
  ##### Fedora
118
- ```
119
- curl -s -L https://nvidia.github.io/libnvidia-container/stable/rpm/nvidia-container-toolkit.repo | sudo tee /etc/yum.repos.d/
120
- nvidia-container-toolkit.repo
121
128
 
122
- sudo dnf install nvidia-container-toolkit
123
- sudo nvidia-ctk runtime configure --runtime=docker
124
- sudo nvidia-ctk runtime configure --runtime=containerd
125
- sudo systemctl restart containerd
126
- sudo systemctl restart docker
129
+ ```
130
+ sudo dnf install docker
131
+ sudo usermod -aG docker $USER
132
+ # Then either log out/in completely, or:
133
+ newgrp docker
127
134
  ```
128
135
 
129
- ##### Testing GPU Support
130
136
 
131
137
  ```
132
- docker pull nvidia/cuda:12.0.0-base-ubuntu22.04
133
- docker run --rm --runtime=nvidia --gpus all nvidia/cuda:12.0.0-base-ubuntu22.04 nvidia-smi
138
+ # 1. Add NVIDIA Container Toolkit repository
139
+ curl -s -L https://nvidia.github.io/libnvidia-container/stable/rpm/nvidia-container-toolkit.repo | \
140
+ sudo tee /etc/yum.repos.d/nvidia-container-toolkit.repo
134
141
 
135
- ```
142
+ # 2. Remove Fedora's conflicting partial package (if present)
143
+ sudo dnf remove -y golang-github-nvidia-container-toolkit 2>/dev/null || true
136
144
 
145
+ # 3. Install the full NVIDIA Container Toolkit
146
+ sudo dnf install -y nvidia-container-toolkit
137
147
 
138
- #### Build Ubuntu 24.04 Container
148
+ # 4. Configure Docker to use the NVIDIA runtime as default
149
+ sudo mkdir -p /etc/docker
150
+ sudo tee /etc/docker/daemon.json > /dev/null <<EOF
151
+ {
152
+ "runtimes": {
153
+ "nvidia": {
154
+ "path": "/usr/bin/nvidia-container-runtime",
155
+ "runtimeArgs": []
156
+ }
157
+ },
158
+ "default-runtime": "nvidia"
159
+ }
160
+ EOF
139
161
 
140
- `docker build -f ./Dockerfile -t ubuntu24:latest .`
162
+ # 5. Fix Fedora's broken dockerd ExecStart (required!)
163
+ sudo mkdir -p /etc/systemd/system/docker.service.d
164
+ sudo tee /etc/systemd/system/docker.service.d/override.conf >/dev/null <<EOF
165
+ [Service]
166
+ ExecStart=
167
+ ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock
168
+ EOF
141
169
 
142
- #### Run Docker Container
170
+ # 6. Reload and restart Docker
171
+ sudo systemctl daemon-reload
172
+ sudo systemctl restart docker
143
173
 
144
- a) If running on CPU, just remove `--gpus all` from command below
174
+ # 7. Verify it works
175
+ docker info --format '{{.DefaultRuntime}}' # → should print: nvidia
176
+ docker run --rm --gpus all nvidia/cuda:12.0.0-base-ubuntu22.04 nvidia-smi
177
+ ```
145
178
 
146
- b) This command assumes you have set up a Kafka network as described below
147
179
 
148
- `docker run -v ~/src/gst-python-ml/:/root/gst-python-ml -it --rm --gpus all --name ubuntu24 ubuntu24:latest /bin/bash`
180
+ #### Build Container
149
181
 
150
- In the container shell, install `uv` following steps above
182
+ `docker build -f ./Dockerfile_ubuntu24 -t ubuntu24:latest .`
151
183
 
152
- `cd gst-python-ml` to run the pipelines below.
184
+ `docker build -f ./Dockerfile_fedora42 -t fedora42:latest .`
153
185
 
154
- To persist the container, run `docker ps` to get the container id, and then run
155
186
 
156
- `docker commit $CONTAINER_ID` to commit the changes, where `$CONTAINER_ID`
157
- is the id for your docker instance.
187
+ #### Run Docker Container
158
188
 
159
- #### Docker Cleanup
189
+ Note: If running on CPU, just remove `--gpus all` from commands below:
160
190
 
161
- If you want to purge existing docker containers and images:
191
+ `docker run -v ~/src/gst-python-ml/:/root/gst-python-ml -it --rm --gpus all --name ubuntu24 ubuntu24:latest /bin/bash`
162
192
 
163
- ```
164
- docker container prune -f
165
- docker image prune -a -f
166
- ```
193
+ or
194
+
195
+ `docker run -v ~/src/gst-python-ml/:/root/gst-python-ml -it --rm --gpus all --name fedora42 fedora42:latest /bin/bash`
196
+
197
+ Now, in the container shell, set up `uv` `venv` as detailed above.
167
198
 
168
199
  ## IMPORTANT NOTES
169
200
 
@@ -179,24 +210,26 @@ Run `gst-inspect-1.0 python` to list pyml elements.
179
210
  # Building PyPI Package
180
211
 
181
212
  ## Setup
182
- 1. Generate token on PyPI and add to `.pypirc` :
213
+ 1. Generate token on PyPI and copy to `.pypirc`
183
214
 
184
215
  ```
185
216
  [pypi]
186
217
  username = __token__
187
- password = FOOBAR
218
+ password = $TOKEN
188
219
  ```
189
220
 
190
- 2. `pip install setuptools wheel twine`
191
-
192
- ## Build
221
+ 2. Install build dependencies
193
222
 
194
- `python -m build`
195
-
196
- ## Upload
197
-
198
- `twine upload dist/*`
223
+ ```
224
+ pip install setuptools wheel twine
225
+ pip install --upgrade build
226
+ ```
227
+ ## Build and Upoad
199
228
 
229
+ ```
230
+ python -m build
231
+ twine upload dist/*
232
+ ```
200
233
 
201
234
  ## Using GStreamer Python ML Elements
202
235
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: gst-python-ml
3
- Version: 1.0.1
3
+ Version: 1.0.3
4
4
  Summary: An ML package for GStreamer
5
5
  Author-email: Aaron Boxer <aaron.boxer@collabora.com>
6
6
  Project-URL: Homepage, https://github.com/collabora/gst-python-ml
@@ -19,6 +19,8 @@ Requires-Dist: qwen-vl-utils[decord]==0.0.8
19
19
  Requires-Dist: autoawq==0.2.9
20
20
  Requires-Dist: accelerate==1.12.0
21
21
  Requires-Dist: bitsandbytes==0.46.1
22
+ Requires-Dist: opencv-python==4.10.0.84
23
+ Requires-Dist: opencv-contrib-python==4.10.0.84
22
24
  Requires-Dist: numpy
23
25
  Requires-Dist: huggingface-hub
24
26
  Requires-Dist: lap
@@ -35,7 +37,9 @@ Requires-Dist: whisperspeech
35
37
  Requires-Dist: webdataset
36
38
  Requires-Dist: easydict
37
39
  Requires-Dist: pyflann-py3
40
+ Requires-Dist: soundfile
38
41
  Requires-Dist: speechbrain
42
+ Requires-Dist: pyopengl
39
43
  Provides-Extra: language
40
44
  Dynamic: license-file
41
45
 
@@ -81,13 +85,22 @@ sudo apt install -y python3-pip python3-venv \
81
85
  ```
82
86
 
83
87
  ##### Fedora
88
+
89
+ (adjust Fedora version from 42 to match your version number)
90
+
91
+ ```
92
+ sudo dnf install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-42.noarch.rpm https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-42.noarch.rpm
93
+ sudo dnf update -y
94
+ sudo dnf install akmod-nvidia xorg-x11-drv-nvidia-cuda -y
95
+ ```
96
+
84
97
  ```
85
98
  sudo dnf upgrade -y
86
99
  sudo dnf install -y python3-pip \
100
+ python3-devel cairo cairo-devel cairo-gobject-devel pkgconfig git \
87
101
  gstreamer1-plugins-base gstreamer1-plugins-base-tools \
88
102
  gstreamer1-plugins-good gstreamer1-plugins-bad-free \
89
- gstreamer1-plugins-bad-free-devel python3-gstreamer1 \
90
- cairo cairo-devel git
103
+ gstreamer1-plugins-bad-free-devel python3-gstreamer1
91
104
  ```
92
105
 
93
106
 
@@ -102,6 +115,7 @@ curl -LsSf https://astral.sh/uv/install.sh | sh
102
115
  ```
103
116
  uv venv --system-site-packages
104
117
  source .venv/bin/activate
118
+ uv pip install --upgrade pip
105
119
  uv sync
106
120
  ```
107
121
 
@@ -124,7 +138,7 @@ git clone https://github.com/collabora/gst-python-ml.git
124
138
  #### Update .bashrc
125
139
 
126
140
  ```
127
- echo 'export GST_PLUGIN_PATH=$HOME/src/gst-python-ml/plugins:$GST_PLUGIN_PATH' >> ~/.bashrc
141
+ echo 'export GST_PLUGIN_PATH=$HOME/src/gst-python-ml/demos:$HOME/src/gst-python-ml/plugins:$GST_PLUGIN_PATH' >> ~/.bashrc
128
142
  source ~/.bashrc
129
143
  ```
130
144
 
@@ -156,55 +170,76 @@ sudo systemctl restart docker
156
170
  ```
157
171
 
158
172
  ##### Fedora
159
- ```
160
- curl -s -L https://nvidia.github.io/libnvidia-container/stable/rpm/nvidia-container-toolkit.repo | sudo tee /etc/yum.repos.d/
161
- nvidia-container-toolkit.repo
162
173
 
163
- sudo dnf install nvidia-container-toolkit
164
- sudo nvidia-ctk runtime configure --runtime=docker
165
- sudo nvidia-ctk runtime configure --runtime=containerd
166
- sudo systemctl restart containerd
167
- sudo systemctl restart docker
174
+ ```
175
+ sudo dnf install docker
176
+ sudo usermod -aG docker $USER
177
+ # Then either log out/in completely, or:
178
+ newgrp docker
168
179
  ```
169
180
 
170
- ##### Testing GPU Support
171
181
 
172
182
  ```
173
- docker pull nvidia/cuda:12.0.0-base-ubuntu22.04
174
- docker run --rm --runtime=nvidia --gpus all nvidia/cuda:12.0.0-base-ubuntu22.04 nvidia-smi
183
+ # 1. Add NVIDIA Container Toolkit repository
184
+ curl -s -L https://nvidia.github.io/libnvidia-container/stable/rpm/nvidia-container-toolkit.repo | \
185
+ sudo tee /etc/yum.repos.d/nvidia-container-toolkit.repo
175
186
 
176
- ```
187
+ # 2. Remove Fedora's conflicting partial package (if present)
188
+ sudo dnf remove -y golang-github-nvidia-container-toolkit 2>/dev/null || true
177
189
 
190
+ # 3. Install the full NVIDIA Container Toolkit
191
+ sudo dnf install -y nvidia-container-toolkit
178
192
 
179
- #### Build Ubuntu 24.04 Container
193
+ # 4. Configure Docker to use the NVIDIA runtime as default
194
+ sudo mkdir -p /etc/docker
195
+ sudo tee /etc/docker/daemon.json > /dev/null <<EOF
196
+ {
197
+ "runtimes": {
198
+ "nvidia": {
199
+ "path": "/usr/bin/nvidia-container-runtime",
200
+ "runtimeArgs": []
201
+ }
202
+ },
203
+ "default-runtime": "nvidia"
204
+ }
205
+ EOF
180
206
 
181
- `docker build -f ./Dockerfile -t ubuntu24:latest .`
207
+ # 5. Fix Fedora's broken dockerd ExecStart (required!)
208
+ sudo mkdir -p /etc/systemd/system/docker.service.d
209
+ sudo tee /etc/systemd/system/docker.service.d/override.conf >/dev/null <<EOF
210
+ [Service]
211
+ ExecStart=
212
+ ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock
213
+ EOF
182
214
 
183
- #### Run Docker Container
215
+ # 6. Reload and restart Docker
216
+ sudo systemctl daemon-reload
217
+ sudo systemctl restart docker
184
218
 
185
- a) If running on CPU, just remove `--gpus all` from command below
219
+ # 7. Verify it works
220
+ docker info --format '{{.DefaultRuntime}}' # → should print: nvidia
221
+ docker run --rm --gpus all nvidia/cuda:12.0.0-base-ubuntu22.04 nvidia-smi
222
+ ```
186
223
 
187
- b) This command assumes you have set up a Kafka network as described below
188
224
 
189
- `docker run -v ~/src/gst-python-ml/:/root/gst-python-ml -it --rm --gpus all --name ubuntu24 ubuntu24:latest /bin/bash`
225
+ #### Build Container
190
226
 
191
- In the container shell, install `uv` following steps above
227
+ `docker build -f ./Dockerfile_ubuntu24 -t ubuntu24:latest .`
192
228
 
193
- `cd gst-python-ml` to run the pipelines below.
229
+ `docker build -f ./Dockerfile_fedora42 -t fedora42:latest .`
194
230
 
195
- To persist the container, run `docker ps` to get the container id, and then run
196
231
 
197
- `docker commit $CONTAINER_ID` to commit the changes, where `$CONTAINER_ID`
198
- is the id for your docker instance.
232
+ #### Run Docker Container
199
233
 
200
- #### Docker Cleanup
234
+ Note: If running on CPU, just remove `--gpus all` from commands below:
201
235
 
202
- If you want to purge existing docker containers and images:
236
+ `docker run -v ~/src/gst-python-ml/:/root/gst-python-ml -it --rm --gpus all --name ubuntu24 ubuntu24:latest /bin/bash`
203
237
 
204
- ```
205
- docker container prune -f
206
- docker image prune -a -f
207
- ```
238
+ or
239
+
240
+ `docker run -v ~/src/gst-python-ml/:/root/gst-python-ml -it --rm --gpus all --name fedora42 fedora42:latest /bin/bash`
241
+
242
+ Now, in the container shell, set up `uv` `venv` as detailed above.
208
243
 
209
244
  ## IMPORTANT NOTES
210
245
 
@@ -220,24 +255,26 @@ Run `gst-inspect-1.0 python` to list pyml elements.
220
255
  # Building PyPI Package
221
256
 
222
257
  ## Setup
223
- 1. Generate token on PyPI and add to `.pypirc` :
258
+ 1. Generate token on PyPI and copy to `.pypirc`
224
259
 
225
260
  ```
226
261
  [pypi]
227
262
  username = __token__
228
- password = FOOBAR
263
+ password = $TOKEN
229
264
  ```
230
265
 
231
- 2. `pip install setuptools wheel twine`
232
-
233
- ## Build
266
+ 2. Install build dependencies
234
267
 
235
- `python -m build`
236
-
237
- ## Upload
238
-
239
- `twine upload dist/*`
268
+ ```
269
+ pip install setuptools wheel twine
270
+ pip install --upgrade build
271
+ ```
272
+ ## Build and Upoad
240
273
 
274
+ ```
275
+ python -m build
276
+ twine upload dist/*
277
+ ```
241
278
 
242
279
  ## Using GStreamer Python ML Elements
243
280
 
@@ -7,6 +7,8 @@ qwen-vl-utils[decord]==0.0.8
7
7
  autoawq==0.2.9
8
8
  accelerate==1.12.0
9
9
  bitsandbytes==0.46.1
10
+ opencv-python==4.10.0.84
11
+ opencv-contrib-python==4.10.0.84
10
12
  numpy
11
13
  huggingface-hub
12
14
  lap
@@ -23,6 +25,8 @@ whisperspeech
23
25
  webdataset
24
26
  easydict
25
27
  pyflann-py3
28
+ soundfile
26
29
  speechbrain
30
+ pyopengl
27
31
 
28
32
  [language]
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "gst-python-ml"
7
- version = "1.0.1"
7
+ version = "1.0.3"
8
8
  description = "An ML package for GStreamer"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.13"
@@ -26,6 +26,8 @@ dependencies = [
26
26
  "autoawq==0.2.9",
27
27
  "accelerate==1.12.0",
28
28
  "bitsandbytes==0.46.1",
29
+ "opencv-python==4.10.0.84",
30
+ "opencv-contrib-python==4.10.0.84",
29
31
  "numpy",
30
32
  "huggingface-hub",
31
33
  "lap",
@@ -43,7 +45,9 @@ dependencies = [
43
45
  "webdataset",
44
46
  "easydict",
45
47
  "pyflann-py3",
46
- "speechbrain"
48
+ "soundfile",
49
+ "speechbrain",
50
+ "pyopengl"
47
51
  ]
48
52
 
49
53
  # Optional
File without changes
File without changes