Multimodal search lets you use one type of data (in this case, text) to search another type of data (in this case, images). This example leverages core Jina technologies that make it simpler to build and run your search, including:
The front-end is built in Streamlit.
We've got a live demo for you to play with.
There are multiple ways you can run this:
git clone https://github.com/jina-ai/example-multimodal-fashion-search.git
python ./get_data.py
JCloud lets you run the fashion backend Jina Flow on the cloud, without having to use your own compute.
pip install jcloud
cd backend
jc login
jc deploy jcloud
After that you can use Jina Client to connect and search/index your data.
This will spin up:
/backend/workspace
. You can tweak how many Documents to index in docker-compose.yml
. You can also comment out the backend-index
section in docker-compose.yml
if you've already indexed and don't want to re-index.docker-compose up
pip install -r requirements.txt
Then, in backend
:
python app.py -t index -n 1000 # index 1000 images
python app.py -t serve
To open the frontend, go to the frontend
directory and run streamlit run frontend.py
data
directory for that of the hi-res dataset for nicer-looking results.stacks: "sqlite3.IntegrityError: UNIQUE constraint failed: table_0._doc_id\n"
This is because you're trying to index data that's already been indexed. The database we use has a UNIQUE
constraint that means it won't index duplicate data. You can fix this by:
backend/workspace
(this will delete your entire index)backend-index
section from docker-compose.yml