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

Adds ability to read images from numpy files and numpy arrays #2212

Merged
merged 11 commits into from
Jul 11, 2022

Conversation

geoffreyangus
Copy link
Contributor

@geoffreyangus geoffreyangus commented Jun 29, 2022

This PR is in response to a feature request to enable users to load images from numpy files.

Prior to this change, we only attempted to read images as PNGs. Now, if that fails, we fallback to attempting to read a numpy file. This PR also attempts to improve the warnings/errors raised to the user in the event that no files are read.

The image generation function is now able to save numpy files when generating synthetic images. This is leveraged in a new unit test verifying this behavior.

Additionally, this PR adds the ability to read in images as numpy arrays and pass them in within a column of a Pandas DataFrame.

@github-actions
Copy link

github-actions bot commented Jun 30, 2022

Unit Test Results

       6 files  ±0         6 suites  ±0   2h 26m 56s ⏱️ + 1m 48s
2 924 tests +3  2 878 ✔️ +3    46 💤 ±0  0 ±0 
8 772 runs  +9  8 630 ✔️ +9  142 💤 ±0  0 ±0 

Results for commit 981602c. ± Comparison against base commit 5c9cffb.

♻️ This comment has been updated with latest results.

ludwig/utils/image_utils.py Outdated Show resolved Hide resolved
ludwig/utils/image_utils.py Outdated Show resolved Hide resolved
@arnavgarg1 arnavgarg1 changed the title Adds ability to read images from numpy files Adds ability to read images from numpy files and numpy arrays Jul 7, 2022
@arnavgarg1 arnavgarg1 marked this pull request as ready for review July 7, 2022 17:32
tests/integration_tests/test_preprocessing.py Outdated Show resolved Hide resolved
tests/integration_tests/test_preprocessing.py Outdated Show resolved Hide resolved
@tgaddair tgaddair merged commit cdec598 into master Jul 11, 2022
@tgaddair tgaddair deleted the add-np-image-feature branch July 11, 2022 16:30
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