Skip to content

update readme to include best practices for image data optimization #577

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

Merged
merged 2 commits into from
May 3, 2025

Conversation

bhimrazy
Copy link
Collaborator

@bhimrazy bhimrazy commented May 2, 2025

What does this PR do?

This PR updates readme to include best practices for image data optimization.

def random_images(index):
+   # Replace with your actual image loading here (e.g., .jpg, .png, etc.)
+   # (recommended to pass as compressed formats like JPEG for better storage and optimized streaming speed)
+   # You can also apply resizing or reduce image quality to further increase streaming speed and save space.
    fake_images = Image.fromarray(np.random.randint(0, 256, (32, 32, 3), dtype=np.uint8))
    fake_labels = np.random.randint(10)

    # You can use any key:value pairs. Note that their types must not change between samples, and Python lists must
    # always contain the same number of elements with the same types.
    data = {"index": index, "image": fake_images, "class": fake_labels}

    return data

Partially resolves #573.

PR review

Anyone in the community is free to review the PR once the tests have passed.
If we didn't discuss your PR in GitHub issues there's a high chance it will not be merged.

Did you have fun?

Make sure you had fun coding 🙃

Copy link

codecov bot commented May 2, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 79%. Comparing base (1dadc00) to head (75f92bf).
Report is 2 commits behind head on main.

Additional details and impacted files
@@         Coverage Diff         @@
##           main   #577   +/-   ##
===================================
  Coverage    79%    79%           
===================================
  Files        40     40           
  Lines      6111   6111           
===================================
  Hits       4812   4812           
  Misses     1299   1299           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@tchaton tchaton merged commit 96238b6 into main May 3, 2025
29 checks passed
@tchaton tchaton deleted the bhimrazy-patch-1 branch May 3, 2025 07:34
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.

Error in the Getting Started Example -- default_collate cannot handle PIL.Images
2 participants