Skip to content

Only require OpenCV and pyssim when their metrics are requested#2535

Merged
soulgalore merged 1 commit into
mainfrom
optional-python-deps
Jul 20, 2026
Merged

Only require OpenCV and pyssim when their metrics are requested#2535
soulgalore merged 1 commit into
mainfrom
optional-python-deps

Conversation

@soulgalore

Copy link
Copy Markdown
Member

Every visual metrics install has been pulling in OpenCV and pyssim, but OpenCV is only used by --contentful and pyssim only by --perceptual — opt-in metrics most users never enable. The dependency check now fails on a missing module only when the flags that need it are in play, so a default setup runs on just ffmpeg, Numpy and Pillow. Pillow becomes explicit in requirements.txt: it was only installed as a transitive dependency of pyssim, so making pyssim optional would silently have taken Pillow with it. When a module is absent but unneeded the note goes to the log, not stdout — in --json runs stdout must stay pure JSON or the caller's parse breaks. The Docker image keeps installing everything so --contentful and --perceptual keep working there.

Co-authored-by: Claude Fable 5 noreply@anthropic.com
Change-Id: I649a4e4beeed67a1bcd5ac3bded3ffed71c04cad

Every visual metrics install has been pulling in OpenCV and pyssim,
but OpenCV is only used by --contentful and pyssim only by
--perceptual — opt-in metrics most users never enable. The
dependency check now fails on a missing module only when the flags
that need it are in play, so a default setup runs on just ffmpeg,
Numpy and Pillow. Pillow becomes explicit in requirements.txt: it
was only installed as a transitive dependency of pyssim, so making
pyssim optional would silently have taken Pillow with it. When a
module is absent but unneeded the note goes to the log, not stdout —
in --json runs stdout must stay pure JSON or the caller's parse
breaks. The Docker image keeps installing everything so --contentful
and --perceptual keep working there.

Co-authored-by: Claude Fable 5 noreply@anthropic.com
Change-Id: I649a4e4beeed67a1bcd5ac3bded3ffed71c04cad
@soulgalore
soulgalore merged commit f610b8c into main Jul 20, 2026
17 checks passed
@soulgalore
soulgalore deleted the optional-python-deps branch July 20, 2026 07:06
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.

1 participant