trainingsample 0.2.2__tar.gz → 0.2.4__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 (40) hide show
  1. {trainingsample-0.2.2 → trainingsample-0.2.4}/.github/workflows/ci.yml +154 -11
  2. {trainingsample-0.2.2 → trainingsample-0.2.4}/.github/workflows/publish.yml +66 -18
  3. {trainingsample-0.2.2 → trainingsample-0.2.4}/Cargo.lock +1 -1
  4. {trainingsample-0.2.2 → trainingsample-0.2.4}/Cargo.toml +1 -1
  5. {trainingsample-0.2.2 → trainingsample-0.2.4}/PKG-INFO +1 -1
  6. {trainingsample-0.2.2 → trainingsample-0.2.4}/pyproject.toml +1 -1
  7. trainingsample-0.2.4/rust-toolchain.toml +4 -0
  8. {trainingsample-0.2.2 → trainingsample-0.2.4}/scripts/build-opencv-static.sh +1 -0
  9. {trainingsample-0.2.2 → trainingsample-0.2.4}/src/opencv_ops.rs +2 -13
  10. {trainingsample-0.2.2 → trainingsample-0.2.4}/src/true_batch_ops.rs +2 -11
  11. {trainingsample-0.2.2 → trainingsample-0.2.4}/.cargo/config.toml +0 -0
  12. {trainingsample-0.2.2 → trainingsample-0.2.4}/.envrc +0 -0
  13. {trainingsample-0.2.2 → trainingsample-0.2.4}/.gitignore +0 -0
  14. {trainingsample-0.2.2 → trainingsample-0.2.4}/.pre-commit-config.yaml +0 -0
  15. {trainingsample-0.2.2 → trainingsample-0.2.4}/.rustfmt.toml +0 -0
  16. {trainingsample-0.2.2 → trainingsample-0.2.4}/BENCHMARKS.md +0 -0
  17. {trainingsample-0.2.2 → trainingsample-0.2.4}/LICENSE +0 -0
  18. {trainingsample-0.2.2 → trainingsample-0.2.4}/README.md +0 -0
  19. {trainingsample-0.2.2 → trainingsample-0.2.4}/clippy.toml +0 -0
  20. {trainingsample-0.2.2 → trainingsample-0.2.4}/docs/API_COMPAT_CV2.md +0 -0
  21. {trainingsample-0.2.2 → trainingsample-0.2.4}/docs/BUILDING_STATIC_OPENCV.md +0 -0
  22. {trainingsample-0.2.2 → trainingsample-0.2.4}/scripts/run_competitive_benchmarks.sh +0 -0
  23. {trainingsample-0.2.2 → trainingsample-0.2.4}/setup-env.sh +0 -0
  24. {trainingsample-0.2.2 → trainingsample-0.2.4}/src/core.rs +0 -0
  25. {trainingsample-0.2.2 → trainingsample-0.2.4}/src/cropping.rs +0 -0
  26. {trainingsample-0.2.2 → trainingsample-0.2.4}/src/cv_batch_ops.rs +0 -0
  27. {trainingsample-0.2.2 → trainingsample-0.2.4}/src/cv_batch_ops_optimized.rs +0 -0
  28. {trainingsample-0.2.2 → trainingsample-0.2.4}/src/cv_compat.rs +0 -0
  29. {trainingsample-0.2.2 → trainingsample-0.2.4}/src/format_conversion_simd.rs +0 -0
  30. {trainingsample-0.2.2 → trainingsample-0.2.4}/src/lib.rs +0 -0
  31. {trainingsample-0.2.2 → trainingsample-0.2.4}/src/loading.rs +0 -0
  32. {trainingsample-0.2.2 → trainingsample-0.2.4}/src/luminance.rs +0 -0
  33. {trainingsample-0.2.2 → trainingsample-0.2.4}/src/luminance_simd.rs +0 -0
  34. {trainingsample-0.2.2 → trainingsample-0.2.4}/src/python_bindings.rs +0 -0
  35. {trainingsample-0.2.2 → trainingsample-0.2.4}/src/tests.rs +0 -0
  36. {trainingsample-0.2.2 → trainingsample-0.2.4}/tests/__init__.py +0 -0
  37. {trainingsample-0.2.2 → trainingsample-0.2.4}/tests/comprehensive_tests.rs +0 -0
  38. {trainingsample-0.2.2 → trainingsample-0.2.4}/tests/test_comprehensive.py +0 -0
  39. {trainingsample-0.2.2 → trainingsample-0.2.4}/tests/test_performance_benchmarks.py +0 -0
  40. {trainingsample-0.2.2 → trainingsample-0.2.4}/tests/test_python_bindings.py +0 -0
