How to Scrape Images from Google
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
In my last post, I tried to train a deep neural net to detect brand logos in images. For that, I downloaded the Flickr27-dataset, containing 270 images of 27 different brands. As this dataset is rather small I turned to google image search and wrote a small R script to download the first 20 images for each search term.
In order to use the script you need to download phantomJS and create a small Javascript file. (See the Gist-file at the end of this post.) If you have the phantomJS.exe, the small JS-file and the R-file in one folder, you just need to run the following lines to download the images …
Good luck scraping some images from Google. I will use the script to enhance the brand logo dataset, hopefully improving my model with some better image data.
R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.