trainingsample 0.2.8__tar.gz → 0.2.9__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 (41) hide show
  1. {trainingsample-0.2.8 → trainingsample-0.2.9}/.github/workflows/publish.yml +4 -4
  2. {trainingsample-0.2.8 → trainingsample-0.2.9}/Cargo.lock +6 -6
  3. {trainingsample-0.2.8 → trainingsample-0.2.9}/Cargo.toml +1 -1
  4. {trainingsample-0.2.8 → trainingsample-0.2.9}/PKG-INFO +1 -1
  5. {trainingsample-0.2.8 → trainingsample-0.2.9}/pyproject.toml +1 -1
  6. {trainingsample-0.2.8 → trainingsample-0.2.9}/scripts/build-opencv-static.sh +63 -5
  7. {trainingsample-0.2.8 → trainingsample-0.2.9}/.cargo/config.toml +0 -0
  8. {trainingsample-0.2.8 → trainingsample-0.2.9}/.envrc +0 -0
  9. {trainingsample-0.2.8 → trainingsample-0.2.9}/.github/workflows/ci.yml +0 -0
  10. {trainingsample-0.2.8 → trainingsample-0.2.9}/.gitignore +0 -0
  11. {trainingsample-0.2.8 → trainingsample-0.2.9}/.pre-commit-config.yaml +0 -0
  12. {trainingsample-0.2.8 → trainingsample-0.2.9}/.rustfmt.toml +0 -0
  13. {trainingsample-0.2.8 → trainingsample-0.2.9}/BENCHMARKS.md +0 -0
  14. {trainingsample-0.2.8 → trainingsample-0.2.9}/Dockerfile +0 -0
  15. {trainingsample-0.2.8 → trainingsample-0.2.9}/LICENSE +0 -0
  16. {trainingsample-0.2.8 → trainingsample-0.2.9}/README.md +0 -0
  17. {trainingsample-0.2.8 → trainingsample-0.2.9}/clippy.toml +0 -0
  18. {trainingsample-0.2.8 → trainingsample-0.2.9}/docs/API_COMPAT_CV2.md +0 -0
  19. {trainingsample-0.2.8 → trainingsample-0.2.9}/docs/BUILDING_STATIC_OPENCV.md +0 -0
  20. {trainingsample-0.2.8 → trainingsample-0.2.9}/rust-toolchain.toml +0 -0
  21. {trainingsample-0.2.8 → trainingsample-0.2.9}/scripts/run_competitive_benchmarks.sh +0 -0
  22. {trainingsample-0.2.8 → trainingsample-0.2.9}/setup-env.sh +0 -0
  23. {trainingsample-0.2.8 → trainingsample-0.2.9}/src/core.rs +0 -0
  24. {trainingsample-0.2.8 → trainingsample-0.2.9}/src/cropping.rs +0 -0
  25. {trainingsample-0.2.8 → trainingsample-0.2.9}/src/cv_batch_ops.rs +0 -0
  26. {trainingsample-0.2.8 → trainingsample-0.2.9}/src/cv_batch_ops_optimized.rs +0 -0
  27. {trainingsample-0.2.8 → trainingsample-0.2.9}/src/cv_compat.rs +0 -0
  28. {trainingsample-0.2.8 → trainingsample-0.2.9}/src/format_conversion_simd.rs +0 -0
  29. {trainingsample-0.2.8 → trainingsample-0.2.9}/src/lib.rs +0 -0
  30. {trainingsample-0.2.8 → trainingsample-0.2.9}/src/loading.rs +0 -0
  31. {trainingsample-0.2.8 → trainingsample-0.2.9}/src/luminance.rs +0 -0
  32. {trainingsample-0.2.8 → trainingsample-0.2.9}/src/luminance_simd.rs +0 -0
  33. {trainingsample-0.2.8 → trainingsample-0.2.9}/src/opencv_ops.rs +0 -0
  34. {trainingsample-0.2.8 → trainingsample-0.2.9}/src/python_bindings.rs +0 -0
  35. {trainingsample-0.2.8 → trainingsample-0.2.9}/src/tests.rs +0 -0
  36. {trainingsample-0.2.8 → trainingsample-0.2.9}/src/true_batch_ops.rs +0 -0
  37. {trainingsample-0.2.8 → trainingsample-0.2.9}/tests/__init__.py +0 -0
  38. {trainingsample-0.2.8 → trainingsample-0.2.9}/tests/comprehensive_tests.rs +0 -0
  39. {trainingsample-0.2.8 → trainingsample-0.2.9}/tests/test_comprehensive.py +0 -0
  40. {trainingsample-0.2.8 → trainingsample-0.2.9}/tests/test_performance_benchmarks.py +0 -0
  41. {trainingsample-0.2.8 → trainingsample-0.2.9}/tests/test_python_bindings.py +0 -0
