mirror of
https://github.com/qdrant/fastembed.git
synced 2026-09-25 07:27:49 -05:00
* fix(image): normalize batched input along the channel axis normalize() advertises 4D (N, C, H, W) support via its num_channels branch and the channel-count validation, but the actual math used ((image.T - mean) / std).T. Transpose reverses every axis, so on 4D input the channels no longer line up with mean/std: it raises when N != C and silently normalizes along the batch axis when N == C. Reshape mean/std to broadcast on the real channel axis instead; the (C, H, W) path is unchanged. * test(image): cover channel-wise normalize for 3D and batched input * refactor --------- Co-authored-by: George Panchuk <george.panchuk@qdrant.tech>