diff --git a/apps/darkroom-android/src/lib.rs b/apps/darkroom-android/src/lib.rs index cf9de44..46dd1bd 100644 --- a/apps/darkroom-android/src/lib.rs +++ b/apps/darkroom-android/src/lib.rs @@ -360,6 +360,7 @@ fn unpack_bundled_models(app: &slint::android::AndroidApp) { (c"models/categories.txt", "categories.txt"), // The panorama border filler (FR-MRG-4); MIT, 28 MB. (c"models/migan-512.onnx", "migan-512.onnx"), + (c"models/mosaic-1408.onnx", "mosaic-1408.onnx"), ]; let dir = dr_ui::shared_face_models_dir(); diff --git a/docker/android/assemble-apk.sh b/docker/android/assemble-apk.sh index 1261abc..ca0aaba 100755 --- a/docker/android/assemble-apk.sh +++ b/docker/android/assemble-apk.sh @@ -299,7 +299,7 @@ fi rm -rf "${OUT}/staging/assets/models" mkdir -p "${OUT}/staging/assets/models" _bundled="" -for _dir in face scene inpaint; do +for _dir in face scene inpaint denoise; do ASSETS="${REPO}/models/${_dir}" compgen -G "${ASSETS}/*.onnx" >/dev/null || continue # An LFS pointer is ~130 bytes and looks exactly like a model to `cp`. Left diff --git a/docker/windows/package.sh b/docker/windows/package.sh index d3a3045..5d3e122 100755 --- a/docker/windows/package.sh +++ b/docker/windows/package.sh @@ -51,10 +51,10 @@ sed 's/$/\r/' "${REPO}/LICENSE" > "${STAGE}/LICENSE" # # The directories are the ones the APK stages (assemble-apk.sh) and the Arch # package installs: the face pair and its eye-state models, the scene model -# with its two descriptors, and the panorama border filler. The installer +# with its two descriptors, the panorama border filler and the denoiser. The installer # smoke test counts the same directories, so a model added here is expected # there without a number to update. -for dir in face scene inpaint; do +for dir in face scene inpaint denoise; do for f in "${REPO}/models/${dir}"/*; do case "$(basename "${f}")" in README.md) continue ;; diff --git a/packaging/PKGBUILD b/packaging/PKGBUILD index a5e01b6..a201264 100644 --- a/packaging/PKGBUILD +++ b/packaging/PKGBUILD @@ -123,4 +123,13 @@ package() { return 1 fi install -Dm644 "${_src}" "${pkgdir}/usr/share/darkroom/models/migan-512.onnx" + + # The learned demosaic and denoise (the project's own weights, GPL — + # models/LICENCE.md). Same pointer check, same directory. + _src="models/denoise/mosaic-1408.onnx" + if [[ "$(stat -c%s "${_src}")" -lt 100000 ]]; then + echo "error: the denoise model is an LFS pointer — run: git lfs pull" >&2 + return 1 + fi + install -Dm644 "${_src}" "${pkgdir}/usr/share/darkroom/models/mosaic-1408.onnx" }