trainingsample 0.3.1__tar.gz → 0.4.0__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 (43) hide show
  1. {trainingsample-0.3.1 → trainingsample-0.4.0}/.github/workflows/ci.yml +15 -16
  2. {trainingsample-0.3.1 → trainingsample-0.4.0}/.github/workflows/publish.yml +32 -10
  3. {trainingsample-0.3.1 → trainingsample-0.4.0}/.gitignore +1 -0
  4. {trainingsample-0.3.1 → trainingsample-0.4.0}/.pre-commit-config.yaml +4 -4
  5. {trainingsample-0.3.1 → trainingsample-0.4.0}/BENCHMARKS.md +6 -0
  6. {trainingsample-0.3.1 → trainingsample-0.4.0}/Cargo.lock +357 -325
  7. {trainingsample-0.3.1 → trainingsample-0.4.0}/Cargo.toml +17 -16
  8. {trainingsample-0.3.1 → trainingsample-0.4.0}/PKG-INFO +6 -5
  9. {trainingsample-0.3.1 → trainingsample-0.4.0}/README.md +1 -1
  10. {trainingsample-0.3.1 → trainingsample-0.4.0}/clippy.toml +0 -1
  11. {trainingsample-0.3.1 → trainingsample-0.4.0}/docs/BUILDING_STATIC_OPENCV.md +11 -0
  12. {trainingsample-0.3.1 → trainingsample-0.4.0}/pyproject.toml +10 -9
  13. {trainingsample-0.3.1 → trainingsample-0.4.0}/scripts/build-opencv-static.sh +15 -1
  14. {trainingsample-0.3.1 → trainingsample-0.4.0}/src/lib.rs +3 -1
  15. {trainingsample-0.3.1 → trainingsample-0.4.0}/src/python_bindings.rs +33 -33
  16. trainingsample-0.4.0/tests/coverage_tests.rs +427 -0
  17. {trainingsample-0.3.1 → trainingsample-0.4.0}/tests/test_performance_benchmarks.py +31 -23
  18. {trainingsample-0.3.1 → trainingsample-0.4.0}/.cargo/config.toml +0 -0
  19. {trainingsample-0.3.1 → trainingsample-0.4.0}/.envrc +0 -0
  20. {trainingsample-0.3.1 → trainingsample-0.4.0}/.rustfmt.toml +0 -0
  21. {trainingsample-0.3.1 → trainingsample-0.4.0}/Dockerfile +0 -0
  22. {trainingsample-0.3.1 → trainingsample-0.4.0}/LICENSE +0 -0
  23. {trainingsample-0.3.1 → trainingsample-0.4.0}/docs/API_COMPAT_CV2.md +0 -0
  24. {trainingsample-0.3.1 → trainingsample-0.4.0}/rust-toolchain.toml +0 -0
  25. {trainingsample-0.3.1 → trainingsample-0.4.0}/scripts/repair-wheel.sh +0 -0
  26. {trainingsample-0.3.1 → trainingsample-0.4.0}/scripts/run_competitive_benchmarks.sh +0 -0
  27. {trainingsample-0.3.1 → trainingsample-0.4.0}/setup-env.sh +0 -0
  28. {trainingsample-0.3.1 → trainingsample-0.4.0}/src/core.rs +0 -0
  29. {trainingsample-0.3.1 → trainingsample-0.4.0}/src/cropping.rs +0 -0
  30. {trainingsample-0.3.1 → trainingsample-0.4.0}/src/cv_batch_ops.rs +0 -0
  31. {trainingsample-0.3.1 → trainingsample-0.4.0}/src/cv_batch_ops_optimized.rs +0 -0
  32. {trainingsample-0.3.1 → trainingsample-0.4.0}/src/cv_compat.rs +0 -0
  33. {trainingsample-0.3.1 → trainingsample-0.4.0}/src/format_conversion_simd.rs +0 -0
  34. {trainingsample-0.3.1 → trainingsample-0.4.0}/src/loading.rs +0 -0
  35. {trainingsample-0.3.1 → trainingsample-0.4.0}/src/luminance.rs +0 -0
  36. {trainingsample-0.3.1 → trainingsample-0.4.0}/src/luminance_simd.rs +0 -0
  37. {trainingsample-0.3.1 → trainingsample-0.4.0}/src/opencv_ops.rs +0 -0
  38. {trainingsample-0.3.1 → trainingsample-0.4.0}/src/tests.rs +0 -0
  39. {trainingsample-0.3.1 → trainingsample-0.4.0}/src/true_batch_ops.rs +0 -0
  40. {trainingsample-0.3.1 → trainingsample-0.4.0}/tests/__init__.py +0 -0
  41. {trainingsample-0.3.1 → trainingsample-0.4.0}/tests/comprehensive_tests.rs +0 -0
  42. {trainingsample-0.3.1 → trainingsample-0.4.0}/tests/test_comprehensive.py +0 -0
  43. {trainingsample-0.3.1 → trainingsample-0.4.0}/tests/test_python_bindings.py +0 -0
