Coder Social home page Coder Social logo

xjiao004 / photo-similarity-search Goto Github PK

View Code? Open in Web Editor NEW

This project forked from harperreed/photo-similarity-search

0.0 0.0 0.0 131 KB

Super simple MLX (apple silicon) CLIP based photo similarity web app

License: MIT License

Python 74.08% HTML 25.92%

photo-similarity-search's Introduction

๐Ÿ“ธ Embed-Photos ๐Ÿ–ผ๏ธ

License

Welcome to Embed-Photos, a powerful photo similarity search engine built by @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

image

๐Ÿ“‚ 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! ๐Ÿ”โœจ

photo-similarity-search's People

Contributors

harperreed avatar kpcofgs avatar ibips avatar mcfunley avatar devjoco avatar graiz avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.