OpenLens is an open-source framework that replicates and benchmarks the functionality of Google Lens — enabling image-based product retrieval using deep learning and metric-learning models.
OpenLens provides a unified, extensible environment for evaluating, comparing, and deploying visual similarity models such as:
- 🧠 ResNet | EfficientNet | CLIP
- ⚙️ Siamese | Triplet | Autoencoder
- ⚡ LSH | FAISS | Hybrid ensembles
It measures precision, recall, F1, and inference latency across models to identify the optimal trade-off between accuracy and efficiency.
- 🔍 Comprehensive Model Benchmarking
- ⚙️ Unified Feature Extraction & Search Pipeline
- ⚡ FAISS / LSH for Large-Scale Retrieval
- 📊 Detailed Metrics & Comparison Reports
- 🖼️ Interactive Jupyter Notebook (search.ipynb)
- 🧩 Easy Model & Dataset Extension
├── app.py # Main application entry point
├── search.ipynb # Interactive notebook for retrieval
├── sample_dataset_creation_kaggle_script.py
├── detailed_metrics_[timestamp].csv # Per-model detailed metrics
├── model_comparison_results_[timestamp].csv
├── query_results_[timestamp].csv
├── requirements.txt
└── README.md
git clone https://github.com/meanderinghuman/OpenLens.git
cd OpenLens
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txtpython app.pyjupyter notebookOpen search.ipynb to visualize embeddings and retrieve top-K matches.
| Model | Precision | Recall | F1 | Latency | Notes |
|---|---|---|---|---|---|
| ResNet | ⭐ High | Good | ✅ Balanced | Moderate | Reliable baseline |
| CLIP | High | High | ✅ Best Cross-Modal | ⚡ Fastest | Text + Image capable |
| Triplet/Siamese | Medium | Good | ✅ Low Latency | ⚡ Fast | Ideal for real-time |
| Hybrid | Highest | High | ✅ Top F1 | 🧩 Heavy | Best production reranker |
| LSH | Medium | Medium | ⚙️ Scalable | ⚡ Very Fast | Suitable for large datasets |
- Production / High Traffic → Hybrid (LSH + ResNet reranking) + caching
- Edge / Low-Power → Quantized EfficientNet or Siamese
- Real-Time → Pre-compute embeddings + Triplet + HNSW index
image_id,product_id,category
img_001.jpg,1234,shoes
img_002.jpg,5678,bags
- Query →
/data/query/ - Gallery →
/data/gallery/
- Domain fine-tuning for CLIP
- Semantic reranking (Vision-Language)
- Web Dashboard (Streamlit/Gradio)
- Multi-modal Retrieval (Image + Text)
- FAISS-HNSW Hybrid Index
This project is licensed under the MIT License © 2025 Siddharth Pal
Maintainer: Siddharth Pal
📧 Email: siddharthpal@live.com
🔗 LinkedIn: https://linkedin.com/in/sidpnyc
“OpenLens brings transparency, replicability, and open access to visual search — empowering developers and researchers to build the next generation of intelligent retrieval systems.”
