Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for numpy images #1376

Merged
merged 2 commits into from
Oct 3, 2023
Merged

Add support for numpy images #1376

merged 2 commits into from
Oct 3, 2023

Conversation

naddeoa
Copy link
Contributor

@naddeoa naddeoa commented Sep 19, 2023

This supports both numpy images and regular nested lists that represent images in the image metric by converting that image data into PIL format and then doing exactly what was happening before.

One thing I need feedback on: is there any loss of information/functionality from logging images in this way? I assume PIL might have modeled some image metadata or manually assigned tags and that wouldn't come through on the np/list log variants of course.

@naddeoa naddeoa requested a review from jamie256 September 19, 2023 04:31
@naddeoa naddeoa self-assigned this Sep 19, 2023
@naddeoa naddeoa force-pushed the np-image-support branch 4 times, most recently from 6ff40f5 to 9511165 Compare September 19, 2023 23:48
Copy link
Contributor

@jamie256 jamie256 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's document the kinds of images this supports, but its a nice start!

Copy link
Contributor

@jamie256 jamie256 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the change to reference numpy in the image metric, we need to add numpy as a dependency of the whylogs image extra in the pyproject.toml file

the changes are otherwise fine.

This supports both numpy images and regular nested lists that represent
images in the image metric by converting that image data into PIL format
and then doing exactly what was happening before.
Copy link
Contributor

@jamie256 jamie256 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@jamie256 jamie256 merged commit 2420d13 into mainline Oct 3, 2023
18 checks passed
@jamie256 jamie256 deleted the np-image-support branch October 3, 2023 16:47
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.

4 participants