From 3761281dd1dddabc9f638ae35ed6602cb777ea07 Mon Sep 17 00:00:00 2001 From: Duncan Tourolle Date: Tue, 6 Oct 2026 21:47:20 -0400 Subject: [PATCH] Ship the denoise networks with any height and width mosaic-{fast,medium,best}.onnx are the shipped networks re-exported by darkroom-denoise tools/export_whole.py (22ea648) from the checkpoints the 1408 files came from: identical to them at 1408 (max |d| = 0), to torch at 592 x 848, and to tiled inference over the reflected frame in f64. 42 MB together. The Arch package and the Windows installer carry them beside the fixed files; the APK leaves them out, since the Hexagon takes fixed shapes only. --- docker/android/assemble-apk.sh | 4 ++++ models/denoise/mosaic-best.onnx | 3 +++ models/denoise/mosaic-fast.onnx | 3 +++ models/denoise/mosaic-medium.onnx | 3 +++ packaging/PKGBUILD | 19 +++++++++++-------- 5 files changed, 24 insertions(+), 8 deletions(-) create mode 100644 models/denoise/mosaic-best.onnx create mode 100644 models/denoise/mosaic-fast.onnx create mode 100644 models/denoise/mosaic-medium.onnx diff --git a/docker/android/assemble-apk.sh b/docker/android/assemble-apk.sh index 1363cb1..4da6ec6 100755 --- a/docker/android/assemble-apk.sh +++ b/docker/android/assemble-apk.sh @@ -323,6 +323,10 @@ for _dir in face scene inpaint denoise; do for f in "${ASSETS}"/*; do case "$(basename "${f}")" in README.md) continue ;; + # The denoisers' any-size exports run whole frames on TensorRT + # and CUDA (denoise.md §14); the Hexagon takes fixed shapes, and + # 42 MB of graphs it never loads stay out of the APK. + mosaic-fast.onnx | mosaic-medium.onnx | mosaic-best.onnx) continue ;; esac cp "${f}" "${OUT}/staging/assets/models/" _bundled="${_bundled} $(basename "${f}")" diff --git a/models/denoise/mosaic-best.onnx b/models/denoise/mosaic-best.onnx new file mode 100644 index 0000000..ea5e6f7 --- /dev/null +++ b/models/denoise/mosaic-best.onnx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:800bbabf65b1f5a841dc07c2126cfce54a01b4ff1b52d3bed367cae7357c8def +size 25767168 diff --git a/models/denoise/mosaic-fast.onnx b/models/denoise/mosaic-fast.onnx new file mode 100644 index 0000000..15d8e6a --- /dev/null +++ b/models/denoise/mosaic-fast.onnx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ac769bc760c5156d28b3eefa33d65bb0f24e4fb5397cb0f1f1cc683970523a61 +size 3720906 diff --git a/models/denoise/mosaic-medium.onnx b/models/denoise/mosaic-medium.onnx new file mode 100644 index 0000000..998d5ca --- /dev/null +++ b/models/denoise/mosaic-medium.onnx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4ecb9729565dbf2eb8484b74b97a0a9b12e756f52f4c7a0a726069b47984a72c +size 12622220 diff --git a/packaging/PKGBUILD b/packaging/PKGBUILD index b8d6986..21298ce 100644 --- a/packaging/PKGBUILD +++ b/packaging/PKGBUILD @@ -132,14 +132,17 @@ package() { install -Dm644 "${_src}" "${pkgdir}/usr/share/darkroom/models/migan-512.onnx" # The learned demosaic and denoise, one network per method (the project's - # own weights, GPL — models/LICENCE.md). Same pointer check, same - # directory. + # own weights, GPL — models/LICENCE.md), each at the fixed 1408 tile and + # with any height and width for a whole frame on a GPU (denoise.md §14). + # Same pointer check, same directory. for _net in fast medium best; do - _src="models/denoise/mosaic-${_net}-1408.onnx" - if [[ "$(stat -c%s "${_src}")" -lt 100000 ]]; then - echo "error: the ${_net} denoise model is an LFS pointer — run: git lfs pull" >&2 - return 1 - fi - install -Dm644 "${_src}" "${pkgdir}/usr/share/darkroom/models/mosaic-${_net}-1408.onnx" + for _file in "mosaic-${_net}-1408.onnx" "mosaic-${_net}.onnx"; do + _src="models/denoise/${_file}" + if [[ "$(stat -c%s "${_src}")" -lt 100000 ]]; then + echo "error: ${_file} is an LFS pointer — run: git lfs pull" >&2 + return 1 + fi + install -Dm644 "${_src}" "${pkgdir}/usr/share/darkroom/models/${_file}" + done done }