ultralytics / flickr_scraper

Simple Flickr Image Scraper
https://ultralytics.com
GNU Affero General Public License v3.0
207 stars 62 forks source link
flickr flickr-api image-downloader image-downloader-python image-scraper image-scraping photos scraper


Ultralytics logo

🚀 Introduction

Flickr scraper is a Python tool designed to help you gather images from Flickr to create datasets for YOLO training. Given your search criteria, this tool simplifies the process of collecting relevant images for various computer vision tasks.

Ultralytics Actions Discord Ultralytics Forums

🌟 Key Features

🔧 Requirements

Ensure you have Python 3.7 or later installed. The required dependencies can be installed using:

pip install -U -r requirements.txt

Key packages include:

🛠 Install

To set up the Flickr scraper, follow these steps:

git clone https://github.com/ultralytics/flickr_scraper
cd flickr_scraper
pip install -U -r requirements.txt

⚙️ Run

Before you begin:

  1. Obtain a Flickr API key here.

  2. Insert your API key and secret into flickr_scraper.py:

# Replace with your Flickr API key and secret
key = "YOUR_API_KEY"
secret = "YOUR_API_SECRET"
  1. Execute the script with your search criteria. Specify the number of images to fetch (--n) and use --download to save the images locally. Downloaded images are saved to flickr_scraper/images. Keep in mind Flickr's rate limits and terms of use. Learn more from the Flickr API documentation.

Example command:

python3 flickr_scraper.py --search 'honeybees on flowers' --n 10 --download

You will see output similar to:

0/10 https://live.staticflickr.com/21/38596887_40df118fd9_o.jpg
...
9/10 https://live.staticflickr.com/1770/43276172331_e779b8c161_o.jpg
Done. (4.1s)
All images saved to /Users/glennjocher/PycharmProjects/flickr_scraper/images/honeybees_on_flowers/

Images are then available in the specified folder, ready for further processing or training.

📜 Cite

If our project assists in your research or work, please consider citing it:

DOI

🤝 Contribute

We welcome contributions from the community! Whether you're fixing bugs, adding new features, or improving documentation, your input is invaluable. Take a look at our Contributing Guide to get started. Also, we'd love to hear about your experience with Ultralytics products. Please consider filling out our Survey. A huge 🙏 and thank you to all of our contributors!

Ultralytics open-source contributors

©️ License

Ultralytics is excited to offer two different licensing options to meet your needs:

📬 Contact Us

For bug reports, feature requests, and contributions, head to GitHub Issues. For questions and discussions about this project and other Ultralytics endeavors, join us on Discord!


Ultralytics GitHub space Ultralytics LinkedIn space Ultralytics Twitter space Ultralytics YouTube space Ultralytics TikTok space Ultralytics BiliBili space Ultralytics Discord