Tag

Pgvector

1 article tagged with "Pgvector"

Pet Face Recognition

Pet Face Recognition

A local-first pet registration and identification system using face recognition. No cloud AI dependencies — all processing happens locally with deterministic embeddings.

Features

  • Local-Only Architecture — No external cloud APIs; all processing done locally
  • Facial Embedding Pipeline — Extracts 256-dimensional feature vectors using classical computer vision:
    • Local Binary Patterns (LBP)
    • Histogram of Oriented Gradients (HOG)
    • Discrete Cosine Transform (DCT)
    • Color histograms (HSV)
    • Multi-scale grid pooling
  • pgvector Similarity Search — Efficient vector storage and retrieval in PostgreSQL
  • Pet Registration — Upload multiple images per pet with name and location
  • Identification — Find matching pets from uploaded images with similarity scoring

Technical Highlights

  • Deterministic embeddings — Same image always produces identical features
  • Multi-criteria matching — Similarity score + margin between matches + minimum images
  • YOLO11 for classification, segmentation, and pose estimation
  • Docker Compose for easy local development
  • FastAPI backend with React frontend

Tech Stack

LayerTechnology
FrontendReact 19 + TypeScript + Vite
BackendFastAPI + SQLAlchemy 2.0
DatabasePostgreSQL + pgvector
EmbeddingLocal deterministic pipeline
Image StorageLocal disk
Testingpytest + testcontainers

Why Local-First?

Running AI locally means no API costs, no privacy concerns, and deterministic results. The system extracts facial features using classical computer vision techniques that are reproducible and don’t depend on external services.