This project demonstrates content-based image retrieval using Streamlit and ChromaDB.
Clone the project from GitHub:
git clone https://github.com/NguyenHuy190303/Images-Retrieval-Streamlit
cd Images-Retrieval-Streamlit
Install the required dependencies using pip:
pip install -r requirements.txt
This script is used to set up the ChromaDB and process the training dataset.
Before running the script, ensure you have the following directories set up on your system:
- Training Dataset: Store your images in the directory specified by the
ROOTS
variable. - Database Path: The ChromaDB database will be stored in the directory specified by the
db_path
variable.
Open create_images_db.py
and update the following variables:
# Path to your training dataset
ROOTS = r"D:\Python\Text_Image_Retrieval-Streamlit\data\train"
# Path to where the ChromaDB will be created/stored
db_path = r"D:\Python\Text_Image_Retrieval-Streamlit\database"
Run the script to initialize and embed vectors in the ChromaDB:
python create_images_db.py
Once the database is set up, you can run the Streamlit application:
streamlit run main.py