@@ -41,7 +41,7 @@ jobs:
41
41
  uses: actions/cache@v4
42
42
  with:
43
43
  path: third_party/opencv-static
44
- key: opencv-static-4.12.0-no-itt-no-openjpeg-linux-${{ matrix.os }}-${{ runner.arch }}-${{ matrix.manylinux }}
44
+ key: opencv-static-4.12.0-codecs-no-itt-no-openjpeg-linux-${{ matrix.os }}-${{ runner.arch }}-${{ matrix.manylinux }}
45
45
 
46
46
  - name: Install build dependencies
47
47
  run: |
@@ -105,7 +105,7 @@ jobs:
105
105
  # OpenCV static linking configuration
106
106
  OPENCV_INCLUDE_PATHS: ${{ github.workspace }}/third_party/opencv-static/include/opencv4
107
107
  OPENCV_LINK_PATHS: ${{ github.workspace }}/third_party/opencv-static/lib
108
- OPENCV_LINK_LIBS: static=opencv_world,static=stdc++
108
+ OPENCV_LINK_LIBS: static=opencv_world,static=jpeg,static=png,static=tiff,static=webp,static=z,static=stdc++
109
109
  OPENCV_DISABLE_PROBES: pkg_config,cmake,vcpkg,vcpkg_cmake
110
110
 
111
111
  - name: Upload wheels
@@ -131,7 +131,7 @@ jobs:
131
131
  uses: actions/cache@v4
132
132
  with:
133
133
  path: third_party/opencv-static
134
- key: opencv-static-4.12.0-no-itt-no-openjpeg-macos-${{ runner.os }}-${{ runner.arch }}
134
+ key: opencv-static-4.12.0-codecs-no-itt-no-openjpeg-macos-${{ runner.os }}-${{ runner.arch }}
135
135
 
136
136
  - name: Install build dependencies
137
137
  run: |
@@ -159,7 +159,7 @@ jobs:
159
159
  # OpenCV static linking configuration
160
160
  OPENCV_INCLUDE_PATHS: ${{ github.workspace }}/third_party/opencv-static/include/opencv4
161
161
  OPENCV_LINK_PATHS: ${{ github.workspace }}/third_party/opencv-static/lib
162
- OPENCV_LINK_LIBS: static=opencv_world,framework=Accelerate,dylib=c++
162
+ OPENCV_LINK_LIBS: static=opencv_world,static=jpeg,static=png,static=tiff,static=webp,static=z,framework=Accelerate,dylib=c++
163
163
  OPENCV_DISABLE_PROBES: pkg_config,cmake,vcpkg,vcpkg_cmake
164
164
  - name: Upload wheels
165
165
  uses: actions/upload-artifact@v4
@@ -135,9 +135,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
135
135
 
136
136
  [[package]]
137
137
  name = "bitflags"
138
- version = "2.9.4"
138
+ version = "2.10.0"
139
139
  source = "registry+https://github.com/rust-lang/crates.io-index"
140
- checksum = "2261d10cca569e4643e526d8dc2e62e433cc8aba21ab764233731f8d369bf394"
140
+ checksum = "812e12b5285cc515a9c72a5c1d3b6d46a19dac5acfef5265968c166106e31dd3"
141
141
 
142
142
  [[package]]
143
143
  name = "bitstream-io"
@@ -840,7 +840,7 @@ version = "0.27.0"
840
840
  source = "registry+https://github.com/rust-lang/crates.io-index"
841
841
  checksum = "c43f73953f8cbe511f021b58f18c3ce1c3d1ae13fe953293e13345bf83217f25"