@@ -13,7 +13,7 @@ env:
13
13
  jobs:
14
14
  rust-tests:
15
15
  name: Rust Tests
16
- runs-on: ubuntu-latest
16
+ runs-on: ubuntu-24.04
17
17
 
18
18
  steps:
19
19
  - uses: actions/checkout@v4
@@ -22,8 +22,8 @@ jobs:
22
22
  run: |
23
23
  sudo apt-get update
24
24
  sudo apt-get install -y pkg-config clang libclang-dev llvm-dev wget cmake build-essential
25
- # Install LLVM 18 which has the proper libclang.so symlink
26
- sudo apt-get install -y llvm-18 llvm-18-dev llvm-18-tools libclang1-18 libclang-cpp18
25
+ # Install the matching development package for LLVM 18's libclang.so symlink
26
+ sudo apt-get install -y llvm-18 llvm-18-dev llvm-18-tools libclang-18-dev libclang1-18 libclang-cpp18
27
27
  # Set environment variables for LLVM 18
28
28
  echo "LIBCLANG_PATH=/usr/lib/llvm-18/lib" >> $GITHUB_ENV
29
29
  echo "LLVM_CONFIG_PATH=/usr/bin/llvm-config-18" >> $GITHUB_ENV
@@ -105,10 +105,10 @@ jobs:
105
105
 
106
106
  python-tests:
107
107
  name: Python Tests
108
- runs-on: ubuntu-latest
108
+ runs-on: ubuntu-24.04
109
109
  strategy:
110
110
  matrix:
111
- python-version: ["3.11", "3.12", "3.13"]
111
+ python-version: ["3.11", "3.12", "3.13", "3.14"]
112
112
 
113
113
  steps:
114
114
  - uses: actions/checkout@v4
@@ -117,8 +117,8 @@ jobs:
117
117
  run: |
118
118
  sudo apt-get update
119
119
  sudo apt-get install -y pkg-config clang libclang-dev llvm-dev wget cmake build-essential
120
- # Install LLVM 18 which has the proper libclang.so symlink
121
- sudo apt-get install -y llvm-18 llvm-18-dev llvm-18-tools libclang1-18 libclang-cpp18
120
+ # Install the matching development package for LLVM 18's libclang.so symlink
121
+ sudo apt-get install -y llvm-18 llvm-18-dev llvm-18-tools libclang-18-dev libclang1-18 libclang-cpp18
122
122
  # Set environment variables for LLVM 18
123
123
  echo "LIBCLANG_PATH=/usr/lib/llvm-18/lib" >> $GITHUB_ENV
124
124
  echo "LLVM_CONFIG_PATH=/usr/bin/llvm-config-18" >> $GITHUB_ENV
@@ -199,7 +199,7 @@ jobs:
199
199
 
200
200
  pre-commit:
201
201
  name: Pre-commit hooks
202
- runs-on: ubuntu-latest
202
+ runs-on: ubuntu-24.04
203
203
 
204
204
  steps:
205
205
  - uses: actions/checkout@v4
@@ -208,8 +208,8 @@ jobs:
208
208
  run: |
209
209
  sudo apt-get update
210
210
  sudo apt-get install -y pkg-config clang libclang-dev llvm-dev wget cmake build-essential
211
- # Install LLVM 18 which has the proper libclang.so symlink
212
- sudo apt-get install -y llvm-18 llvm-18-dev llvm-18-tools libclang1-18 libclang-cpp18
211
+ # Install the matching development package for LLVM 18's libclang.so symlink
212
+ sudo apt-get install -y llvm-18 llvm-18-dev llvm-18-tools libclang-18-dev libclang1-18 libclang-cpp18
213
213
  # Set environment variables for LLVM 18
