trainingsample 0.2.14__tar.gz → 0.2.16__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.
- {trainingsample-0.2.14 → trainingsample-0.2.16}/.github/workflows/ci.yml +80 -1
- {trainingsample-0.2.14 → trainingsample-0.2.16}/.github/workflows/publish.yml +109 -2
- {trainingsample-0.2.14 → trainingsample-0.2.16}/Cargo.lock +3 -3
- {trainingsample-0.2.14 → trainingsample-0.2.16}/Cargo.toml +1 -1
- {trainingsample-0.2.14 → trainingsample-0.2.16}/PKG-INFO +1 -1
- {trainingsample-0.2.14 → trainingsample-0.2.16}/pyproject.toml +1 -1
- {trainingsample-0.2.14 → trainingsample-0.2.16}/scripts/build-opencv-static.sh +4 -2
- {trainingsample-0.2.14 → trainingsample-0.2.16}/.cargo/config.toml +0 -0
- {trainingsample-0.2.14 → trainingsample-0.2.16}/.envrc +0 -0
- {trainingsample-0.2.14 → trainingsample-0.2.16}/.gitignore +0 -0
- {trainingsample-0.2.14 → trainingsample-0.2.16}/.pre-commit-config.yaml +0 -0
- {trainingsample-0.2.14 → trainingsample-0.2.16}/.rustfmt.toml +0 -0
- {trainingsample-0.2.14 → trainingsample-0.2.16}/BENCHMARKS.md +0 -0
- {trainingsample-0.2.14 → trainingsample-0.2.16}/Dockerfile +0 -0
- {trainingsample-0.2.14 → trainingsample-0.2.16}/LICENSE +0 -0
- {trainingsample-0.2.14 → trainingsample-0.2.16}/README.md +0 -0
- {trainingsample-0.2.14 → trainingsample-0.2.16}/clippy.toml +0 -0
- {trainingsample-0.2.14 → trainingsample-0.2.16}/docs/API_COMPAT_CV2.md +0 -0
- {trainingsample-0.2.14 → trainingsample-0.2.16}/docs/BUILDING_STATIC_OPENCV.md +0 -0
- {trainingsample-0.2.14 → trainingsample-0.2.16}/rust-toolchain.toml +0 -0
- {trainingsample-0.2.14 → trainingsample-0.2.16}/scripts/repair-wheel.sh +0 -0
- {trainingsample-0.2.14 → trainingsample-0.2.16}/scripts/run_competitive_benchmarks.sh +0 -0
- {trainingsample-0.2.14 → trainingsample-0.2.16}/setup-env.sh +0 -0
- {trainingsample-0.2.14 → trainingsample-0.2.16}/src/core.rs +0 -0
- {trainingsample-0.2.14 → trainingsample-0.2.16}/src/cropping.rs +0 -0
- {trainingsample-0.2.14 → trainingsample-0.2.16}/src/cv_batch_ops.rs +0 -0
- {trainingsample-0.2.14 → trainingsample-0.2.16}/src/cv_batch_ops_optimized.rs +0 -0
- {trainingsample-0.2.14 → trainingsample-0.2.16}/src/cv_compat.rs +0 -0
- {trainingsample-0.2.14 → trainingsample-0.2.16}/src/format_conversion_simd.rs +0 -0
- {trainingsample-0.2.14 → trainingsample-0.2.16}/src/lib.rs +0 -0
- {trainingsample-0.2.14 → trainingsample-0.2.16}/src/loading.rs +0 -0
- {trainingsample-0.2.14 → trainingsample-0.2.16}/src/luminance.rs +0 -0
- {trainingsample-0.2.14 → trainingsample-0.2.16}/src/luminance_simd.rs +0 -0
- {trainingsample-0.2.14 → trainingsample-0.2.16}/src/opencv_ops.rs +0 -0
- {trainingsample-0.2.14 → trainingsample-0.2.16}/src/python_bindings.rs +0 -0
- {trainingsample-0.2.14 → trainingsample-0.2.16}/src/tests.rs +0 -0
- {trainingsample-0.2.14 → trainingsample-0.2.16}/src/true_batch_ops.rs +0 -0
- {trainingsample-0.2.14 → trainingsample-0.2.16}/tests/__init__.py +0 -0
- {trainingsample-0.2.14 → trainingsample-0.2.16}/tests/comprehensive_tests.rs +0 -0
- {trainingsample-0.2.14 → trainingsample-0.2.16}/tests/test_comprehensive.py +0 -0
- {trainingsample-0.2.14 → trainingsample-0.2.16}/tests/test_performance_benchmarks.py +0 -0
- {trainingsample-0.2.14 → trainingsample-0.2.16}/tests/test_python_bindings.py +0 -0
|
@@ -2,9 +2,10 @@ name: CI
|
|
|
2
2
|
|
|
3
3
|
on:
|
|
4
4
|
push:
|
|
5
|
-
branches: [ main, develop ]
|
|
5
|
+
branches: [ main, develop, 'build/*' ]
|
|
6
6
|
pull_request:
|
|
7
7
|
branches: [ main ]
|
|
8
|
+
workflow_dispatch:
|
|
8
9
|
|
|
9
10
|
env:
|
|
10
11
|
CARGO_TERM_COLOR: always
|
|
@@ -375,3 +376,81 @@ jobs:
|
|
|
375
376
|
with:
|
|
376
377
|
name: wheels-${{ matrix.os }}
|
|
377
378
|
path: dist/
|
|
379
|
+
|
|
380
|
+
build-wheels-aarch64:
|
|
381
|
+
name: Build wheels (Linux aarch64)
|
|
382
|
+
runs-on: ubuntu-24.04-arm
|
|
383
|
+
strategy:
|
|
384
|
+
matrix:
|
|
385
|
+
python-version: ["3.11", "3.12", "3.13"]
|
|
386
|
+
|
|
387
|
+
steps:
|
|
388
|
+
- uses: actions/checkout@v4
|
|
389
|
+
|
|
390
|
+
- name: Install OpenCV and LLVM dependencies
|
|
391
|
+
run: |
|
|
392
|
+
sudo apt-get update
|
|
393
|
+
sudo apt-get install -y pkg-config clang libclang-dev llvm-dev wget cmake build-essential
|
|
394
|
+
# Install LLVM 18 which has the proper libclang.so symlink
|
|
395
|
+
sudo apt-get install -y llvm-18 llvm-18-dev llvm-18-tools libclang1-18 libclang-cpp18
|
|
396
|
+
# Set environment variables for LLVM 18
|
|
397
|
+
echo "LIBCLANG_PATH=/usr/lib/llvm-18/lib" >> $GITHUB_ENV
|
|
398
|
+
echo "LLVM_CONFIG_PATH=/usr/bin/llvm-config-18" >> $GITHUB_ENV
|
|
399
|
+
echo "LD_LIBRARY_PATH=/usr/lib/llvm-18/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV
|
|
400
|
+
|
|
401
|
+
# Build OpenCV 4.12 from source
|
|
402
|
+
echo "Building OpenCV 4.12 from source..."
|
|
403
|
+
cd /tmp
|
|
404
|
+
wget -q https://github.com/opencv/opencv/archive/4.12.0.tar.gz
|
|
405
|
+
tar -xzf 4.12.0.tar.gz
|
|
406
|
+
cd opencv-4.12.0
|
|
407
|
+
mkdir build
|
|
408
|
+
cd build
|
|
409
|
+
cmake \
|
|
410
|
+
-DCMAKE_BUILD_TYPE=RELEASE \
|
|
411
|
+
-DCMAKE_INSTALL_PREFIX=/usr/local \
|
|
412
|
+
-DWITH_CUDA=OFF \
|
|
413
|
+
-DWITH_OPENGL=OFF \
|
|
414
|
+
-DWITH_OPENCL=OFF \
|
|
415
|
+
-DWITH_TBB=OFF \
|
|
416
|
+
-DWITH_IPP=OFF \
|
|
417
|
+
-DWITH_1394=OFF \
|
|
418
|
+
-DWITH_V4L=OFF \
|
|
419
|
+
-DWITH_GTK=OFF \
|
|
420
|
+
-DBUILD_TESTS=OFF \
|
|
421
|
+
-DBUILD_PERF_TESTS=OFF \
|
|
422
|
+
-DBUILD_EXAMPLES=OFF \
|
|
423
|
+
-DBUILD_opencv_python2=OFF \
|
|
424
|
+
-DBUILD_opencv_python3=OFF \
|
|
425
|
+
-DBUILD_opencv_java=OFF \
|
|
426
|
+
-DOPENCV_GENERATE_PKGCONFIG=ON \
|
|
427
|
+
..
|
|
428
|
+
make -j$(nproc)
|
|
429
|
+
sudo make install
|
|
430
|
+
sudo ldconfig
|
|
431
|
+
|
|
432
|
+
# Set OpenCV environment variables
|
|
433
|
+
echo "PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH" >> $GITHUB_ENV
|
|
434
|
+
echo "LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV
|
|
435
|
+
|
|
436
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
437
|
+
uses: actions/setup-python@v4
|
|
438
|
+
with:
|
|
439
|
+
python-version: ${{ matrix.python-version }}
|
|
440
|
+
|
|
441
|
+
- name: Install Rust toolchain
|
|
442
|
+
uses: dtolnay/rust-toolchain@master
|
|
443
|
+
with:
|
|
444
|
+
toolchain: 1.89
|
|
445
|
+
|
|
446
|
+
- name: Install maturin
|
|
447
|
+
run: pip install maturin[patchelf]
|
|
448
|
+
|
|
449
|
+
- name: Build wheels
|
|
450
|
+
run: maturin build --release --out dist --no-default-features --features python-bindings,simd,opencv
|
|
451
|
+
|
|
452
|
+
- name: Upload wheels
|
|
453
|
+
uses: actions/upload-artifact@v4
|
|
454
|
+
with:
|
|
455
|
+
name: wheels-linux-aarch64-py${{ matrix.python-version }}
|
|
456
|
+
path: dist/
|
|
@@ -131,6 +131,87 @@ jobs:
|
|
|
131
131
|
path: dist
|
|
132
132
|
|
|
133
133
|
|
|
134
|
+
linux-aarch64:
|
|
135
|
+
runs-on: ubuntu-24.04-arm
|
|
136
|
+
strategy:
|
|
137
|
+
matrix:
|
|
138
|
+
python: ['3.11', '3.12', '3.13']
|
|
139
|
+
steps:
|
|
140
|
+
- uses: actions/checkout@v4
|
|
141
|
+
- uses: actions/setup-python@v5
|
|
142
|
+
with:
|
|
143
|
+
python-version: ${{ matrix.python }}
|
|
144
|
+
|
|
145
|
+
- name: Cache static OpenCV
|
|
146
|
+
id: cache-opencv
|
|
147
|
+
uses: actions/cache@v4
|
|
148
|
+
with:
|
|
149
|
+
path: third_party/opencv-static
|
|
150
|
+
key: opencv-static-4.12.0-codecs-jasper-ffmpeg-no-itt-no-openjpeg-linux-aarch64-${{ runner.arch }}-manylinux_2_39
|
|
151
|
+
|
|
152
|
+
- name: Install build dependencies
|
|
153
|
+
run: |
|
|
154
|
+
export DEBIAN_FRONTEND=noninteractive
|
|
155
|
+
|
|
156
|
+
sudo apt-get update
|
|
157
|
+
# Install basic LLVM for opencv-rust bindings codegen
|
|
158
|
+
sudo apt-get install -y clang libclang-dev llvm-dev cmake curl wget nasm yasm pkg-config
|
|
159
|
+
|
|
160
|
+
# 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
|
|
162
|
+
echo "LLVM_CONFIG_PATH=/usr/bin/llvm-config-18" >> $GITHUB_ENV
|
|
163
|
+
|
|
164
|
+
LIBCLANG_PATH="/usr/lib/llvm-18/lib"
|
|
165
|
+
|
|
166
|
+
# Verify the file exists at the expected location
|
|
167
|
+
if [ ! -f "$LIBCLANG_PATH/libclang.so" ]; then
|
|
168
|
+
# Fallback to targeted search if expected location doesn't exist
|
|
169
|
+
LIBCLANG_PATH=$(find /usr/lib/llvm* -name "libclang.so" 2>/dev/null | head -1 | xargs dirname)
|
|
170
|
+
fi
|
|
171
|
+
|
|
172
|
+
echo "LIBCLANG_PATH=$LIBCLANG_PATH" >> $GITHUB_ENV
|
|
173
|
+
echo "LD_LIBRARY_PATH=$LIBCLANG_PATH:$LD_LIBRARY_PATH" >> $GITHUB_ENV
|
|
174
|
+
echo "Using libclang.so at: $LIBCLANG_PATH/libclang.so"
|
|
175
|
+
|
|
176
|
+
- name: Build static OpenCV
|
|
177
|
+
run: |
|
|
178
|
+
./scripts/build-opencv-static.sh
|
|
179
|
+
|
|
180
|
+
- name: Build wheels
|
|
181
|
+
uses: PyO3/maturin-action@v1
|
|
182
|
+
with:
|
|
183
|
+
target: aarch64
|
|
184
|
+
args: --release --out dist --no-default-features --features python-bindings,simd,opencv
|
|
185
|
+
sccache: 'false'
|
|
186
|
+
container: off
|
|
187
|
+
manylinux: manylinux_2_39
|
|
188
|
+
env:
|
|
189
|
+
# Use stable ABI for forward compatibility
|
|
190
|
+
PYO3_USE_ABI3_FORWARD_COMPATIBILITY: '1'
|
|
191
|
+
# LLVM for opencv-rust bindings (from earlier install step)
|
|
192
|
+
LIBCLANG_PATH: ${{ env.LIBCLANG_PATH }}
|
|
193
|
+
LLVM_CONFIG_PATH: ${{ env.LLVM_CONFIG_PATH }}
|
|
194
|
+
# OpenCV static linking configuration
|
|
195
|
+
OPENCV_INCLUDE_PATHS: ${{ github.workspace }}/third_party/opencv-static/include/opencv4
|
|
196
|
+
OPENCV_LINK_PATHS: ${{ github.workspace }}/third_party/opencv-static/lib
|
|
197
|
+
OPENCV_LINK_LIBS: static=opencv_world,static=avformat,static=avcodec,static=avfilter,static=swresample,static=swscale,static=avutil,static=jpeg,static=png,static=tiff,static=webp,static=z,static=jasper,static=stdc++
|
|
198
|
+
OPENCV_DISABLE_PROBES: pkg_config,cmake,vcpkg,vcpkg_cmake
|
|
199
|
+
|
|
200
|
+
- name: Repair wheels
|
|
201
|
+
env:
|
|
202
|
+
OPENCV_LINK_PATHS: ${{ github.workspace }}/third_party/opencv-static/lib
|
|
203
|
+
run: |
|
|
204
|
+
./scripts/repair-wheel.sh dist/*.whl
|
|
205
|
+
- name: Prune unrepaired wheels
|
|
206
|
+
run: |
|
|
207
|
+
find dist -type f -name '*.linux_*.whl' -print -delete
|
|
208
|
+
|
|
209
|
+
- name: Upload wheels
|
|
210
|
+
uses: actions/upload-artifact@v4
|
|
211
|
+
with:
|
|
212
|
+
name: wheels-linux-aarch64-py${{ matrix.python }}
|
|
213
|
+
path: dist
|
|
214
|
+
|
|
134
215
|
macos:
|
|
135
216
|
runs-on: macos-latest
|
|
136
217
|
strategy:
|
|
@@ -205,7 +286,7 @@ jobs:
|
|
|
205
286
|
|
|
206
287
|
smoketest:
|
|
207
288
|
runs-on: ${{ matrix.os }}
|
|
208
|
-
needs: [linux, macos]
|
|
289
|
+
needs: [linux, linux-aarch64, macos]
|
|
209
290
|
strategy:
|
|
210
291
|
matrix:
|
|
211
292
|
include:
|
|
@@ -214,43 +295,69 @@ jobs:
|
|
|
214
295
|
target: x86_64
|
|
215
296
|
manylinux: manylinux_2_35
|
|
216
297
|
python: '3.11'
|
|
298
|
+
artifact_name: wheels-ubuntu-22.04-x86_64-py3.11
|
|
217
299
|
- os: ubuntu-22.04
|
|
218
300
|
target: x86_64
|
|
219
301
|
manylinux: manylinux_2_35
|
|
220
302
|
python: '3.12'
|
|
303
|
+
artifact_name: wheels-ubuntu-22.04-x86_64-py3.12
|
|
221
304
|
- os: ubuntu-22.04
|
|
222
305
|
target: x86_64
|
|
223
306
|
manylinux: manylinux_2_35
|
|
224
307
|
python: '3.13'
|
|
308
|
+
artifact_name: wheels-ubuntu-22.04-x86_64-py3.13
|
|
225
309
|
# Ubuntu 24.04 (libc 2.39)
|
|
226
310
|
- os: ubuntu-24.04
|
|
227
311
|
target: x86_64
|
|
228
312
|
manylinux: manylinux_2_39
|
|
229
313
|
python: '3.11'
|
|
314
|
+
artifact_name: wheels-ubuntu-24.04-x86_64-py3.11
|
|
230
315
|
- os: ubuntu-24.04
|
|
231
316
|
target: x86_64
|
|
232
317
|
manylinux: manylinux_2_39
|
|
233
318
|
python: '3.12'
|
|
319
|
+
artifact_name: wheels-ubuntu-24.04-x86_64-py3.12
|
|
234
320
|
- os: ubuntu-24.04
|
|
235
321
|
target: x86_64
|
|
236
322
|
manylinux: manylinux_2_39
|
|
237
323
|
python: '3.13'
|
|
324
|
+
artifact_name: wheels-ubuntu-24.04-x86_64-py3.13
|
|
325
|
+
# Linux aarch64 (DGX Spark / GB10)
|
|
326
|
+
- os: ubuntu-24.04-arm
|
|
327
|
+
target: aarch64
|
|
328
|
+
manylinux: manylinux_2_39
|
|
329
|
+
python: '3.11'
|
|
330
|
+
artifact_name: wheels-linux-aarch64-py3.11
|
|
331
|
+
- os: ubuntu-24.04-arm
|
|
332
|
+
target: aarch64
|
|
333
|
+
manylinux: manylinux_2_39
|
|
334
|
+
python: '3.12'
|
|
335
|
+
artifact_name: wheels-linux-aarch64-py3.12
|
|
336
|
+
- os: ubuntu-24.04-arm
|
|
337
|
+
target: aarch64
|
|
338
|
+
manylinux: manylinux_2_39
|
|
339
|
+
python: '3.13'
|
|
340
|
+
artifact_name: wheels-linux-aarch64-py3.13
|
|
341
|
+
# macOS aarch64
|
|
238
342
|
- os: macos-latest
|
|
239
343
|
target: aarch64
|
|
240
344
|
manylinux: ''
|
|
241
345
|
python: '3.11'
|
|
346
|
+
artifact_name: wheels-macos-latest-aarch64-py3.11
|
|
242
347
|
- os: macos-latest
|
|
243
348
|
target: aarch64
|
|
244
349
|
manylinux: ''
|
|
245
350
|
python: '3.12'
|
|
351
|
+
artifact_name: wheels-macos-latest-aarch64-py3.12
|
|
246
352
|
- os: macos-latest
|
|
247
353
|
target: aarch64
|
|
248
354
|
manylinux: ''
|
|
249
355
|
python: '3.13'
|
|
356
|
+
artifact_name: wheels-macos-latest-aarch64-py3.13
|
|
250
357
|
steps:
|
|
251
358
|
- uses: actions/download-artifact@v4
|
|
252
359
|
with:
|
|
253
|
-
pattern:
|
|
360
|
+
pattern: ${{ matrix.artifact_name }}
|
|
254
361
|
path: dist
|
|
255
362
|
- uses: actions/setup-python@v5
|
|
256
363
|
with:
|
|
@@ -1748,7 +1748,7 @@ dependencies = [
|
|
|
1748
1748
|
|
|
1749
1749
|
[[package]]
|
|
1750
1750
|
name = "trainingsample"
|
|
1751
|
-
version = "0.2.
|
|
1751
|
+
version = "0.2.16"
|
|
1752
1752
|
dependencies = [
|
|
1753
1753
|
"anyhow",
|
|
1754
1754
|
"criterion",
|
|
@@ -2096,9 +2096,9 @@ dependencies = [
|
|
|
2096
2096
|
|
|
2097
2097
|
[[package]]
|
|
2098
2098
|
name = "zmij"
|
|
2099
|
-
version = "1.0.
|
|
2099
|
+
version = "1.0.16"
|
|
2100
2100
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
2101
|
-
checksum = "
|
|
2101
|
+
checksum = "dfcd145825aace48cff44a8844de64bf75feec3080e0aa5cdbde72961ae51a65"
|
|
2102
2102
|
|
|
2103
2103
|
[[package]]
|
|
2104
2104
|
name = "zune-core"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: trainingsample
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.16
|
|
4
4
|
Classifier: Programming Language :: Rust
|
|
5
5
|
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
6
6
|
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
@@ -17,7 +17,7 @@ description = "High-performance Rust reimplementation of GIL-blocking video/imag
|
|
|
17
17
|
license = {text = "MIT"}
|
|
18
18
|
name = "trainingsample"
|
|
19
19
|
requires-python = ">=3.11"
|
|
20
|
-
version = "0.2.
|
|
20
|
+
version = "0.2.16"
|
|
21
21
|
|
|
22
22
|
[project.optional-dependencies]
|
|
23
23
|
dev = ["pytest>=6.0", "pytest-benchmark", "maturin>=1.0,<2.0", "pre-commit"]
|
|
@@ -179,8 +179,10 @@ CMAKE_ARGS=(
|
|
|
179
179
|
-DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}"
|
|
180
180
|
)
|
|
181
181
|
|
|
182
|
-
|
|
183
|
-
|
|
182
|
+
# Disable Carotene (ARM NEON optimizations) to avoid undefined symbol errors
|
|
183
|
+
# when statically linking. Carotene requires runtime library that isn't bundled.
|
|
184
|
+
if [[ "$(uname)" == "Darwin" ]] || [[ "$(uname -m)" == "aarch64" ]] || [[ "$(uname -m)" == "arm64" ]]; then
|
|
185
|
+
echo "Detected ARM host; disabling Carotene to avoid linking issue."
|
|
184
186
|
CMAKE_ARGS+=(
|
|
185
187
|
-DWITH_CAROTENE=OFF
|
|
186
188
|
)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|