@@ -13,9 +13,6 @@ jobs:
13
13
  rust-tests:
14
14
  name: Rust Tests
15
15
  runs-on: ubuntu-latest
16
- strategy:
17
- matrix:
18
- rust: [stable, beta]
19
16
 
20
17
  steps:
21
18
  - uses: actions/checkout@v4
@@ -23,7 +20,7 @@ jobs:
23
20
  - name: Install OpenCV and LLVM dependencies
24
21
  run: |
25
22
  sudo apt-get update
26
- sudo apt-get install -y pkg-config libopencv-dev clang libclang-dev llvm-dev
23
+ sudo apt-get install -y pkg-config clang libclang-dev llvm-dev wget cmake build-essential
27
24
  # Install LLVM 18 which has the proper libclang.so symlink
28
25
  sudo apt-get install -y llvm-18 llvm-18-dev llvm-18-tools libclang1-18 libclang-cpp18
29
26
  # Set environment variables for LLVM 18
@@ -34,10 +31,45 @@ jobs:
34
31
  ls -la /usr/lib/llvm-18/lib/libclang.so
35
32
  which llvm-config-18
36
33
 
34
+ # Build OpenCV 4.12 from source since Ubuntu 24.04 only has 4.6
35
+ echo "Building OpenCV 4.12 from source..."
36
+ cd /tmp
37
+ wget -q https://github.com/opencv/opencv/archive/4.12.0.tar.gz
38
+ tar -xzf 4.12.0.tar.gz
39
+ cd opencv-4.12.0
40
+ mkdir build
41
+ cd build
42
+ cmake \
43
+ -DCMAKE_BUILD_TYPE=RELEASE \
44
+ -DCMAKE_INSTALL_PREFIX=/usr/local \
45
+ -DWITH_CUDA=OFF \
46
+ -DWITH_OPENGL=OFF \
47
+ -DWITH_OPENCL=OFF \
48
+ -DWITH_TBB=OFF \
49
+ -DWITH_IPP=OFF \
50
+ -DWITH_1394=OFF \
51
+ -DWITH_V4L=OFF \
52
+ -DWITH_GTK=OFF \
53
+ -DBUILD_TESTS=OFF \
54
+ -DBUILD_PERF_TESTS=OFF \
55
+ -DBUILD_EXAMPLES=OFF \
56
+ -DBUILD_opencv_python2=OFF \
57
+ -DBUILD_opencv_python3=OFF \
58
+ -DBUILD_opencv_java=OFF \
59
+ -DOPENCV_GENERATE_PKGCONFIG=ON \
60
+ ..
61
+ make -j$(nproc)
62
+ sudo make install
63
+ sudo ldconfig
64
+
65
+ # Set OpenCV environment variables
66
+ echo "PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH" >> $GITHUB_ENV
67
+ echo "LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV
68
+
37
69
  - name: Install Rust toolchain
38
70
  uses: dtolnay/rust-toolchain@master
39
71
  with:
40
- toolchain: ${{ matrix.rust }}
72
+ toolchain: 1.85
41
73
  components: rustfmt, clippy
42
74
 
43
75
  - name: Cache cargo registry
@@ -83,7 +115,7 @@ jobs:
83
115
  - name: Install OpenCV and LLVM dependencies
84
116
  run: |
85
117
  sudo apt-get update
86
- sudo apt-get install -y pkg-config libopencv-dev clang libclang-dev llvm-dev
118
+ sudo apt-get install -y pkg-config clang libclang-dev llvm-dev wget cmake build-essential
87
119
  # Install LLVM 18 which has the proper libclang.so symlink
88
120
  sudo apt-get install -y llvm-18 llvm-18-dev llvm-18-tools libclang1-18 libclang-cpp18
89
121
  # Set environment variables for LLVM 18
