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.
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.
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
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.