Skip to content

avary8/Image-Download-for-Reddit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 

Repository files navigation

Image-Download-for-Reddit

Download Specific Images from Reddit using an AI model, Google Vision

Contents

Project Description

This script will take three inputs from the user

  • a subreddit name
  • a thing you want to search
  • number of pictures you want saved

This script will then search for any pictures in the subreddit. Those pictures are run through Google Vision's API and are downloaded to a users computer in a folder called "SavedReddit/" + name of search. The pictures are only downloaded if Google Vision's API returns a list of labels or descriptors that match the keyword the user wants.

Implemented Features

  • the program will validate the existence of a subreddit. If a user types a subreddit that does not exist, the program will ask for a valid one.
  • the program will stop searching after a certain constraint in order to not spam Reddit's API
  • Not only can the user can search a specific object, but also a specific color. The script will compare the rgb values of Google Vision's dominant colors
  • when comparing dominant colors, the script will only compare a certain amount to limit incorrect color matching

Example Run

Right now I am limited to a command line interface; however, in the future, I plan to change this.

Searching for 20 cat images in r/cats

main py - swamphacks - Visual Studio Code 1_29_2023 10_17_46 AM

20 cats images downloaded in the path declared in the script

cats_results

Usage

Right now, this script is more of a personal use; however, in the future, I hope to expand its capabilities.

  • Python in VSC
  • Google API service account
  • Reddit API credentials

Possible Future Implementation

  • allowing user to enter multiple words
  • more use of Google Vision API such as people detection, only downloading images of a high resolution, etc)
  • a website/better distributable implementation of this script (a website that could allow users to access the Reddit API and Google API without needed the licenses themselves)

About

Using the Google Vision API and the Reddit API, this script will search and download all images a user wants in a certain subreddit.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages