Giter VIP home page Giter VIP logo

clip-image-search's Introduction

clip-image-search

A simple image search engine using CLIP feature.

Also have a look at my blog post: 基于 CLIP 模型特征搭建简易的个人图像搜索引擎

Pre-requisites

We need python3, mongodb and CLIP model library to run this project.

Python requirements

pip3 install -r requirements.txt

MongoDB Server

Start MongoDB server separately and save the address into config.json file.

You can also start a seperate MongoDB server by start.sh script in mongo_sample folder.

CLIP Model

Install CLIP python library by following the instruction in openai/CLIP

Usage

There a two stages in this project. Make sure you have already started the MongoDB server.

1. Import images

There are two modes on importing images into database: import mode and copy mode. import mode do not copy file, and you have to keep the original file later. copy mode is useful when you need to scan temp or cache folder, and you can delete the original file after importing. In both mode, the script will scan folder recursively and import all images files into database.

# import mode
python3 import_images.py /path/to/folder

# copy mode
python3 import_images.py /path/to/folder --copy

2. Start search engine

python3 server.py

3. Search Images

Search images by text

Search by image:

TODO

  • Test cases
  • Support for OCR text, using PaddleOCR
  • ElasticSearch for text search engine backend
  • Change to a vector database backend: Faiss
  • Import and search EXIF
  • Multi-language support for OCR model
  • Multi-language support for Text Search

clip-image-search's People

Contributors

atarss 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.