0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

【Python】機械学習用にIcrawlerで画像を収集【1000枚】

Posted at

結論

# coding: utf-8
import os
from icrawler.builtin import GoogleImageCrawler

"""----------------   Settings   ------------------"""
search_word = u""#日本語の場合は、頭に"u"をつける
dir_ = "./images/"+search_word+"/"
download_num = 1000 #ダウンロードする枚数
"""--------------------------------------------------"""


if not os.path.exists(dir_):#フォルダが無ければ作る
    os.makedirs(dir_)

crawler = GoogleImageCrawler(storage={"root_dir": dir_})
crawler.crawl(keyword=search_word, max_num=download_num)
0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?