https://github.com/flaribbit/imgfind
根据文本描述搜索本地图片的工具,powered by Rust + candle + CLIP
https://github.com/flaribbit/imgfind
clip-model image-processing image-recognition image-search-engine machine-learning
Last synced: 4 months ago
JSON representation
根据文本描述搜索本地图片的工具,powered by Rust + candle + CLIP
- Host: GitHub
- URL: https://github.com/flaribbit/imgfind
- Owner: flaribbit
- Created: 2023-09-15T13:56:23.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2023-10-31T08:35:14.000Z (over 1 year ago)
- Last Synced: 2024-10-15T06:07:58.381Z (4 months ago)
- Topics: clip-model, image-processing, image-recognition, image-search-engine, machine-learning
- Language: Rust
- Homepage:
- Size: 3.44 MB
- Stars: 142
- Watchers: 1
- Forks: 6
- Open Issues: 1
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
README
# 基于 CLIP 的本地图片搜索工具

[English version](#local-image-search-tool-based-on-clip)
## 安装
windows 推荐使用 scoop 一键安装
```
scoop install https://raw.githubusercontent.com/flaribbit/imgfind/master/scoop/imgfind.json
```android 可以使用 termux 下载最新 release 运行,其他系统目前只能自己编译。
## 使用方法
1. 为目录中的所有图片文件创建 embeddings,以便搜索:
```bash
./imgfind add 目录
```
2. 开启基于 web 的搜索页面
```bash
./imgfind serve 端口
```## 编译问题
windows 需要设置环境变量 `RUSTFLAGS=-Ctarget-feature=+crt-static`
```
$env:RUSTFLAGS='-Ctarget-feature=+crt-static'
```android 需要设置环境变量 `RUSTFLAGS=-C target-feature=+fp16`
```bash
export RUSTFLAGS='-C target-feature=+fp16'
```## 模型
在 [这里](https://github.com/flaribbit/imgfind/releases/download/model/clip.zip) 下载模型,解压到 `clip` 目录中。
```
.
├── clip
│ ├── model.safetensors
│ └── tokenizer.json
└── imgfind.exe
```# Local image search tool based on CLIP
## Install
For windows users, it is recommend to use scoop
```
scoop install https://raw.githubusercontent.com/flaribbit/imgfind/master/scoop/imgfind.json
```For android users, you can download latest release in termux. For other platforms, you may clone this repo and compile it yourself.
## Usage
1. Create embeddings for images in `somepath` for search:
```bash
./imgfind add somepath
```
2. Start a web server on `port` for user interface:
```bash
./imgfind serve port
```## Model
Download model from [here](https://github.com/flaribbit/imgfind/releases/download/model/clip.zip), then extract files into `clip` folder.
```
.
├── clip
│ ├── model.safetensors
│ └── tokenizer.json
└── imgfind.exe
```## FAQ during build process
On windows you need to set env `RUSTFLAGS=-C target-feature=+crt-static`
```
$env:RUSTFLAGS='-C target-feature=+crt-static'
```On android you need to set env `RUSTFLAGS=-C target-feature=+fp16`
```bash
export RUSTFLAGS='-C target-feature=+fp16'
```