Weigh the categories in the same precompute, and mask with them
The scene model shipped with a decoder and no caller. This runs it. ## Beside the instance pass, not instead of it `compute` now does both on the same upright frame and lays both back down the same way, so instance masks and category masks index into one grid — the sensor's. A failure in the scene half is logged and dropped rather than propagated: no scene model is an ordinary state, and a photograph that can still be masked by subject should not become unopenable because the categories are missing. Categories under half a percent of the frame never reach the cache. A control that does nothing when moved is worse than an absent one, and each one it skips is a proxy-sized buffer not allocated. ## The shader needed nothing A category reaches `dr-gpu` as a soft coverage buffer at proxy resolution, turned into a distance field — which is exactly what a subject is. So they share `MODE_SUBJECT`. That is not a shortcut taken for speed: the shader has no way to tell them apart and no reason to want one. What differs is only which model produced the coverage, and that has already happened by then. Feather, falloff, dilation and erosion therefore work on a category on the day it arrives, because they were never subject-specific. ## Where the weights come from `scene-model` compiles the graph in and the desktop app takes it; Android leaves it off and reads the copy `install_bundled_models` unpacks, because 24 MB of constant is worth avoiding in a mobile install and not worth the plumbing to avoid on a desktop one. Embedded is tried first — a build that has the weights compiled in should not be silently overridden by a stale file in a data directory. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -654,7 +654,13 @@ impl MaskPass {
|
||||
// edge; the field is in proxy pixels. Converting here keeps the
|
||||
// stored edit resolution-independent while the shader works in the
|
||||
// units its texture is actually measured in.
|
||||
MaskSource::Subject { .. } => {
|
||||
// A category shares the subject's mode, and that is not a
|
||||
// shortcut: both arrive as a soft coverage buffer at proxy
|
||||
// resolution and both are turned into a distance field before they
|
||||
// reach here. The shader has no way to tell them apart and no
|
||||
// reason to want one — what differs is only which model produced
|
||||
// the coverage.
|
||||
MaskSource::Subject { .. } | MaskSource::Category { .. } => {
|
||||
let short = field_short_edge(width, height);
|
||||
MaskParams {
|
||||
mode: MODE_SUBJECT,
|
||||
|
||||
Reference in New Issue
Block a user