Skip to content

Conversation

@cabreraalex
Copy link

Description of changes:

Adds option for JPEG quality.

Issue #, if available:

Merge Checklist:

Put an x without space in the boxes that apply. If you are unsure about any checklist, please don't hesitate to ask. We are here to help! This is simply a reminder of what we are going to look for before merging your pull request.

General

  • I have read the contributor guidelines
  • This is a documentation change or typo fix. If so, skip the rest of this checklist.
  • I certify that the changes I am introducing will be backward compatible, and I have discussed concerns about this, if any, with the MosaicML team.
  • I have updated any necessary documentation, including README and API docs (if appropriate).

Tests

  • I ran pre-commit on my change. (check out the pre-commit section of prerequisites)
  • I have added tests that prove my fix is effective or that my feature works (if appropriate).
  • I ran the tests locally to make sure it pass. (check out testing)
  • I have added unit and/or integration tests as appropriate to ensure backward compatibility of the changes.

@karan6181
Copy link
Contributor

Hey @cabreraalex , thanks for creating a PR. One minor comment, can you please update your PR with the changes that are not relevant to this PR? Seems like there are some spacing changes, single/double quotes changes, etc.

@cabreraalex
Copy link
Author

oops yup, done

Copy link
Contributor

@snarayan21 snarayan21 left a comment

Choose a reason for hiding this comment

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

@cabreraalex Thanks for adding this! Would be great to have a unit test for this functionality as well before merging.

@snarayan21
Copy link
Contributor

@cabreraalex Mind addressing the review comments when you have some time? Thanks!

@cabreraalex
Copy link
Author

AFAI can tell just the config is passed, e.g. from jpeg:12 only the 12 is passed to from_str:

def _get_coder(encoding: str) -> Optional[Encoding]:

There is no formal type for the quality, just integer

self.quality = quality

@classmethod
def from_str(cls, config: str) -> Self:
Copy link
Contributor

Choose a reason for hiding this comment

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

We should probably also add a test for this too then, to also confirm what it should look like when used. Thanks!

@snarayan21
Copy link
Contributor

@cabreraalex Mind adding the test that @ethantang-db mentioned and we can get this in?

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.

Choose JPEG compression level

5 participants