Skip to content

Open-source visual search framework inspired by Google Lens — benchmarked across CNNs, CLIP, and metric-learning models.

License

Notifications You must be signed in to change notification settings

meanderinghuman/OpenLens

Repository files navigation

OpenLens Logo

Python Framework License Build Contributions Status

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.


🌐 Overview

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.


🧭 Features

  • 🔍 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

🏗️ Repository Structure

├── 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

⚙️ Installation

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.txt

🚀 Usage

🖥️ Run the Application

python app.py

🧪 Use the Jupyter Notebook

jupyter notebook

Open search.ipynb to visualize embeddings and retrieve top-K matches.


📊 Results Summary

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

🧰 Deployment Recommendations

  • Production / High Traffic → Hybrid (LSH + ResNet reranking) + caching
  • Edge / Low-Power → Quantized EfficientNet or Siamese
  • Real-Time → Pre-compute embeddings + Triplet + HNSW index

📦 Dataset Format

image_id,product_id,category
img_001.jpg,1234,shoes
img_002.jpg,5678,bags
  • Query → /data/query/
  • Gallery → /data/gallery/

🧩 Roadmap

  • Domain fine-tuning for CLIP
  • Semantic reranking (Vision-Language)
  • Web Dashboard (Streamlit/Gradio)
  • Multi-modal Retrieval (Image + Text)
  • FAISS-HNSW Hybrid Index

🧾 License

This project is licensed under the MIT License © 2025 Siddharth Pal


📬 Contact

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.”

About

Open-source visual search framework inspired by Google Lens — benchmarked across CNNs, CLIP, and metric-learning models.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published