-
Notifications
You must be signed in to change notification settings - Fork 7.1k
RandomHorizontalFlip can handle both PIL Image and numpy ndarray #141
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
Conversation
I wonder if we want to support different transforms on numpy arrays, instead of only on PIL images. |
So the problem I am having is that conversion of numpy arrays to PIL images requires me to truncate the data to type Since the horizontal flip is the easiest way to improve performance, I went ahead and added the numpy compatibility to it. I can do it for other transforms as well but I agree that this needs to be a decision across the board. |
Wait, do you have the latest |
I have the latest version of Also, I didn't realize there was a |
Just confirmed. The |
Hum... can you tell me how you load your images (are they saved in image format or you load from binary blobs, like |
@fmassa terribly sorry. I completely forgot about this. I am loading the raw images and then performing operations as needed. |
@varunagrawal The I'm not sure support for numpy arrays in transforms is necessary at this point as you can keep 32-bit precision throughout the transforms. @fmassa wdyt? |
I think we should avoid using If the Maybe a possibility is to get inspiration from |
Closing this for now, but please send a PR for |
@alykhantejani since |
* remove stuff that isn't part of resnet * Port changes from TensorFlow official models version of ResNet to the MLPerf reference. add gitignore with python suffixes store log output from resnet run fix typo use different model dirs for different seeds (convenient for multiple runs on the same machine) remove no-op .take() from input pipeline put a copy of the compliance dir in this branch. This just makes it slightly less painful to keep these utils synced across branches * compliance dir fork is not unnecessary * remove pycache * cull more pyc files * minor tweaks * fix comment * another comment fix
This PR allows one to use the
RandomHorizontalFlip
transform on numpy arrays as well.