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.
This commit is contained in:
2026-10-06 21:47:20 -04:00
parent 9cba420fd5
commit 3761281dd1
5 changed files with 24 additions and 8 deletions
+4
View File
@@ -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}")"
Binary file not shown.
Binary file not shown.
Binary file not shown.
+11 -8
View File
@@ -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
}