Introduction to Embed-Photos
Embed-Photos is a powerful and efficient photo similarity search engine created by @harperreed. It utilizes the CLIP (Contrastive Language-Image Pre-training) model to find images that are visually similar based on textual input. This technology enables users to search for pictures with ease and accuracy.
Features
- Speed and Efficiency: The project harnesses the capabilities of the CLIP model to deliver quick and precise image searches.
- Platform Specific: Currently, Embed-Photos functions exclusively on Apple Silicon (MLX) devices.
- Data Management: It uses SQLite and Chroma for the persistent storage of image embeddings, ensuring data reliability.
- User-Friendly Interface: A web interface makes interaction straightforward, allowing users to browse and explore easily.
- Security: The application prioritizes secure image serving and handling.
- Performance Monitoring: Logging and monitoring features are included for analyzing and optimizing performance.
- Customizable Settings: Users can adjust settings using environment variables for adaptability.
Repository Structure
The project repository is well-organized, featuring the following key components:
generate_embeddings.py
: A script to generate image embeddings using the CLIP model.requirements.txt
: Contains the list of necessary Python dependencies needed to run the project.start_web.py
: A Flask web application that powers the photo similarity search functionality.templates/
: A directory holding HTML templates for the web user interface.
Getting Started
To start using Embed-Photos, follow these steps:
-
Clone the Repository:
git clone https://github.com/harperreed/photo-similarity-search.git
-
Install Dependencies:
pip install -r requirements.txt
-
Configure Settings: Set up the necessary environment variables in a
.env
file. -
Generate Image Embeddings:
python generate_embeddings.py
-
Run the Web Application:
python start_web.py
-
Access the Application: Open a web browser and go to
http://localhost:5000
to begin exploring the photo similarity search.
Future Plans
The project has several enhancements planned for the future, including replacing CLIP with Siglip, improving configuration robustness, and making the MLX dependency optional.
Acknowledgments
Embed-Photos is built on the foundation provided by Apple's MLX and the CLIP model. It also benefits from various open-source libraries. The project extends gratitude to the authors and contributors of these resources.
Happy searching!