[PYTHON] Image collection method

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.

Execution environment

MacOS、Python3.6(anaconda)、VSCode

Last time

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.

The method used 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.

Summary

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

Image collection method
Kaggle Kernel Method Summary [Image]
Image collection by web scraping
Image Processing Collection in Python
Manim's method 7
Manim's method 13
Manim's method 2
Manim's method 18
Manim's method 17
Manim's method 5
Manim's method 15
Manim's method 16
Manim's method 20
Binary method
Manim's method 10
Manim's method 9
Image denoising
Manim's method 6
Manim's method 21
Manim's method 4
Manim's method 8
Manim's method 14
Image recognition
Image collection using Google Custom Search API
Manim's method 22
Image crawler
Manim's method 19
Manim's method 12
Special method
Special method