This repository guides to develop a Multimodal FastAPI application that leverages the CLIP model for analyzing images
or text
. The app performs semantic search to identify and retrieve nutritional information by querying a vector database, making it a powerful tool for multimodal data processing. The fastapi app is connected with web frontend-end written in Next.js for a better user interaction.
In this project, we used OpenAI CLIP
model to create images embeddings and compare them with the already created text embeddings present in the Qdrant database and give the respective nutirents. The FastAPI model takes the image file as request and after processing give the nutrients as the response.
- Fast and efficient
- Best for Diet freaks
- Text and Image multimodal searching
- Easily intgrable with frontend with FastAPI
-
Clone the repository:
git clone https://github.com/vansh-khaneja/NutrAI-Searcher-FastAPI cd NutrAI-Searcher-FastAPI
-
Set up the Python environment and install dependencies:
python3 -m venv venv source venv/bin/activate pip install -r requirements.txt
-
Set up Qdrant:
Login to Qdrant Cloud to get the api_key and url.
qdrant_client = QdrantClient( url="https://xxxxxx-xxxxx-xxxxx-xxxx-xxxxxxxxx.us-east.aws.cloud.qdrant.io:6333", api_key="<your-api-key>", )
-
Run the
data_upload.ipynb
in jupyter notebook to setup and upload data in vector database. -
Execute the
main.py
file by running this command to run the API.uvicorn main:app --reload
- For the execution of front-end refer this repository.
https://github.com/shubhamchoudhary-2003/NutrAI-Frontend
Vansh Khaneja (AI-ML/Back-end)
Shubham Choudhary (Front-end)