214
214
  echo "LIBCLANG_PATH=/usr/lib/llvm-18/lib" >> $GITHUB_ENV
215
215
  echo "LLVM_CONFIG_PATH=/usr/bin/llvm-config-18" >> $GITHUB_ENV
@@ -278,7 +278,7 @@ jobs:
278
278
  runs-on: ${{ matrix.os }}
279
279
  strategy:
280
280
  matrix:
281
- os: [ubuntu-latest, macos-latest]
281
+ os: [ubuntu-24.04, macos-latest]
282
282
 
283
283
  steps:
284
284
  - uses: actions/checkout@v4
@@ -288,8 +288,8 @@ jobs:
288
288
  run: |
289
289
  sudo apt-get update
290
290
  sudo apt-get install -y pkg-config clang libclang-dev llvm-dev wget cmake build-essential
291
- # Install LLVM 18 which has the proper libclang.so symlink
292
- sudo apt-get install -y llvm-18 llvm-18-dev llvm-18-tools libclang1-18 libclang-cpp18
291
+ # Install the matching development package for LLVM 18's libclang.so symlink
292
+ sudo apt-get install -y llvm-18 llvm-18-dev llvm-18-tools libclang-18-dev libclang1-18 libclang-cpp18
293
293
  # Set environment variables for LLVM 18
294
294
  echo "LIBCLANG_PATH=/usr/lib/llvm-18/lib" >> $GITHUB_ENV
295
295
  echo "LLVM_CONFIG_PATH=/usr/bin/llvm-config-18" >> $GITHUB_ENV
@@ -387,7 +387,7 @@ jobs:
387
387
  runs-on: ubuntu-24.04-arm
388
388
  strategy:
389
389
  matrix:
390
- python: ["3.11", "3.12", "3.13"]
390
+ python: ["3.11", "3.12", "3.13", "3.14"]
391
391
 
392
392
  steps:
393
393
  - uses: actions/checkout@v4
@@ -410,7 +410,7 @@ jobs:
410
410
  sudo apt-get update
411
411
  sudo apt-get install -y pkg-config clang libclang-dev llvm-dev wget cmake build-essential curl nasm yasm
412
412
 
413
- sudo apt-get install -y llvm-18 llvm-18-dev llvm-18-tools libclang1-18 libclang-cpp18
413
+ sudo apt-get install -y llvm-18 llvm-18-dev llvm-18-tools libclang-18-dev libclang1-18 libclang-cpp18
414
414
  echo "LLVM_CONFIG_PATH=/usr/bin/llvm-config-18" >> $GITHUB_ENV
415
415
 
416
416
  LIBCLANG_PATH="/usr/lib/llvm-18/lib"
@@ -434,7 +434,6 @@ jobs:
434
434
  container: off
435
435
  manylinux: manylinux_2_39
436
436
  env:
437
- PYO3_USE_ABI3_FORWARD_COMPATIBILITY: '1'
438
437
  LIBCLANG_PATH: ${{ env.LIBCLANG_PATH }}
439
438
  LLVM_CONFIG_PATH: ${{ env.LLVM_CONFIG_PATH }}
440
439
  OPENCV_INCLUDE_PATHS: ${{ github.workspace }}/third_party/opencv-static/include/opencv4
@@ -25,6 +25,10 @@ jobs:
25
25
  target: x86_64
26
26
  manylinux: manylinux_2_35
27
27
  python: '3.13'
28
+ - os: ubuntu-22.04
29
+ target: x86_64
30
+ manylinux: manylinux_2_35
31
+ python: '3.14'
28
32
  # Ubuntu 24.04 (libc 2.39)
29
33
  - os: ubuntu-24.04
30
34
  target: x86_64
@@ -38,6 +42,10 @@ jobs:
38
42
  target: x86_64
39
43
  manylinux: manylinux_2_39
40
44
  python: '3.13'
45
+ - os: ubuntu-24.04
46
+ target: x86_64
47
+ manylinux: manylinux_2_39
48
+ python: '3.14'
41
49
  steps:
