A lightweight AI-powered meme filtering tool that retrieves and analyzes memes using a combination of image and text features. It aims to support text-based meme retrieval (e.g., search by keywords like "crying girl") to find the most relevant memes from a dataset.
This notebook:
- Downloads memes from the Imgflip API.
- Extracts and processes text (if present) from memes.
- Embeds meme content using CLIP (Contrastive LanguageβImage Pre-training) from OpenAI.
- Supports search via natural language queries (e.g.,
"spongebob meme"or"crying baby"). - Evaluates relevance by comparing CLIP text/image embeddings.
- Shows a comparison for search with both memes + text and search with only memes.
β οΈ Current limitation: The Imgflip API mostly provides memes without overlaid text, which reduces performance. To get the best results, use memes with visible text.
- β
Meme scraping with
requests - β CLIP model usage for vision-language understanding
- β Cosine similarity-based ranking
- β Basic search functionality to find memes by text
- β Colab-ready (includes folder creation, saving assets, etc.)
-
Download the Notebook
- Clone this repo or download
memes.ipynb.
- Clone this repo or download
-
Or Run in Google Colab
- Upload the notebook to Google Colab.
- All meme images will be saved to
content/memes.
-
Run all cells
- It will:
- Fetch memes from the web
- Extract features via CLIP
- Allow you to search using keywords
- It will:
-
Run Without Text Search
- It will:
- Fetch the memes Collected from API
- Will Search Based on Image Alone
- Allow you to search using keywords
- Gives mediocre results
- It will:
-
Run Text Search
- It will:
- Fetch the memes Collected from Drive
- Will Search on Multi Modal Data (Image + Text)
- Allow you to search using keywords
- Gives Proper results
- It will:
Try searches like:
"crying girl""angry cat""SpongeBob""funny office"
The AI model really likes SpongeBob memes. π
- Improve OCR to extract overlaid text from image.
- Support additional meme sources (e.g., Reddit).
- Deploy a minimal web interface.