jina-ai / example-meme-search

Meme search engine built with Jina neural search framework. Search with captions or image files to find matching memes.

Home Page:https://examples.jina.ai/memes

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

This repo is deprecated. This code will not run with recent versions of Jina!


Jina meme search

In this repo you can find three folders to help build your own meme search engine powered by Jina.

Each of these can be run independently. You can play with a live demo or notebook (text-search only) to get a feel for it.

Note

I'm still revamping the README's, so documentation might not be fully up-to-date for a little while.

Instructions

Set up

  • Create a virtual environment
  • python get_memes.py 200000 (where 200000 is the number of memes you want to download)

Text search

cd backend-text
pip install -r requirements.txt
python app.py -t index -n 1000   # Index 1000 memes
python app.py -t search          # Open RESTful gateway

Image search

Edit app.py to set number of memes to index.

cd backend-image
pip install -r requirements.txt
python app.py -t index -n 1000   # Index 1000 memes
python app.py -t search          # Open RESTful gateway

Frontend

cd frontend
pip install -r requirements.txt
streamlit app.py

Via docker-compose

Note: This opens up the search interfaces for meme search, including the frontend. It doesn't index the data. Be sure to do that beforehand.

  1. Follow instructions above for setup and indexing (don't query anything yet)
  2. In root dir, docker-compose up

Troubleshooting

Running out of memory

If you're on Linux you can create a swapfile:

dd if=/dev/zero of=swapfile bs=1M count=10240 status=progress   # 10240mb = 10gb
chmod 600 swapfile
mkswap swapfile
swapon swapfile

About

Meme search engine built with Jina neural search framework. Search with captions or image files to find matching memes.

https://examples.jina.ai/memes

License:Apache License 2.0


Languages

Language:Python 92.9%Language:Dockerfile 6.3%Language:Shell 0.8%