Skip to content

seanvelasco/memegraph

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

61 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

memegraph

Memegraph is a search engine and recommendation engine for memes using OpenAI's CLIP model.

Search memes via keywords, explore memes with the same template, and discover memes that are visually similar.

Don't know the name of a meme? Just describe the meme!

Guy Thinking In Bed meme

Discover memes about your favorite topics

The Office memes

Look up that obscure meme you saw

Memes about Spongebob and Myers-Briggs Type Indicator (MBTI)

Discover memes that are visually similar

Boardroom meme

New way to browse memes

Memegraph home

Development

MLX requires a Mac with an Apple Silicon processor to generate embeddings.

You can still run the app without image embeddings, but you will not be able to search for memes by image similarity.

Generate image embeddings

Install dependencies

pip install -r requirements.txt

Download OpenAI CLIP model (clip-vit-base-patch32) from Hugging Face and convert to Apple's MLX

python clip/convert.py

The model is dowloaded to mlx_model/ directory unless argument --model_dir is provided.

Modify main.py to point to the correct model, images source directory, blob storage bucket, and database.

Generate image embeddings, store images in an blob storage bucket, and store embeddings in a database

python main.py

Run the app

python app.py

Data

All memes were retrieved from the top 1000 posts of all time on Reddit's meme subreddits using PRAW on the Reddit's API free tier.