Last active
October 18, 2018 08:15
-
-
Save faisalburhanudin/553c146c97b3097543b68e88978694b0 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
| from google_images_download import google_images_download | |
| def download_datasets(keyword: str, saver, limit: int = 100): | |
| """Download image from google and save object to saver | |
| :param keyword: keyword search | |
| :param saver: function for save image | |
| :param limit: limit per download | |
| """ | |
| response = google_images_download.googleimagesdownload() | |
| absolute_image_paths = response.download({ | |
| "keywords": keyword, | |
| "limit": limit | |
| }) | |
| for key, value in absolute_image_paths.items(): | |
| # save images, change to your storage function | |
| saver(value, key) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment