@ml2024 ml2024 / getimages.py
Created at Thu Jun 27 11:40:23 JST 2024
インターネット上から画像収集
getimages.py
Raw
# pip install icrawler

from icrawler.builtin import BingImageCrawler
crawler = BingImageCrawler(storage = {'root_dir' : './image/tflask'})
crawler.crawl(keyword = '三角フラスコ', max_num = 30)
crawler = BingImageCrawler(storage = {'root_dir' : './image/beaker'})
crawler.crawl(keyword = 'ビーカー', max_num = 30)
crawler = BingImageCrawler(storage = {'root_dir' : './image/funnel'})
crawler.crawl(keyword = 'ろうと', max_num = 30)
crawler = BingImageCrawler(storage = {'root_dir' : './image/burette'})
crawler.crawl(keyword = 'ビュレット', max_num = 30)
crawler = BingImageCrawler(storage = {'root_dir' : './image/kpipette'})
crawler.crawl(keyword = 'コマゴメピペット', max_num = 30)
crawler = BingImageCrawler(storage = {'root_dir' : './image/test_tube'})
crawler.crawl(keyword = '試験管', max_num = 30)
crawler = BingImageCrawler(storage = {'root_dir' : './image/petri_dish'})
crawler.crawl(keyword = 'ペトリ皿', max_num = 30)
crawler = BingImageCrawler(storage = {'root_dir' : './image/eggplant_flask'})
crawler.crawl(keyword = 'ナスフラスコ', max_num = 30)
crawler = BingImageCrawler(storage = {'root_dir' : './image/graduated_cylinder'})
crawler.crawl(keyword = 'メスシリンダー', max_num = 30)
crawler = BingImageCrawler(storage = {'root_dir' : './image/glass_rod'})
crawler.crawl(keyword = 'ガラス棒', max_num = 30)
crawler = BingImageCrawler(storage = {'root_dir' : './image/volumetric_flask'})
crawler.crawl(keyword = 'メスフラスコ', max_num = 30)