@@ -94,13 +126,51 @@ jobs:
94
126
  ls -la /usr/lib/llvm-18/lib/libclang.so
95
127
  which llvm-config-18
96
128
 
129
+ # Build OpenCV 4.12 from source since Ubuntu 24.04 only has 4.6
130
+ echo "Building OpenCV 4.12 from source..."
131
+ cd /tmp
132
+ wget -q https://github.com/opencv/opencv/archive/4.12.0.tar.gz
133
+ tar -xzf 4.12.0.tar.gz
134
+ cd opencv-4.12.0
135
+ mkdir build
136
+ cd build
137
+ cmake \
138
+ -DCMAKE_BUILD_TYPE=RELEASE \
139
+ -DCMAKE_INSTALL_PREFIX=/usr/local \
140
+ -DWITH_CUDA=OFF \
141
+ -DWITH_OPENGL=OFF \
142
+ -DWITH_OPENCL=OFF \
143
+ -DWITH_TBB=OFF \
144
+ -DWITH_IPP=OFF \
145
+ -DWITH_1394=OFF \
146
+ -DWITH_V4L=OFF \
147
+ -DWITH_GTK=OFF \
148
+ -DBUILD_TESTS=OFF \
149
+ -DBUILD_PERF_TESTS=OFF \
150
+ -DBUILD_EXAMPLES=OFF \
151
+ -DBUILD_opencv_python2=OFF \
152
+ -DBUILD_opencv_python3=OFF \
153
+ -DBUILD_opencv_java=OFF \
154
+ -DOPENCV_GENERATE_PKGCONFIG=ON \
155
+ ..
156
+ make -j$(nproc)
157
+ sudo make install
158
+ sudo ldconfig
159
+
160
+ # Set OpenCV environment variables
161
+ echo "PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH" >> $GITHUB_ENV
162
+ echo "LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV
163
+
97
164
  - name: Set up Python ${{ matrix.python-version }}
98
165
  uses: actions/setup-python@v4
99
166
  with:
100
167
  python-version: ${{ matrix.python-version }}
101
168
 
102
169
  - name: Install Rust toolchain
103
- uses: dtolnay/rust-toolchain@stable
170
+ uses: dtolnay/rust-toolchain@master
171
+ with:
172
+ toolchain: 1.85
173
+ components: rustfmt, clippy
104
174
 
105
175
  - name: Install maturin (Linux/macOS)
106
176
  run: pip install maturin[patchelf]
@@ -136,7 +206,7 @@ jobs:
136
206
  - name: Install OpenCV and LLVM dependencies
137
207
  run: |
138
208
  sudo apt-get update
139
- sudo apt-get install -y pkg-config libopencv-dev clang libclang-dev llvm-dev
209
+ sudo apt-get install -y pkg-config clang libclang-dev llvm-dev wget cmake build-essential
140
210
  # Install LLVM 18 which has the proper libclang.so symlink
141
211
  sudo apt-get install -y llvm-18 llvm-18-dev llvm-18-tools libclang1-18 libclang-cpp18
142
212
  # Set environment variables for LLVM 18
@@ -147,14 +217,50 @@ jobs:
147
217
  ls -la /usr/lib/llvm-18/lib/libclang.so
148
218
  which llvm-config-18
149
219
 
220
+ # Build OpenCV 4.12 from source since Ubuntu 24.04 only has 4.6
221
+ echo "Building OpenCV 4.12 from source..."
222
+ cd /tmp
223
+ wget -q https://github.com/opencv/opencv/archive/4.12.0.tar.gz
224
+ tar -xzf 4.12.0.tar.gz
225
+ cd opencv-4.12.0
226
+ mkdir build
227
+ cd build
228
+ cmake \
229
+ -DCMAKE_BUILD_TYPE=RELEASE \
230
+ -DCMAKE_INSTALL_PREFIX=/usr/local \
231
+ -DWITH_CUDA=OFF \
232
+ -DWITH_OPENGL=OFF \
233
+ -DWITH_OPENCL=OFF \
234
+ -DWITH_TBB=OFF \
235
+ -DWITH_IPP=OFF \
236
+ -DWITH_1394=OFF \
237
+ -DWITH_V4L=OFF \
238
+ -DWITH_GTK=OFF \
239
+ -DBUILD_TESTS=OFF \
240
+ -DBUILD_PERF_TESTS=OFF \
241
+ -DBUILD_EXAMPLES=OFF \
242
+ -DBUILD_opencv_python2=OFF \
243
+ -DBUILD_opencv_python3=OFF \
244
+ -DBUILD_opencv_java=OFF \
245
+ -DOPENCV_GENERATE_PKGCONFIG=ON \
246
+ ..
247
+ make -j$(nproc)
248
+ sudo make install
249
+ sudo ldconfig
250
+
251
+ # Set OpenCV environment variables
252
+ echo "PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH" >> $GITHUB_ENV
253
+ echo "LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV
254
+
150
255
  - name: Set up Python
