I wanted to implement image recognition, so I decided to fetch the data. This time I would like to take a picture of a man and a picture of a woman.
MacOS、Python3.6(anaconda)、VSCode
Last time, I used google_images_download to collect images, but since google_images_download could only collect up to 100 images, I had to execute it many times, and I felt it was troublesome, so I also collected more than 100 images. I wondered if there was a way to get it, so I searched for it and found it! A must read for those who want to easily collect image data with Python! Introduction to icrawler I used icrawler to get the data this time.
pip install icrawler
Do this and install icrawler first. And with the text editor I'm using
from icrawler.builtin import BingImageCrawler
crawler = BingImageCrawler(storage={"root_dir":"file name"})
crawler.crawl(keyword=“Name of what you want to collect”, max_num=Number of images)
When I did this and collected the images, I was able to collect more than 100 images.
More icrawlers are collected and it's not that hard, so the benefits of icrawlers are great so far. Also, as you use it from now on, you may understand the merits of google_images_download, so I would like to study again.
Recommended Posts