https://github.com/harperreed/photo-similarity-search
Super simple MLX (apple silicon) CLIP based photo similarity web app
https://github.com/harperreed/photo-similarity-search
ai clip ml mlx osx
Last synced: 18 days ago
JSON representation
Super simple MLX (apple silicon) CLIP based photo similarity web app
- Host: GitHub
- URL: https://github.com/harperreed/photo-similarity-search
- Owner: harperreed
- License: mit
- Created: 2024-03-26T18:31:41.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-05-17T07:37:34.000Z (11 months ago)
- Last Synced: 2025-03-28T22:14:08.361Z (25 days ago)
- Topics: ai, clip, ml, mlx, osx
- Language: Python
- Homepage:
- Size: 128 KB
- Stars: 478
- Watchers: 3
- Forks: 35
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-technostructure - harperreed/photo-similarity-search
- awesome-technostructure - harperreed/photo-similarity-search
README
# 📸 Embed-Photos 🖼️
[](LICENSE)
Welcome to Embed-Photos, a powerful photo similarity search engine built by [@harperreed](https://github.com/harperreed)! 🎉 This project leverages the CLIP (Contrastive Language-Image Pre-training) model to find visually similar images based on textual descriptions. 🔍🖼️
## 🌟 Features
- 🚀 Fast and efficient image search using the CLIP model
- 💻 Works on Apple Silicon (MLX) only
- 💾 Persistent storage of image embeddings using SQLite and Chroma
- 🌐 Web interface for easy interaction and exploration
- 🔒 Secure image serving and handling
- 📊 Logging and monitoring for performance analysis
- 🔧 Configurable settings using environment variables## Screenshot

## 📂 Repository Structure
```
embed-photos/
├── README.md
├── generate_embeddings.py
├── requirements.txt
├── start_web.py
└── templates
├── README.md
├── base.html
├── display_image.html
├── index.html
├── output.txt
└── query_results.html
```- `generate_embeddings.py`: Script to generate image embeddings using the CLIP model
- `requirements.txt`: Lists the required Python dependencies
- `start_web.py`: Flask web application for the photo similarity search
- `templates/`: Contains HTML templates for the web interface## 🚀 Getting Started
1. Clone the repository:
```
git clone https://github.com/harperreed/photo-similarity-search.git
```2. Install the required dependencies:
```
pip install -r requirements.txt
```3. Configure the application by setting the necessary environment variables in a `.env` file.
4. Generate image embeddings:
```
python generate_embeddings.py
```5. Start the web application:
```
python start_web.py
```6. Open your web browser and navigate to `http://localhost:5000` to explore the photo similarity search!
## Todo
- Use siglip instead of clip
- add a more robust config
- make mlx optional## 🙏 Acknowledgments
The Embed-Photos project builds upon the work of the Apple (mlx!), the CLIP model and leverages various open-source libraries. We extend our gratitude to the authors and contributors of these projects.
Happy searching! 🔍✨