e234a1a13d
Adopt the service branch's refactors verbatim so the two branches stop drifting on these files: - pipeline.py: split _run_image into _process_rgb + MattingResult (an in-memory API, exposed as MattingPipeline.run_rgb) and allow injecting pre-loaded models into MattingPipeline. Disk I/O and debug dumps stay in _run_image; the algorithm is line-for-line the same. - foreground.py: estimate_foreground_rgb returns the foreground array directly; the ForegroundEstimate dataclass carried background/ correction fields nothing consumed. Verified: default TestImage3 run byte-identical to pre-backport master, all debug artifacts written, run_rgb output matches run_image bytes under save_rgba's quantization; both files now diff-clean against server-edition. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>