trainingsample 0.2.0__tar.gz → 0.2.2__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.2/.cargo/config.toml +7 -0
- {trainingsample-0.2.0 → trainingsample-0.2.2}/.github/workflows/publish.yml +48 -14
- {trainingsample-0.2.0 → trainingsample-0.2.2}/.gitignore +4 -0
- {trainingsample-0.2.0 → trainingsample-0.2.2}/Cargo.lock +403 -71
- {trainingsample-0.2.0 → trainingsample-0.2.2}/Cargo.toml +4 -1
- {trainingsample-0.2.0 → trainingsample-0.2.2}/PKG-INFO +1 -1
- {trainingsample-0.2.0 → trainingsample-0.2.2}/README.md +80 -52
- trainingsample-0.2.2/docs/API_COMPAT_CV2.md +336 -0
- trainingsample-0.2.2/docs/BUILDING_STATIC_OPENCV.md +103 -0
- {trainingsample-0.2.0 → trainingsample-0.2.2}/pyproject.toml +2 -2
- trainingsample-0.2.2/scripts/build-opencv-static.sh +88 -0
- trainingsample-0.2.2/src/cv_batch_ops.rs +462 -0
- trainingsample-0.2.2/src/cv_batch_ops_optimized.rs +402 -0
- trainingsample-0.2.2/src/cv_compat.rs +625 -0
- trainingsample-0.2.2/src/lib.rs +142 -0
- trainingsample-0.2.2/src/luminance.rs +317 -0
- {trainingsample-0.2.0 → trainingsample-0.2.2}/src/opencv_ops.rs +7 -1
- trainingsample-0.2.2/src/python_bindings.rs +1839 -0
- trainingsample-0.2.2/src/true_batch_ops.rs +421 -0
- trainingsample-0.2.0/src/lib.rs +0 -70
- trainingsample-0.2.0/src/luminance.rs +0 -150
- trainingsample-0.2.0/src/python_bindings.rs +0 -363
- {trainingsample-0.2.0 → trainingsample-0.2.2}/.envrc +0 -0
- {trainingsample-0.2.0 → trainingsample-0.2.2}/.github/workflows/ci.yml +0 -0
- {trainingsample-0.2.0 → trainingsample-0.2.2}/.pre-commit-config.yaml +0 -0
- {trainingsample-0.2.0 → trainingsample-0.2.2}/.rustfmt.toml +0 -0
- {trainingsample-0.2.0 → trainingsample-0.2.2}/BENCHMARKS.md +0 -0
- {trainingsample-0.2.0 → trainingsample-0.2.2}/LICENSE +0 -0
- {trainingsample-0.2.0 → trainingsample-0.2.2}/clippy.toml +0 -0
- {trainingsample-0.2.0 → trainingsample-0.2.2}/scripts/run_competitive_benchmarks.sh +0 -0
- {trainingsample-0.2.0 → trainingsample-0.2.2}/setup-env.sh +0 -0
- {trainingsample-0.2.0 → trainingsample-0.2.2}/src/core.rs +0 -0
- {trainingsample-0.2.0 → trainingsample-0.2.2}/src/cropping.rs +0 -0
- {trainingsample-0.2.0 → trainingsample-0.2.2}/src/format_conversion_simd.rs +0 -0
- {trainingsample-0.2.0 → trainingsample-0.2.2}/src/loading.rs +0 -0
- {trainingsample-0.2.0 → trainingsample-0.2.2}/src/luminance_simd.rs +0 -0
- {trainingsample-0.2.0 → trainingsample-0.2.2}/src/tests.rs +0 -0
- {trainingsample-0.2.0 → trainingsample-0.2.2}/tests/__init__.py +0 -0
- {trainingsample-0.2.0 → trainingsample-0.2.2}/tests/comprehensive_tests.rs +0 -0
- {trainingsample-0.2.0 → trainingsample-0.2.2}/tests/test_comprehensive.py +0 -0
- {trainingsample-0.2.0 → trainingsample-0.2.2}/tests/test_performance_benchmarks.py +0 -0
- {trainingsample-0.2.0 → trainingsample-0.2.2}/tests/test_python_bindings.py +0 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# Cargo configuration for OpenCV linking
|
|
2
|
+
#
|
|
3
|
+
# Default: Uses system OpenCV (for CI and local development)
|
|
4
|
+
# Release builds: Override with static linking via workflow env vars
|
|
5
|
+
|
|
6
|
+
# This file is intentionally minimal - it lets opencv-rust probe the system.
|
|
7
|
+
# The release workflow sets OPENCV_* env vars to force static linking.
|
|
@@ -4,6 +4,7 @@ on:
|
|
|
4
4
|
push:
|
|
5
5
|
tags:
|
|
6
6
|
- 'v*'
|
|
7
|
+
workflow_dispatch:
|
|
7
8
|
|
|
8
9
|
jobs:
|
|
9
10
|
linux:
|
|
@@ -17,11 +18,18 @@ jobs:
|
|
|
17
18
|
with:
|
|
18
19
|
python-version: '3.11'
|
|
19
20
|
|
|
20
|
-
- name:
|
|
21
|
+
- name: Cache static OpenCV
|
|
22
|
+
id: cache-opencv
|
|
23
|
+
uses: actions/cache@v4
|
|
24
|
+
with:
|
|
25
|
+
path: third_party/opencv-static
|
|
26
|
+
key: opencv-static-4.12.0-manylinux-linux-${{ runner.os }}-${{ runner.arch }}
|
|
27
|
+
|
|
28
|
+
- name: Install build dependencies
|
|
21
29
|
run: |
|
|
22
30
|
sudo apt-get update
|
|
23
|
-
|
|
24
|
-
|
|
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
|
|
25
33
|
sudo apt-get install -y llvm-18 llvm-18-dev llvm-18-tools libclang1-18 libclang-cpp18
|
|
26
34
|
# Set environment variables for LLVM 18
|
|
27
35
|
echo "LIBCLANG_PATH=/usr/lib/llvm-18/lib" >> $GITHUB_ENV
|
|
@@ -31,16 +39,29 @@ jobs:
|
|
|
31
39
|
ls -la /usr/lib/llvm-18/lib/libclang.so
|
|
32
40
|
which llvm-config-18
|
|
33
41
|
|
|
42
|
+
- name: Build static OpenCV
|
|
43
|
+
if: steps.cache-opencv.outputs.cache-hit != 'true'
|
|
44
|
+
run: |
|
|
45
|
+
./scripts/build-opencv-static.sh
|
|
46
|
+
|
|
34
47
|
- name: Build wheels
|
|
35
48
|
uses: PyO3/maturin-action@v1
|
|
36
49
|
with:
|
|
37
50
|
target: ${{ matrix.target }}
|
|
38
|
-
args: --release --out dist --find-interpreter --
|
|
39
|
-
sccache: '
|
|
40
|
-
|
|
51
|
+
args: --release --out dist --find-interpreter --no-default-features --features python-bindings,simd,opencv
|
|
52
|
+
sccache: 'false'
|
|
53
|
+
container: off
|
|
41
54
|
env:
|
|
42
55
|
# Use stable ABI for forward compatibility
|
|
43
56
|
PYO3_USE_ABI3_FORWARD_COMPATIBILITY: '1'
|
|
57
|
+
# 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
|
|
60
|
+
# OpenCV static linking configuration
|
|
61
|
+
OPENCV_INCLUDE_PATHS: ${{ github.workspace }}/third_party/opencv-static/include/opencv4
|
|
62
|
+
OPENCV_LINK_PATHS: ${{ github.workspace }}/third_party/opencv-static/lib
|
|
63
|
+
OPENCV_LINK_LIBS: static=opencv_world,static=stdc++
|
|
64
|
+
OPENCV_DISABLE_PROBES: pkg_config,cmake,vcpkg,vcpkg_cmake
|
|
44
65
|
|
|
45
66
|
- name: Upload wheels
|
|
46
67
|
uses: actions/upload-artifact@v4
|
|
@@ -60,28 +81,41 @@ jobs:
|
|
|
60
81
|
with:
|
|
61
82
|
python-version: '3.11'
|
|
62
83
|
|
|
63
|
-
- name:
|
|
84
|
+
- name: Cache static OpenCV
|
|
85
|
+
id: cache-opencv
|
|
86
|
+
uses: actions/cache@v4
|
|
87
|
+
with:
|
|
88
|
+
path: third_party/opencv-static
|
|
89
|
+
key: opencv-static-4.12.0-v2-macos-${{ runner.os }}-${{ runner.arch }}
|
|
90
|
+
|
|
91
|
+
- name: Install build dependencies
|
|
64
92
|
run: |
|
|
65
|
-
# Install
|
|
66
|
-
brew install
|
|
93
|
+
# Install LLVM for opencv-rust bindings codegen (no need for system OpenCV anymore)
|
|
94
|
+
brew install llvm cmake
|
|
67
95
|
# Set up LLVM environment for opencv-rust bindings (keg-only installation)
|
|
68
96
|
echo "LIBCLANG_PATH=/opt/homebrew/opt/llvm/lib" >> $GITHUB_ENV
|
|
69
97
|
echo "LLVM_CONFIG_PATH=/opt/homebrew/opt/llvm/bin/llvm-config" >> $GITHUB_ENV
|
|
70
98
|
echo "DYLD_LIBRARY_PATH=/opt/homebrew/opt/llvm/lib:$DYLD_LIBRARY_PATH" >> $GITHUB_ENV
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
99
|
+
|
|
100
|
+
- name: Build static OpenCV
|
|
101
|
+
if: steps.cache-opencv.outputs.cache-hit != 'true'
|
|
102
|
+
run: |
|
|
103
|
+
./scripts/build-opencv-static.sh
|
|
75
104
|
|
|
76
105
|
- name: Build wheels
|
|
77
106
|
uses: PyO3/maturin-action@v1
|
|
78
107
|
with:
|
|
79
108
|
target: ${{ matrix.target }}
|
|
80
109
|
args: --release --out dist --find-interpreter --no-default-features --features python-bindings,simd,opencv,metal
|
|
81
|
-
sccache: '
|
|
110
|
+
sccache: 'false'
|
|
82
111
|
env:
|
|
83
112
|
# Use stable ABI for forward compatibility
|
|
84
113
|
PYO3_USE_ABI3_FORWARD_COMPATIBILITY: '1'
|
|
114
|
+
# OpenCV static linking configuration
|
|
115
|
+
OPENCV_INCLUDE_PATHS: ${{ github.workspace }}/third_party/opencv-static/include/opencv4
|
|
116
|
+
OPENCV_LINK_PATHS: ${{ github.workspace }}/third_party/opencv-static/lib
|
|
117
|
+
OPENCV_LINK_LIBS: static=opencv_world,framework=Accelerate,dylib=c++
|
|
118
|
+
OPENCV_DISABLE_PROBES: pkg_config,cmake,vcpkg,vcpkg_cmake
|
|
85
119
|
- name: Upload wheels
|
|
86
120
|
uses: actions/upload-artifact@v4
|
|
87
121
|
with:
|