151
256
  uses: actions/setup-python@v4
152
257
  with:
153
258
  python-version: 3.11
154
259
 
155
260
  - name: Install Rust toolchain
156
- uses: dtolnay/rust-toolchain@stable
261
+ uses: dtolnay/rust-toolchain@master
157
262
  with:
263
+ toolchain: 1.85
158
264
  components: rustfmt, clippy
159
265
 
160
266
  - name: Install cargo-audit
@@ -180,7 +286,7 @@ jobs:
180
286
  if: runner.os == 'Linux'
181
287
  run: |
182
288
  sudo apt-get update
183
- sudo apt-get install -y pkg-config libopencv-dev clang libclang-dev llvm-dev
289
+ sudo apt-get install -y pkg-config clang libclang-dev llvm-dev wget cmake build-essential
184
290
  # Install LLVM 18 which has the proper libclang.so symlink
185
291
  sudo apt-get install -y llvm-18 llvm-18-dev llvm-18-tools libclang1-18 libclang-cpp18
186
292
  # Set environment variables for LLVM 18
@@ -191,6 +297,41 @@ jobs:
191
297
  ls -la /usr/lib/llvm-18/lib/libclang.so
192
298
  which llvm-config-18
193
299
 
300
+ # Build OpenCV 4.12 from source since Ubuntu 24.04 only has 4.6
301
+ echo "Building OpenCV 4.12 from source..."
302
+ cd /tmp
303
+ wget -q https://github.com/opencv/opencv/archive/4.12.0.tar.gz
304
+ tar -xzf 4.12.0.tar.gz
305
+ cd opencv-4.12.0
306
+ mkdir build
307
+ cd build
308
+ cmake \
309
+ -DCMAKE_BUILD_TYPE=RELEASE \
310
+ -DCMAKE_INSTALL_PREFIX=/usr/local \
311
+ -DWITH_CUDA=OFF \
312
+ -DWITH_OPENGL=OFF \
313
+ -DWITH_OPENCL=OFF \
314
+ -DWITH_TBB=OFF \
315
+ -DWITH_IPP=OFF \
316
+ -DWITH_1394=OFF \
317
+ -DWITH_V4L=OFF \
318
+ -DWITH_GTK=OFF \
319
+ -DBUILD_TESTS=OFF \
320
+ -DBUILD_PERF_TESTS=OFF \
321
+ -DBUILD_EXAMPLES=OFF \
322
+ -DBUILD_opencv_python2=OFF \
323
+ -DBUILD_opencv_python3=OFF \
324
+ -DBUILD_opencv_java=OFF \
325
+ -DOPENCV_GENERATE_PKGCONFIG=ON \
326
+ ..
327
+ make -j$(nproc)
328
+ sudo make install
329
+ sudo ldconfig
330
+
331
+ # Set OpenCV environment variables
332
+ echo "PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH" >> $GITHUB_ENV
333
+ echo "LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV
334
+
194
335
 
195
336
 
196
337
  - name: Set up Python
@@ -199,7 +340,9 @@ jobs:
199
340
  python-version: 3.11
200
341
 
201
342
  - name: Install Rust toolchain
202
- uses: dtolnay/rust-toolchain@stable
343
+ uses: dtolnay/rust-toolchain@master
344
+ with:
345
+ toolchain: 1.85
203
346
 
204
347
  - name: Install maturin (Linux/macOS)
205
348
  run: pip install maturin[patchelf]
@@ -8,10 +8,20 @@ on:
8
8
 
9
9
  jobs:
10
10
  linux:
