Skip to content

Added ppm support and fixed attribute types #191

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

AshAnand34
Copy link
Contributor

This pull request introduces support for handling PPM image files in the autodistill library, along with corresponding tests to ensure functionality. The changes include updates to the load_image function, enhancements to the split_data function, and new test cases to validate PPM support.

Enhancements to PPM handling:

  • autodistill/helpers.py: Added special handling for PPM files in the load_image function, including fallback mechanisms for different formats (PIL, cv2, and numpy).
  • autodistill/helpers.py: Updated the split_data function to convert .ppm images to .jpg during preprocessing, ensuring consistency with other image formats. [1] [2]

New tests for PPM support:

  • test/test_load_image.py: Added test cases to validate PPM file loading for all supported return formats (PIL, cv2, and numpy). Also included tests for error handling with non-image files.
  • test/test_ppm_support.py: Introduced a utility to create test PPM files and added a standalone test script to verify PPM loading functionality.

Minor updates for test setup:

@CLAassistant
Copy link

CLAassistant commented May 14, 2025

CLA assistant check
All committers have signed the CLA.

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.

2 participants