42
50
  - uses: actions/checkout@v4
43
51
  - uses: actions/setup-python@v5
@@ -68,7 +76,7 @@ jobs:
68
76
  echo "LLVM_CONFIG_PATH=/usr/bin/llvm-config-14" >> $GITHUB_ENV
69
77
  else
70
78
  # Ubuntu 24.04 has LLVM 18 by default
71
- sudo apt-get install -y llvm-18 llvm-18-dev llvm-18-tools libclang1-18 libclang-cpp18
79
+ sudo apt-get install -y llvm-18 llvm-18-dev llvm-18-tools libclang-18-dev libclang1-18 libclang-cpp18
72
80
  echo "LLVM_CONFIG_PATH=/usr/bin/llvm-config-18" >> $GITHUB_ENV
73
81
  fi
74
82
 
@@ -104,8 +112,6 @@ jobs:
104
112
  container: off
105
113
  manylinux: ${{ matrix.manylinux }}
106
114
  env:
107
- # Use stable ABI for forward compatibility
108
- PYO3_USE_ABI3_FORWARD_COMPATIBILITY: '1'
109
115
  # LLVM for opencv-rust bindings (from earlier install step)
110
116
  LIBCLANG_PATH: ${{ env.LIBCLANG_PATH }}
111
117
  LLVM_CONFIG_PATH: ${{ env.LLVM_CONFIG_PATH }}
@@ -135,7 +141,7 @@ jobs:
135
141
  runs-on: ubuntu-24.04-arm
136
142
  strategy:
137
143
  matrix:
138
- python: ['3.11', '3.12', '3.13']
144
+ python: ['3.11', '3.12', '3.13', '3.14']
139
145
  steps:
140
146
  - uses: actions/checkout@v4
141
147
  - uses: actions/setup-python@v5
@@ -158,7 +164,7 @@ jobs:
158
164
  sudo apt-get install -y clang libclang-dev llvm-dev cmake curl wget nasm yasm pkg-config
159
165
 
160
166
  # Ubuntu 24.04 has LLVM 18 by default
161
- sudo apt-get install -y llvm-18 llvm-18-dev llvm-18-tools libclang1-18 libclang-cpp18
167
+ sudo apt-get install -y llvm-18 llvm-18-dev llvm-18-tools libclang-18-dev libclang1-18 libclang-cpp18
162
168
  echo "LLVM_CONFIG_PATH=/usr/bin/llvm-config-18" >> $GITHUB_ENV
163
169
 
164
170
  LIBCLANG_PATH="/usr/lib/llvm-18/lib"
@@ -186,8 +192,6 @@ jobs:
186
192
  container: off
187
193
  manylinux: manylinux_2_39
188
194
  env:
189
- # Use stable ABI for forward compatibility
190
- PYO3_USE_ABI3_FORWARD_COMPATIBILITY: '1'
191
195
  # LLVM for opencv-rust bindings (from earlier install step)
192
196
  LIBCLANG_PATH: ${{ env.LIBCLANG_PATH }}
193
197
  LLVM_CONFIG_PATH: ${{ env.LLVM_CONFIG_PATH }}
@@ -217,7 +221,7 @@ jobs:
217
221
  strategy:
218
222
  matrix:
219
223
  target: [aarch64]
220
- python: ['3.11', '3.12', '3.13']
224
+ python: ['3.11', '3.12', '3.13', '3.14']
221
225
  steps:
222
226
  - uses: actions/checkout@v4
223
227
  - uses: actions/setup-python@v5
@@ -251,8 +255,6 @@ jobs:
251
255
  args: --release --out dist -i python --no-default-features --features python-bindings,simd,opencv,metal
252
256
  sccache: 'false'
253
257
  env:
254
- # Use stable ABI for forward compatibility
255
- PYO3_USE_ABI3_FORWARD_COMPATIBILITY: '1'
256
258
  # OpenCV static linking configuration
257
259
  OPENCV_INCLUDE_PATHS: ${{ github.workspace }}/third_party/opencv-static/include/opencv4
258
260
  OPENCV_LINK_PATHS: ${{ github.workspace }}/third_party/opencv-static/lib
@@ -306,6 +308,11 @@ jobs:
306
308
  manylinux: manylinux_2_35
307
309
  python: '3.13'