11
- runs-on: ubuntu-latest
11
+ runs-on: ${{ matrix.os }}
12
12
  strategy:
13
13
  matrix:
14
- target: [x86_64]
14
+ include:
15
+ # Ubuntu 22.04 (libc 2.35)
16
+ - os: ubuntu-22.04
17
+ target: x86_64
18
+ manylinux: manylinux_2_35
19
+ python-versions: '["3.11", "3.12"]'
20
+ # Ubuntu 24.04 (libc 2.38)
21
+ - os: ubuntu-24.04
22
+ target: x86_64
23
+ manylinux: manylinux_2_38
24
+ python-versions: '["3.11", "3.12"]'
15
25
  steps:
16
26
  - uses: actions/checkout@v4
17
27
  - uses: actions/setup-python@v5
@@ -23,40 +33,67 @@ jobs:
23
33
  uses: actions/cache@v4
24
34
  with:
25
35
  path: third_party/opencv-static
26
- key: opencv-static-4.12.0-manylinux-linux-${{ runner.os }}-${{ runner.arch }}
36
+ key: opencv-static-4.12.0-no-itt-linux-${{ matrix.os }}-${{ runner.arch }}-${{ matrix.manylinux }}
27
37
 
28
38
  - name: Install build dependencies
29
39
  run: |
40
+ # Completely remove needrestart to eliminate hanging prompts
41
+ sudo apt-get remove -y needrestart || true
42
+ export DEBIAN_FRONTEND=noninteractive
43
+
30
44
  sudo apt-get update
31
- # Install LLVM for opencv-rust bindings codegen (no need for system OpenCV anymore)
32
- sudo apt-get install -y clang libclang-dev llvm-dev cmake curl
33
- sudo apt-get install -y llvm-18 llvm-18-dev llvm-18-tools libclang1-18 libclang-cpp18
34
- # Set environment variables for LLVM 18
35
- echo "LIBCLANG_PATH=/usr/lib/llvm-18/lib" >> $GITHUB_ENV
36
- echo "LLVM_CONFIG_PATH=/usr/bin/llvm-config-18" >> $GITHUB_ENV
37
- echo "LD_LIBRARY_PATH=/usr/lib/llvm-18/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV
45
+ # Install basic LLVM for opencv-rust bindings codegen
46
+ sudo apt-get install -y clang libclang-dev llvm-dev cmake curl wget software-properties-common
47
+
48
+ # For Ubuntu 22.04, use the default LLVM 14 instead of PPA to avoid restart issues
49
+ if [ "${{ matrix.os }}" = "ubuntu-22.04" ]; then
50
+ echo "Using default LLVM 14 for Ubuntu 22.04"
51
+ sudo apt-get install -y llvm-14 llvm-14-dev llvm-14-tools libclang-14-dev
52
+ echo "LLVM_CONFIG_PATH=/usr/bin/llvm-config-14" >> $GITHUB_ENV
53
+ else
54
+ # Ubuntu 24.04 has LLVM 18 by default
55
+ sudo apt-get install -y llvm-18 llvm-18-dev llvm-18-tools libclang1-18 libclang-cpp18
56
+ echo "LLVM_CONFIG_PATH=/usr/bin/llvm-config-18" >> $GITHUB_ENV
57
+ fi
58
+
59
+ # Find the correct libclang.so path and set environment variables (search only LLVM directories)
60
+ if [ "${{ matrix.os }}" = "ubuntu-22.04" ]; then
61
+ LIBCLANG_PATH="/usr/lib/llvm-14/lib"
62
+ else
63
+ LIBCLANG_PATH="/usr/lib/llvm-18/lib"
64
+ fi
65
+
66
+ # Verify the file exists at the expected location
67
+ if [ ! -f "$LIBCLANG_PATH/libclang.so" ]; then
68
+ # Fallback to targeted search if expected location doesn't exist
69
+ LIBCLANG_PATH=$(find /usr/lib/llvm* -name "libclang.so" 2>/dev/null | head -1 | xargs dirname)
70
+ fi
71
+
72
+ echo "LIBCLANG_PATH=$LIBCLANG_PATH" >> $GITHUB_ENV
73
+ echo "LD_LIBRARY_PATH=$LIBCLANG_PATH:$LD_LIBRARY_PATH" >> $GITHUB_ENV
38
74
  # Verify the key files exist
