Created
April 6, 2019 12:42
-
-
Save waqaskhan409/2b5464b3a2fe20d02c74b03d5564509a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| # coding: utf-8 | |
| # In[3]: | |
| from PIL import Image | |
| import os | |
| # In[37]: | |
| def resizeImages(): | |
| for f in os.listdir('c:/OrganizeDatasetWateremlon/sweet/Test/verySweet/'): | |
| if f.endswith('.jpg'): | |
| e = 'c:/OrganizeDatasetWateremlon/sweet/Test/verySweet/' + f | |
| i = Image.open(e) | |
| fn , fext = os.path.splitext(f) | |
| i.thumbnail((300,300)) | |
| i.save('c:/OrganizeDatasetWateremlon/sweet/Test/verySweet/{}{}'.format(fn , fext)) | |
| # In[ ]: | |
| # In[38]: | |
| resizeImages() | |
| # In[ ]: | |
| # In[ ]: | |
| # In[18]: | |
| # In[ ]: | |
| # In[ ]: | |
| # In[ ]: | |
| # In[ ]: | |
| # In[ ]: | |
| # In[ ]: | |
| # In[ ]: | |
| # In[ ]: | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment