Files
BGfilter/bgfilter
lhk229 c7a2819d33 Run torch models in fp16 under inference_mode
- ViTMatte and BiRefNet load with torch_dtype=float16 (the BiRefNet
  checkpoint ships fp16 anyway; the old .float() upcast is gone) and
  floating-point inputs are cast to half to match.
- torch.no_grad() -> torch.inference_mode() in both predict paths.
- Outputs already downcast via .float() before .numpy(), so downstream
  stays float32. anime-seg is ONNX and unaffected.

Effect verified by the user beforehand.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-06 02:50:42 +08:00
..
2026-06-30 14:14:15 +08:00
2026-06-30 14:14:15 +08:00