Make cross-check and reuse-as-seg the service default
Cross-check + reuse-as-seg are already the config/CLI default; align the HTTP service with them instead of forcing cross-check off. The earlier off-by-default was to avoid the extra inference, but reuse-as-seg now makes that forward double as the seg mask (birefnet backend) -- it replaces the primary seg model rather than adding to it, so the cost concern is gone. - app.py: honour the config default (on); BGFILTER_CROSS_CHECK still forces either way, unset = config. - service.py preload: warm the cross-check HR-matting model, and skip the now- redundant primary segmenter when reuse covers segmentation. - README / DEPLOY(_ZH): document cross-check as default-on, BiRefNet_HR-matting as required (not optional), BGFILTER_CROSS_CHECK=0 to disable. Verified: service defaults cross_check on, env forces both ways, preload picks cross-checker and skips the primary segmenter. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -217,13 +217,13 @@ Config comes from `BGFILTER_CONFIG` (defaults to `configs/default.yaml` when pre
|
||||
caps input size (default ~4MP → `413`); `BGFILTER_PRELOAD=1` loads the default models at
|
||||
startup. Run a single worker (`--workers 1`) — each worker loads its own copy of the models.
|
||||
|
||||
Unlike the CLI, the service defaults the **cross-model veto to off** — it adds one
|
||||
extra large-model inference (~35 s/image on CPU, 14 s → 49 s total). Enable it
|
||||
per request with the `cross_check` form field, or flip the service default with
|
||||
`BGFILTER_CROSS_CHECK=1` (worth it on GPU or when hair-gap residue matters more
|
||||
than latency); `/healthz` reports the default as `crossCheck`. The cross-check
|
||||
model is lazy-loaded: it is never preloaded at startup, so the first request that
|
||||
enables it also pays the one-time model load (~1 GB) on top of the inference.
|
||||
Like the CLI, the service runs the **cross-model veto by default** (config
|
||||
default: on). With reuse-as-seg it replaces the primary seg forward rather than
|
||||
adding to it, so it is not the latency hit it once was; its HR-matting model is
|
||||
preloaded with the rest of the warm set (and, on the birefnet backend, the now-
|
||||
redundant primary segmenter is skipped at startup). Set `BGFILTER_CROSS_CHECK=0`
|
||||
to turn it off service-wide, or use the per-request `cross_check` form field to
|
||||
override either way; `/healthz` reports the default as `crossCheck`.
|
||||
|
||||
## Quality Check
|
||||
|
||||
|
||||
Reference in New Issue
Block a user