842
842
  dependencies = [
843
- "bitflags 2.9.4",
843
+ "bitflags 2.10.0",
844
844
  "block",
845
845
  "core-graphics-types",
846
846
  "foreign-types",
@@ -1164,7 +1164,7 @@ version = "0.18.0"
1164
1164
  source = "registry+https://github.com/rust-lang/crates.io-index"
1165
1165
  checksum = "97baced388464909d42d89643fe4361939af9b7ce7a31ee32a168f832a70f2a0"
1166
1166
  dependencies = [
1167
- "bitflags 2.9.4",
1167
+ "bitflags 2.10.0",
1168
1168
  "crc32fast",
1169
1169
  "fdeflate",
1170
1170
  "flate2",
@@ -1488,7 +1488,7 @@ version = "1.1.2"
1488
1488
  source = "registry+https://github.com/rust-lang/crates.io-index"
1489
1489
  checksum = "cd15f8a2c5551a84d56efdc1cd049089e409ac19a3072d5037a17fd70719ff3e"
1490
1490
  dependencies = [
1491
- "bitflags 2.9.4",
1491
+ "bitflags 2.10.0",
1492
1492
  "errno",
1493
1493
  "libc",
1494
1494
  "linux-raw-sys",
@@ -1746,7 +1746,7 @@ dependencies = [
1746
1746
 
1747
1747
  [[package]]
1748
1748
  name = "trainingsample"
1749
- version = "0.2.8"
1749
+ version = "0.2.9"
1750
1750
  dependencies = [
1751
1751
  "anyhow",
1752
1752
  "criterion",
@@ -38,7 +38,7 @@ description = "High-performance Rust reimplementation of GIL-blocking video/imag
38
38
  edition = "2021"
39
39
  license = "MIT"
40
40
  name = "trainingsample"
41
- version = "0.2.8"
41
+ version = "0.2.9"
42
42
  readme = "README.md"
43
43
 
44
44
  [profile.release]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: trainingsample
3
- Version: 0.2.8
3
+ Version: 0.2.9
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.8"
17
+ version = "0.2.9"
18
18
 
19
19
  [project.optional-dependencies]
20
20
  dev = ["pytest>=6.0", "pytest-benchmark", "maturin>=1.0,<2.0", "pre-commit"]
@@ -10,7 +10,7 @@ PROJECT_ROOT="$(cd "${SCRIPT_DIR}/.." && pwd)"
10
10
  BUILD_DIR="${PROJECT_ROOT}/opencv-build-tmp"
11
11
  INSTALL_DIR="${PROJECT_ROOT}/third_party/opencv-static"
12
12
  SIGNATURE_FILE="${INSTALL_DIR}/build_signature.txt"
13
- BUILD_SIGNATURE="opencv-${OPENCV_VERSION}-static-no-itt-no-openjpeg"
13
+ BUILD_SIGNATURE="opencv-${OPENCV_VERSION}-static-codecs-no-itt-no-openjpeg"
14
14
 
15
15
  echo "Building static OpenCV ${OPENCV_VERSION}..."
16
16
  echo "Install directory: ${INSTALL_DIR}"
@@ -46,6 +46,17 @@ cmake -S "opencv-${OPENCV_VERSION}" \
46
46
  -DBUILD_LIST=core,imgproc,imgcodecs,highgui,video,videoio,calib3d,features2d,photo \
47
47
  -DBUILD_SHARED_LIBS=OFF \
48
48
  -DBUILD_opencv_world=ON \
49
+ -DOPENCV_FORCE_3RDPARTY_BUILD=ON \
50
+ -DBUILD_JPEG=ON \
51
+ -DBUILD_PNG=ON \
52
+ -DBUILD_TIFF=ON \
53
+ -DBUILD_WEBP=ON \
54
+ -DBUILD_ZLIB=ON \
55
+ -DWITH_JPEG=ON \
56
+ -DWITH_PNG=ON \
57
+ -DWITH_TIFF=ON \
58
+ -DWITH_WEBP=ON \
59
+ -DWITH_ZLIB=ON \
49
60
  -DBUILD_TESTS=OFF \
50
61
  -DBUILD_PERF_TESTS=OFF \
51
62
  -DBUILD_EXAMPLES=OFF \
@@ -60,6 +71,7 @@ cmake -S "opencv-${OPENCV_VERSION}" \
60
71
  -DWITH_V4L=OFF \
61
72
  -DWITH_GTK=OFF \
62
73
  -DWITH_QT=OFF \
74
+ -DWITH_OPENEXR=OFF \
63
75
  -DWITH_ITT=OFF \
64
76
  -DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}"
65
77
 
@@ -71,12 +83,40 @@ cmake --build build --config Release --target opencv_world -j$(nproc 2>/dev/null
71
83
  echo "Installing to ${INSTALL_DIR}..."
72
84
  cmake --install build --config Release
73
85
 
86
+ # Copy bundled third-party codec archives into the install lib directory and
87
+ # provide canonical aliases (libjpeg.a, libwebp.a, …) for the linker.
88
+ CODEC_LIB_DIR="${BUILD_DIR}/build/3rdparty/lib"
89
+ mkdir -p "${INSTALL_DIR}/lib"
90
+
91
+ declare -a CODEC_MAPPINGS=(
92
+ "liblibjpeg-turbo.a:libjpeg.a"
93
+ "liblibpng.a:libpng.a"
94
+ "liblibtiff.a:libtiff.a"
95
+ "liblibwebp.a:libwebp.a"
96
+ "libzlib.a:libz.a"
97
+ )
98
+
99
+ for mapping in "${CODEC_MAPPINGS[@]}"; do
100
+ SRC_ARCHIVE="${CODEC_LIB_DIR}/${mapping%%:*}"
101
+ CANONICAL_NAME="${mapping%%:*}"
102
+ LINK_NAME="${mapping##*:}"
103
+
104
+ if [ ! -f "${SRC_ARCHIVE}" ]; then
105
+ echo "ERROR: Expected third-party archive ${SRC_ARCHIVE} was not produced by the OpenCV build"
106
+ find "${CODEC_LIB_DIR}" -maxdepth 1 -type f -name 'lib*.a' | sed "s#^# #"
107
+ exit 1
108
+ fi
109
+
110
+ cp -f "${SRC_ARCHIVE}" "${INSTALL_DIR}/lib/${CANONICAL_NAME}"
111
+ ln -sf "${CANONICAL_NAME}" "${INSTALL_DIR}/lib/${LINK_NAME}"
112
+ done
113
+
74
114
  # Verify installation - check both lib and lib64 (manylinux uses lib64)
75
- if [ -f "${INSTALL_DIR}/lib64/libopencv_world.a" ]; then
76
- # Move from lib64 to lib for consistency
115
+ if [ -d "${INSTALL_DIR}/lib64" ]; then
116
+ # Move from lib64 to lib for consistency (copy to handle reruns safely)
77
117
  mkdir -p "${INSTALL_DIR}/lib"
78
- mv "${INSTALL_DIR}/lib64"/* "${INSTALL_DIR}/lib/"
79
- rmdir "${INSTALL_DIR}/lib64"
118
+ cp -a "${INSTALL_DIR}/lib64/." "${INSTALL_DIR}/lib/"
119
+ rm -rf "${INSTALL_DIR}/lib64"
80
120
  fi
81
121
 
82
122
  if [ ! -f "${INSTALL_DIR}/lib/libopencv_world.a" ]; then
@@ -86,6 +126,24 @@ if [ ! -f "${INSTALL_DIR}/lib/libopencv_world.a" ]; then
86
126
  exit 1
87
127
  fi
88
128
 
129
+ # Ensure third-party codecs were produced as static archives
130
+ REQUIRED_ARCHIVES=(
131
+ "libjpeg.a"
132
+ "libpng.a"
133
+ "libtiff.a"
134
+ "libwebp.a"
135
+ "libz.a"
136
+ )
137
+
138
+ for archive in "${REQUIRED_ARCHIVES[@]}"; do
139
+ if [ ! -f "${INSTALL_DIR}/lib/${archive}" ]; then
140
+ echo "ERROR: Required static archive ${archive} not found in ${INSTALL_DIR}/lib"
141
+ echo "Available archives:"
142
+ find "${INSTALL_DIR}" -maxdepth 2 -type f -name 'lib*.a' | sed "s#^# #"
143
+ exit 1
144
+ fi
145
+ done
146
+
89
147
  printf '%s\n' "${BUILD_SIGNATURE}" > "${SIGNATURE_FILE}"
90
148
 
91
149
  echo "Static OpenCV built successfully!"
File without changes
File without changes
File without changes