Files
DarkRoom/core/dr-denoise/Cargo.toml
T
dtourolle d8304d7c82 Add dr-denoise: the learned demosaic and denoise, without the UI
The noise model takes the best source the frame has: the body's measured
table (the Canon EOS 6D's, from the library), the DNG's NoiseProfile, or
the frame itself — read, row and column noise from its masked border, and
only the shot gain estimated, from the quietest flat patches. Checked on
130 6D frames, the estimate is within 10 % from ISO 1000 up; the network
loses under 0.3 dB for a sigma off by 15-20 %, so every Bayer body is
eligible.

Tiles of 1408 keep their central 1024 behind a 192-photosite halo, past the
185-photosite receptive field, and the frame is extended by reflection,
which keeps every photosite's colour; a pattern that starts on another
colour is read from one photosite up or left so the network sees RGGB, and
nothing is cropped. The tests run every Bayer phase, tiled against whole,
with a stand-in network of known reach.

The model ships as models/denoise/mosaic-1408.onnx (LFS), trained in
darkroom-denoise on the maintainer's own photographs, GPL like the code.
denoise_raw runs a file end to end: on a 6D frame at ISO 8000 the result
matches the training repository's own path to 2.5e-4 at worst, and takes
3.1 s on TensorRT fp16 (75 dB from f32) or 14.4 s on the CPU.
2026-10-03 11:15:50 -04:00

33 lines
1.0 KiB
TOML

[package]
name = "dr-denoise"
version.workspace = true
edition.workspace = true
rust-version.workspace = true
license.workspace = true
[dependencies]
dr-decode.workspace = true
serde = { workspace = true }
serde_norway.workspace = true
thiserror.workspace = true
log.workspace = true
# The network runs under the inference engine like every other model
# (docs/dev/inference.md): `ort` is the API, the engine picks the rung.
# Optional so the noise model and the tiling test without a runtime.
ort = { workspace = true, optional = true }
dr-inference-engine = { workspace = true, optional = true }
ndarray = { workspace = true, optional = true }
[features]
default = ["onnx"]
onnx = ["dep:ort", "dep:dr-inference-engine", "dep:ndarray"]
# A real ONNX Runtime from disk rather than tract alone, as the app links it.
native = ["onnx", "dr-inference-engine/native"]
[dev-dependencies]
# The example repairs hot photosites with the app's own pass, as develop will.
dr-gpu.workspace = true
pollster.workspace = true
env_logger.workspace = true