IRIS (Image Recognition Integration System) is an AI-powered image search application that finds similar images using CLIP embeddings and FAISS vector search.
- Load Images: Backend processes all images from the
images/directory - Upload to S3: Images are uploaded to AWS S3 for cloud storage
- Generate Embeddings: CLIP model (OpenAI's vision-language model) converts each image into a 512-dimensional vector
- Build FAISS Index: All embeddings are stored in a FAISS index for fast similarity search
- Save Metadata: Image URLs and index are saved to disk (
faiss_index.bin,image_urls.npy)
- User Clicks Camera Button: Triggers device camera or file picker
- Capture Photo: Capacitor Camera API captures image
- Optimize Image: Image is compressed to WebP format to reduce size
- Generate UUID: Unique ID is created for the image
- Store Locally: Image is saved to IndexedDB (browser storage) with ID and timestamp
- Navigate: User is redirected to Image Gallery page with image ID
- Load Image: Frontend retrieves image from IndexedDB using the ID
- Send to API: Image (Base64 encoded) is sent to backend
/searchendpoint - Receive Request: Flask backend receives the image
- Decode & Save: Base64 is decoded and saved temporarily
- Generate Query Embedding: CLIP model creates embedding for the query image
- FAISS Search: System searches for top 5 most similar images using L2 distance
- Return Results: Backend returns list of S3 URLs for similar images
- Receive URLs: Frontend receives array of similar image URLs
- Display Gallery: Images are displayed in a responsive grid
- Show Query Image: Original captured image is shown at the top
- Show Similar Images: Top 5 similar images are displayed below
- Frontend: Next.js, React, TypeScript, Capacitor
- Backend: Flask, Python
- AI Model: CLIP (OpenAI's vision-language model)
- Vector Search: FAISS (Facebook AI Similarity Search)
- Storage: IndexedDB (client), S3 (cloud), FAISS index (server)
- Image Format: WebP (optimized)
User → Camera → Optimize → IndexedDB → API Request → Flask Backend
↓
CLIP Embedding
↓
FAISS Search
↓
S3 URLs → Frontend
↓
Display Results
✅ Cross-Platform: Works on web, iOS, and Android
✅ Offline Storage: Images stored locally in IndexedDB
✅ Fast Search: FAISS enables sub-second similarity search
✅ Scalable: Can handle thousands of images
✅ Optimized: Images compressed to reduce bandwidth