39
- ls -la /usr/lib/llvm-18/lib/libclang.so
40
- which llvm-config-18
75
+ echo "Using libclang.so at: $LIBCLANG_PATH/libclang.so"
76
+ echo "LLVM config at: $(which llvm-config-14 2>/dev/null || which llvm-config-18 2>/dev/null)"
41
77
 
42
78
  - name: Build static OpenCV
43
79
  if: steps.cache-opencv.outputs.cache-hit != 'true'
44
80
  run: |
45
81
  ./scripts/build-opencv-static.sh
46
82
 
47
- - name: Build wheels
83
+ - name: Build wheels for multiple Python versions
48
84
  uses: PyO3/maturin-action@v1
49
85
  with:
50
86
  target: ${{ matrix.target }}
51
- args: --release --out dist --find-interpreter --no-default-features --features python-bindings,simd,opencv
87
+ args: --release --out dist --no-default-features --features python-bindings,simd,opencv
52
88
  sccache: 'false'
53
89
  container: off
90
+ manylinux: ${{ matrix.manylinux }}
54
91
  env:
55
92
  # Use stable ABI for forward compatibility
56
93
  PYO3_USE_ABI3_FORWARD_COMPATIBILITY: '1'
57
94
  # LLVM for opencv-rust bindings (from earlier install step)
58
- LIBCLANG_PATH: /usr/lib/llvm-18/lib
59
- LLVM_CONFIG_PATH: /usr/bin/llvm-config-18
95
+ LIBCLANG_PATH: ${{ env.LIBCLANG_PATH }}
96
+ LLVM_CONFIG_PATH: ${{ env.LLVM_CONFIG_PATH }}
60
97
  # OpenCV static linking configuration
61
98
  OPENCV_INCLUDE_PATHS: ${{ github.workspace }}/third_party/opencv-static/include/opencv4
62
99
  OPENCV_LINK_PATHS: ${{ github.workspace }}/third_party/opencv-static/lib
@@ -66,7 +103,7 @@ jobs:
66
103
  - name: Upload wheels
67
104
  uses: actions/upload-artifact@v4
68
105
  with:
69
- name: wheels-linux-${{ matrix.target }}
106
+ name: wheels-linux-${{ matrix.os }}-${{ matrix.target }}
70
107
  path: dist
71
108
 
72
109
 
@@ -86,7 +123,7 @@ jobs:
86
123
  uses: actions/cache@v4
87
124
  with:
88
125
  path: third_party/opencv-static
89
- key: opencv-static-4.12.0-v2-macos-${{ runner.os }}-${{ runner.arch }}
126
+ key: opencv-static-4.12.0-no-itt-macos-${{ runner.os }}-${{ runner.arch }}
90
127
 
91
128
  - name: Install build dependencies
92
129
  run: |
@@ -147,6 +184,17 @@ jobs:
147
184
  pattern: wheels-*
148
185
  merge-multiple: true
149
186
  path: dist
