Giter VIP home page Giter VIP logo

greyovo / picquery Goto Github PK

View Code? Open in Web Editor NEW
193.0 2.0 19.0 50.17 MB

🔍 Search local images with natural language on Android, powered by OpenAI's CLIP model. / 在 Android 上用自然语言搜索本地图片 (基于 OpenAI 的 CLIP 模型)

Home Page: https://greyovo.github.io/PicQuery/

License: MIT License

Kotlin 89.50% Python 9.65% PureBasic 0.10% TypeScript 0.68% CSS 0.06%
android clip image-text-retrieval material-design-3 openai image-text-search jetpack-compose

picquery's Introduction

PicQuery

中文| English

cover_en

🔍 Search for your local images with natural language, running completely offline. For example, "a laptop on the desk", "sunset by the sea", "kitty in the grass", and so on.

  • Totally free, NO in-app purchases
  • Support both English and Chinese
  • Indexing and searching of images works completely offline without worrying about privacy
  • Show results in less than 1 second when searching for 8,000+ photos
  • Wait for indexing on the first time you launch, and search immediately afterward

Installation

  • Google Play - Search for “PicQuery”
  • Download APK from Release
  • If you have trouble accessing the above resources, please see here

🍎 For iOS users, please refer to Queryable (Code), the inspiration behind this application, developed by @mazzzystar.

Implementation

Thanks to @mazzzystar and @Young-Flash for their assistance during the development. The discussion can be viewed here.

PicQuery is powered by OpenAI's CLIP model.

First, the images to be searched are encoded into vectors using an image encoder and stored in a database. The text provided by the user during the search is also encoded into a vector. The encoded text vector is then compared with the indexed image vectors to calculate the similarity. The top K images with the highest similarity scores are selected as the query results.

Build & Run

To build this project, you need to obtain a quantized CLIP model.

Run the scripts in this jupyter notebook step by step. When you run into the "You are done" section, you should get the following model files in ./result directory:

  • clip-image-int8.ort
  • clip-text-int8.ort

If you don't want to run the scripts, you may directly download them from Google Drive.

Put them into app\src\main\assets and you're ready to go.

Acknowledgment

License

This project is open-source under an MIT license. All rights reserved.

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.