GithubHelp home page GithubHelp logo

x97425 / picquery Goto Github PK

View Code? Open in Web Editor NEW

This project forked from greyovo/picquery

0.0 0.0 0.0 44.08 MB

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

License: MIT License

Python 10.23% Kotlin 89.66% PureBasic 0.11%

picquery's Introduction

图搜 PicQuery

中文 | English

cover_cn

🔍 用平常说话的方式搜索本地相册中的图片——无需联网、本地运行

借助图搜,您可以用平常说话的方式来搜索手机里的照片。例如:“草丛中的猫咪”、“桌上的笔记本电脑”、“粉色衣服的女孩”,等等。

  • 完全免费,没有任何内购
  • 对图像的索引和搜索完全离线运行,无需担心隐私安全
  • 支持中英双语搜索
  • 为移动设备专门优化的模型,上万张照片也能1秒呈现结果
  • 只需要首次使用时进行索引,后续即可立刻搜索

获取方式

  • Google Play: 搜索 “图搜” 或 “PicQuery”,或点击上方链接
  • 从本仓库下载:Release

其他方式:

🍎 iOS 用户请使用 “寻隐”,它是图搜的灵感来源,由 @mazzzystar 开发并开源。

实现原理

感谢 @mazzzystar@Young-Flash 在本应用开发过程中的协助与讨论

本应用基于 OpenAI 的 CLIP 模型 实现。

首先将要搜索的图片通过图像编码器编码为向量,并存储到数据库中;将用户搜索时提供的文字也编码为向量,与已索引的图片向量遍历计算相似度,选取 TopK 相似度的图像集合作为查询结果。

构建运行

要构建运行本项目,需要获取量化后的 CLIP 模型。在 Colab 中 运行此 jupyter notebook,依次运行其中的脚本。当运行到 “You are done” 章节,应该可以在运行环境的 result 目录中分别得到:

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

如果不想运行脚本,也可以在 谷歌云盘 中直接下载这两个模型。

将它们放入 app\src\main\assets 中,即可构建和运行。

鸣谢

开源协议

本项目基于 MIT 许可协议开源,保留所有权利。

picquery's People

Contributors

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