Skip to content
This repository has been archived by the owner. It is now read-only.
Use Reddit’s API to download trending memes while using basic image recognition to classify memes
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
comparisons
examples
memes
.editorconfig
.gitignore
LICENSE
README.md
RedditAPI.py
bayesText.py
classify.py
naiveBayesBasic.py
naiveBayesDensity.py
recommender.py

README.md

reddit-meme-py

Our goal is to use Reddit’s API to download trending memes while using basic image recognition to classify memes.

How it works

The algorithm works by comparing any given image to one of many pre-labeled memes in the comparisons/ directory. The comparsion algorithm first resizes the comparison images to the input image and then basically compares the individual RGB values for each pixel. This strategy is loosely the Euclidean distance classifier since we only compare against one sample per class.

Dependencies

Both numpy and opencv are dependencies for this project. Installing:

$ sudo pip install opencv
$ sudo pip install numpy

Usage

To classify an image on your local machine:

$ python classify.py /path/to/image

To classify an online image resource, add the --url flag:

$ python classify.py http://image.url/path/to/image --url

For verbose output, add the --verbose flag:

$ python classify.py /path/to/image --verbose

Set a different comparison meme directory via the --comparisons_dir:

$ python classify.py /path/to/image --comparisons_dir /path/to/comparisons

Future Work

  • Build a meme rating system
  • Build a recommending system based on user ratings
  • Extend computer vision to extract text from memes
  • Further classify and recommend memes using text as well as the meme type
You can’t perform that action at this time.