fix: remove double normalize_rgb in engine preprocessing

preprocess() already calls normalize_rgb() internally; calling it
before passing to preprocess() applied ImageNet normalization twice.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
cmoyates 2026-03-01 06:47:22 -03:30
parent 4bad586112
commit 6c711e85bd
No known key found for this signature in database
GPG Key ID: F65E08480FDC22D2

View File

@ -17,7 +17,6 @@ from PIL import Image
from corridorkey_mlx.inference.pipeline import load_model
from corridorkey_mlx.io.image import (
normalize_rgb,
postprocess_alpha,
postprocess_foreground,
preprocess,
@ -141,7 +140,7 @@ class CorridorKeyMLXEngine:
mask_f32 = np.asarray(mask_pil, dtype=np.float32)[:, :, np.newaxis] / 255.0
# -- preprocess (ImageNet norm + concat) -> (1, H, W, 4) NHWC --
x = preprocess(normalize_rgb(rgb_f32), mask_f32)
x = preprocess(rgb_f32, mask_f32)
# -- forward --
outputs = self._model(x)