308
310
  artifact_name: wheels-ubuntu-22.04-x86_64-py3.13
311
+ - os: ubuntu-22.04
312
+ target: x86_64
313
+ manylinux: manylinux_2_35
314
+ python: '3.14'
315
+ artifact_name: wheels-ubuntu-22.04-x86_64-py3.14
309
316
  # Ubuntu 24.04 (libc 2.39)
310
317
  - os: ubuntu-24.04
311
318
  target: x86_64
@@ -322,6 +329,11 @@ jobs:
322
329
  manylinux: manylinux_2_39
323
330
  python: '3.13'
324
331
  artifact_name: wheels-ubuntu-24.04-x86_64-py3.13
332
+ - os: ubuntu-24.04
333
+ target: x86_64
334
+ manylinux: manylinux_2_39
335
+ python: '3.14'
336
+ artifact_name: wheels-ubuntu-24.04-x86_64-py3.14
325
337
  # Linux aarch64 (DGX Spark / GB10)
326
338
  - os: ubuntu-24.04-arm
327
339
  target: aarch64
@@ -338,6 +350,11 @@ jobs:
338
350
  manylinux: manylinux_2_39
339
351
  python: '3.13'
340
352
  artifact_name: wheels-linux-aarch64-py3.13
353
+ - os: ubuntu-24.04-arm
354
+ target: aarch64
355
+ manylinux: manylinux_2_39
356
+ python: '3.14'
357
+ artifact_name: wheels-linux-aarch64-py3.14
341
358
  # macOS aarch64
342
359
  - os: macos-latest
343
360
  target: aarch64
@@ -354,6 +371,11 @@ jobs:
354
371
  manylinux: ''
355
372
  python: '3.13'
356
373
  artifact_name: wheels-macos-latest-aarch64-py3.13
374
+ - os: macos-latest
375
+ target: aarch64
376
+ manylinux: ''
377
+ python: '3.14'
378
+ artifact_name: wheels-macos-latest-aarch64-py3.14
357
379
  steps:
358
380
  - uses: actions/download-artifact@v4
359
381
  with:
@@ -52,6 +52,7 @@ Cargo.lock
52
52
  # Static OpenCV bundle (built in CI, not committed)
53
53
  third_party/
54
54
  opencv-build-tmp/
55
+ ffmpeg-build-tmp/
55
56
 
56
57
  files.tbz
57
58
  */config/auth.json
@@ -27,21 +27,21 @@ repos:
27
27
 
28
28
  # Python formatting and linting
29
29
  - repo: https://github.com/psf/black
30
- rev: 25.1.0
30
+ rev: 26.10.1
31
31
  hooks:
32
32
  - id: black
33
33
  language_version: python3
34
34
  files: \.py$
35
35
 
36
36
  - repo: https://github.com/pycqa/isort
37
- rev: 6.0.1
37
+ rev: 9.0.2
38
38
  hooks:
39
39
  - id: isort
40
40
  args: ["--profile", "black"]
41
41
  files: \.py$
42
42
 
43
43
  - repo: https://github.com/pycqa/flake8
44
- rev: 7.3.0
44
+ rev: 7.5.0
45
45
  hooks:
46
46
  - id: flake8
47
47
  args: ["--max-line-length=88", "--extend-ignore=E203,W503"]
@@ -49,7 +49,7 @@ repos:
49
49
 
50
50
  # TOML formatting
51
51
  - repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
52
- rev: v2.15.0
52
+ rev: v2.16.0
53
53
  hooks:
54
54
  - id: pretty-format-toml
55
55
  args: [--autofix]
@@ -95,6 +95,12 @@ The performance file contains both benchmarks and assertions.
95
95
  Single-run `time.perf_counter` output is diagnostic. It is not a stable result
96
96
  across hosts or OpenCV builds.
97
97
 
98
+ The large-image luminance scaling check uses deterministic inputs and validates
99
+ results against NumPy. It compares medians from seven interleaved timing rounds,
100
+ with five calls per batch size in each round. Its CI guard allows up to twice
101
+ the per-image cost as batches grow; it does not require a parallel speedup on
102
+ shared runners or across CPU cache sizes.
103
+
98
104
  ## Published numbers
99
105
 
100
106
  This repository does not currently store benchmark artifacts keyed by commit,