Skip to content

Preserve the frame axis when computing SSIM for unbatched videos - #43

Open
sylvesterkaczmarek wants to merge 1 commit into
google-research:mainfrom
sylvesterkaczmarek:fix/ssim-unbatched-video-20261005
Open

sylvesterkaczmarek wants to merge 1 commit into
google-research:mainfrom
sylvesterkaczmarek:fix/ssim-unbatched-video-20261005

Conversation

@sylvesterkaczmarek

Copy link
Copy Markdown

Summary

Fixes #42.

Keep the leading frame axis during spatial filtering even when no separate batch axis is present. Previously the reshape merged that axis into the spatial data and invalidated the final reduction. Unbatched videos now agree with separately evaluated frames and explicit singleton batches. Ordinary image and batched-video paths remain unchanged. The changelog is updated.

Validation

python -m pytest -q zapbench/video_forecasting/metrics_test.py zapbench/video_forecasting/ssim_unbatched_video_test.py

24 tests passed. All twelve new regression cases fail on unchanged upstream and pass with the fix. They cover 2D/3D frames, optional channels, one/multiple frames, full maps, scalar scores, explicit-batch equivalence, JIT, gradients and frame isolation. Existing metric tests against dm_pix and scikit-image also pass. No trained model, dataset download or accelerator execution was used.

Tested on macOS CPU with Python 3.12 using real module imports. New test formatting, scoped static checks, syntax checks and git diff --check pass. No production dependency or workflow changes.

Signed-off-by: Sylvester Kaczmarek <16242628+sylvesterkaczmarek@users.noreply.github.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SSIM fails for videos without an explicit batch axis

1 participant