https://github.com/egorsmkv/ai-find-similar-objects
Rust in Action: embed your images into Qdrant and search similar objects using Rust and AI
https://github.com/egorsmkv/ai-find-similar-objects
ai computer-vision python qdrant rust tus yolo
Last synced: 5 months ago
JSON representation
Rust in Action: embed your images into Qdrant and search similar objects using Rust and AI
- Host: GitHub
- URL: https://github.com/egorsmkv/ai-find-similar-objects
- Owner: egorsmkv
- Created: 2025-01-18T20:25:27.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2025-01-18T22:13:15.000Z (9 months ago)
- Last Synced: 2025-01-18T22:26:59.382Z (9 months ago)
- Topics: ai, computer-vision, python, qdrant, rust, tus, yolo
- Language: Rust
- Homepage:
- Size: 8.79 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# `Rust in Action`: embed your images into Qdrant and search similar objects using Rust and AI
## Overview
### Goal
Show how you can use Rust in the AI field to find similar objects in a vector database.
Also, join our Telegram group about Computer Vision: https://t.me/computer_vision_uk
### Algorithm
1. Upload an image using [TUS protocol][4]
2. Detect objects on the image using [YOLO 11][3]
3. [Embed][1] each object using [**nomic-embed-vision-v1.5**][2] and save a vector into **Qdrant** with metadata
4. Upload own object to find similar ones### Components
Click here to see the list
---
Backend:
- https://github.com/s3rius/rustus
- https://github.com/actix/actix-web
- https://github.com/qdrant/qdrant
- https://github.com/qdrant/rust-client
- https://github.com/Anush008/fastembed-rs
- https://github.com/egorsmkv/yolo-inference
- https://github.com/svenstaro/miniserveFrontend:
- https://github.com/gradio-app/gradio
Devtools:
- https://github.com/astral-sh/uv
- https://github.com/astral-sh/ruff
- https://github.com/casey/just
- https://github.com/goreleaser/goreleaser
- https://github.com/evilmartians/lefthook## Install
### Install Rust
```bash
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | shrustup toolchain install nightly
rustup default nightly
```### Install `uv`
```bash
curl -LsSf https://astral.sh/uv/install.sh | sh
```### Install `just`
```bash
cargo install just
```### Install `GoReleaser`
Basically, GoReleaser was written to release Go projects but they have added Rust support recently.
Read their docs about [installation process][5].
```bash
go install github.com/goreleaser/goreleaser/v2@latest
```## Run
### Backend
#### Install & Run the TUS server
```bash
cargo install rustuscd backend/rustus
cp .env.example .env.dev
just run
```#### Install & Run the Qdrant server
```bash
cd backend/qdrantcp .env.example .env.dev
just run
```#### Install `miniserve`
```bash
cargo install miniserveminiserve --interfaces 0.0.0.0 --port 8099 ./backend/rustus/data
```### Frontend
```bash
cd frontend/# create virtual environment
uv venv --python 3.12source .venv/bin/activate
# install all dependencies
just sync# start Gradio app
just run
```### Development
#### Install `ruff`
```bash
uv tool install ruff@latest
```#### Install `lefthook`
```bash
go install github.com/evilmartians/lefthook@latestlefthook install
```---
Feel free to open an issue if you want to improve this project.
[1]: https://en.wikipedia.org/wiki/Word_embedding
[2]: https://huggingface.co/nomic-ai/nomic-embed-vision-v1.5
[3]: https://docs.ultralytics.com/models/yolo11/
[4]: https://tus.io/
[5]: https://goreleaser.com/install/