187
+ - name: List built wheels
188
+ run: |
189
+ echo "Built wheels:"
190
+ ls -la dist/
191
+ echo "Wheel information:"
192
+ for wheel in dist/*.whl; do
193
+ if [ -f "$wheel" ]; then
194
+ echo "Checking $wheel:"
195
+ python -c "import zipfile; print(zipfile.ZipFile('$wheel').namelist()[:3])" || echo " Could not read wheel contents"
196
+ fi
197
+ done
150
198
  - name: Publish to PyPI
151
199
  uses: pypa/gh-action-pypi-publish@v1.12.4
152
200
  with:
@@ -1703,7 +1703,7 @@ dependencies = [
1703
1703
 
1704
1704
  [[package]]
1705
1705
  name = "trainingsample"
1706
- version = "0.2.2"
1706
+ version = "0.2.4"
1707
1707
  dependencies = [
1708
1708
  "anyhow",
1709
1709
  "criterion",
@@ -37,7 +37,7 @@ description = "High-performance Rust reimplementation of GIL-blocking video/imag
37
37
  edition = "2021"
38
38
  license = "MIT"
39
39
  name = "trainingsample"
40
- version = "0.2.2"
40
+ version = "0.2.4"
41
41
  readme = "README.md"
42
42
 
43
43
  [profile.release]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: trainingsample
3
- Version: 0.2.2
3
+ Version: 0.2.4
4
4
  Classifier: Programming Language :: Rust
5
5
  Classifier: Programming Language :: Python :: Implementation :: CPython
6
6
  Classifier: Programming Language :: Python :: Implementation :: PyPy
@@ -14,7 +14,7 @@ description = "High-performance Rust reimplementation of GIL-blocking video/imag
14
14
  license = {text = "MIT"}
15
15
  name = "trainingsample"
16
16
  requires-python = ">=3.11"
17
- version = "0.2.2"
17
+ version = "0.2.4"
18
18
 
19
19
  [project.optional-dependencies]
20
20
  dev = ["pytest>=6.0", "pytest-benchmark", "maturin>=1.0,<2.0", "pre-commit"]
@@ -0,0 +1,4 @@
1
+ [toolchain]
2
+ channel = "1.85"
3
+ components = ["rustfmt", "clippy"]
4
+ profile = "minimal"
@@ -52,6 +52,7 @@ cmake -S "opencv-${OPENCV_VERSION}" \
52
52
  -DWITH_V4L=OFF \
53
53
  -DWITH_GTK=OFF \
54
54
  -DWITH_QT=OFF \
55
+ -DWITH_ITT=OFF \
55
56
  -DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}"
56
57
 
57
58
  # Build opencv_world (single unified library)
@@ -3,7 +3,7 @@ use ndarray::{Array3, ArrayView3};
3
3
 
4
4
  #[cfg(feature = "opencv")]
5
5
  use opencv::{
6
- core::Mat,
6
+ core::{AlgorithmHint, Mat},
7
7
  imgproc::{cvt_color, resize, COLOR_RGB2GRAY, INTER_LANCZOS4},
8
8
  prelude::*,
9
9
  };
@@ -169,23 +169,12 @@ impl OpenCVBatchProcessor {
169
169
 
170
170
  // Convert to grayscale using OpenCV's optimized implementation
171
171
  let mut gray_mat = Mat::default();
172
- // Different OpenCV versions have different cvt_color signatures
173
- #[cfg(target_os = "macos")]
174
172
  cvt_color(
175
173
  &src_mat,
176
174
  &mut gray_mat,
177
175
  COLOR_RGB2GRAY,
178
176
  0,
179
- opencv::core::AlgorithmHint::ALGO_HINT_DEFAULT,
180
- )?;
181
-
182
- #[cfg(not(target_os = "macos"))]
183
- cvt_color(
184
- &src_mat,
185
- &mut gray_mat,
186
- COLOR_RGB2GRAY,
187
- 0,
188
- opencv::core::AlgorithmHint::ALGO_HINT_DEFAULT,
177
+ AlgorithmHint::ALGO_HINT_ACCURATE,
189
178
  )?;
190
179
 
191
180
  // Calculate mean (luminance)
@@ -4,7 +4,7 @@ use rayon::prelude::*;
4
4
 
5
5
  #[cfg(feature = "opencv")]
6
6
  use opencv::{
7
- core::Mat,
7
+ core::{AlgorithmHint, Mat},
8
8
  imgproc::{resize, INTER_CUBIC, INTER_LANCZOS4, INTER_LINEAR, INTER_NEAREST},
9
9
  prelude::*,
10
10
  };
@@ -273,21 +273,12 @@ impl TrueBatchProcessor {
273
273
  };
274
274
 
275
275
  // OpenCV writes directly into our result array!
276
- #[cfg(target_os = "macos")]
277
276
  cvt_color(
278
277
  &src_mats[i],
279
278
  &mut dst_mat,
280
279
  opencv_code,
281
280
  0,
282
- opencv::core::AlgorithmHint::ALGO_HINT_DEFAULT,
283
- )?;
284
- #[cfg(not(target_os = "macos"))]
285
- cvt_color(
286
- &src_mats[i],
287
- &mut dst_mat,
288
- opencv_code,
289
- 0,
290
- opencv::core::AlgorithmHint::ALGO_HINT_DEFAULT,
281
+ AlgorithmHint::ALGO_HINT_ACCURATE,
291
282
  )?;
292
283
 
293
284
  results.push(result);
File without changes
File without changes
File without changes