-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Made changes to image transformer. #3975
base: master
Are you sure you want to change the base?
Made changes to image transformer. #3975
Conversation
images = [Image.fromarray(x).resize(self.size) for x in images] | ||
return np.array(images), y, w | ||
|
||
if self.transform_X: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@aaronrockmenezes Can you add a unit test for the new functionality?
@@ -1943,25 +1943,36 @@ def UG_to_DAG(self, sample: ConvMol) -> List: | |||
|
|||
|
|||
class ImageTransformer(Transformer): | |||
"""Convert an image into width, height, channel | |||
""" | |||
Transforms images to a specified size. | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a usage example here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, can you expand the docstring to be more informative?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM once docs added and mypy issue resolved
Description
Current Image Transform uses a scipy method that has been dropped and is no longer functional.
I've added the ImageTransformer method to allow Resizing of images within ImageDatasets (or NumpyDatasets).
Both input data (X) and labels (y) can be transformed.
Uses only Pillow.
Type of change
Please check the option that is related to your PR.
Checklist
yapf -i <modified file>
and check no errors (yapf version must be 0.32.0)mypy -p deepchem
and check no errorsflake8 <modified file> --count
and check no errorspython -m doctest <modified file>
and check no errors