Skip to content

Local Lens is a privacy-first, AI-powered photo organizer for your PC. Sort and group photos by faces, dates, and locations—all locally, with no cloud upload. Enjoy a modern, intuitive UI and keep your memories organized and secure on your own device.

License

Notifications You must be signed in to change notification settings

ashesbloom/LocalLens

Repository files navigation

Local Lens

License: AGPL v3 Platform GitHub release GitHub downloads

GitHub stars GitHub forks Views


Local Lens Logo
Your Memories, Your Machine, Your Privacy.

Local Lens is the AI-powered home for your photos. Sort by face, location, and date entirely offline.

macOS and Linux support coming soon


🖥️ Software Preview

See how Local Lens organizes thousands of photos in seconds:

Local Lens Main Dashboard Face Recognition in Local Lens Photo Organization by Location

Different Modes & Themes

Different Modes of Local Lens

Dark Mode Interface Light Mode Interface

Screenshots are for illustration. UI evolves with every update.


🆚 Why Local Lens?

Feature ☁️ Cloud Services (Google/iCloud) 🔒 Local Lens
Privacy Your photos are scanned for ads/data 100% Private. Zero data leaves your PC.
Cost Monthly Subscription ($$$) Free & Open Source
Storage Limited (15GB cap) Unlimited (Limited only by your HDD)
Speed Depends on Internet speed Instant (Local Processing)
AI Processing Server-side On-Device (CNN & HOG Models)

🎯 Vision & Purpose

Local Lens revolutionizes photo management with intelligent, privacy-first automation. Designed for photographers, data hoarders, families, and anyone with terabytes of digital memories, it transforms overwhelming photo organization into an effortless, secure experience.

The Problem

Manual photo sorting is tedious. Cloud solutions get expensive and risk your privacy.

The Solution

Local Lens brings enterprise-grade AI directly to your desktop. No subscriptions, no upload times, no data harvesting.

Core Features

  • 🔒 100% Offline AI: All facial recognition and analysis runs on your hardware.
  • 👤 Face Recognition: Train the AI to recognize friends and family.
  • 🗺️ Location Intelligence: Visualizes where your photos were taken (GPS clustering).
  • 📅 Smart Timeline: Auto-sorts messy folders into chronological order.
  • ⚡ Lightning Search: Dynamic filtering by date, location, or person.
  • 🔄 Non-Destructive: Your original files are never modified; we only organize.

🧠 Under the Hood: The "Enhanced Automatic Strategy"

How do we keep it fast without crashing your PC? Local Lens uses an adaptive, two-pass strategy:

  1. The Speed Pass (HOG): We scan images using a lightweight algorithm (Histogram of Oriented Gradients). If a face is clearly visible, we log it.
  2. The Precision Pass (CNN): If the first pass is unsure, we escalate to a Convolutional Neural Network (CNN) for high-precision detection.
  3. Intelligent Fallback: If your hardware runs out of memory, the system automatically adjusts to a lighter model instantly.

This guarantees the best possible result for every photo, adapting to your specific hardware.


🖼️ Supported Formats

Whether you shoot on an iPhone or a DSLR, we've got you covered:

.jpg, .jpeg, .png, .gif, .bmp, .tiff, .webp, .heic, .heif
RAW Support: .dng, .cr2, .cr3, .nef, .arw, .raf, .avif, .psd


🏗️ Architecture

Local Lens uses a hybrid architecture combining the best of web and desktop technologies:

                          ┌───────────────────────────────────────────────────┐
                          │                 Tauri Desktop App                 │
                          │  ┌─────────────────────────────────────────────┐  │
                          │  │           React Frontend (UI)               │  |
                          │  │  • Modern React with Hooks                  │  |
                          │  │  • Vite for fast development                │  |
                          │  │  • Real-time communication with backend     │  |
                          │  └─────────────────────────────────────────────┘  │
                          │                      | |                          |
                          │  ┌─────────────────────────────────────────────┐  │
                          │  │         Python Backend (Sidecar)            │  |
                          │  │  • FastAPI REST server                      │  |
                          │  │  • AI face recognition engine               │  |
                          │  │  • Image processing pipeline                │  |
                          │  │  • Metadata extraction & analysis           │  |
                          │  └─────────────────────────────────────────────┘  │
                          └───────────────────────────────────────────────────┘

🛠️ Technology Stack

Python JavaScript React Rust FastAPI Tauri Vite

Frontend

  • Framework: React.js with modern hooks
  • Build Tool: Vite for fast development and building
  • Desktop Framework: Tauri (Rust-based) for native desktop integration
  • UI Components: Custom components with CSS modules
  • State Management: React hooks with localStorage persistence

Backend

  • Language: Python 3.11+
  • API Framework: FastAPI for high-performance REST API
  • AI/ML Libraries:
    • face_recognition - Facial detection and recognition
    • dlib - Computer vision and machine learning toolkit
    • numpy - Numerical computing
  • Image Processing:
    • Pillow - Python Imaging Library
    • Pillow-HEIF - HEIF/HEIC format support
    • rawpy - RAW image format support
  • Geolocation: reverse_geocoder for location data
  • Server: uvicorn ASGI server

Build & Distribution

  • Python Bundling: PyInstaller for creating standalone executables
  • Desktop Packaging: Tauri for cross-platform application packaging
  • Installer Generation: Platform-specific installers (.msi, .dmg, .deb, .AppImage)

📋 Prerequisites

For Normal Users

  • No prerequisites - The distributed application includes all dependencies

🚀 Quick Start

Option 1: Download Pre-built Release (Recommended)

  1. Visit the Releases page
  2. Download the installer for your platform:
    • Windows: Local_Lens_x.x.x_x64_en-US.msi
    • macOS: Releasing soon
    • Linux: Releasing soon
  3. Run the installer and follow the setup wizard
  4. Launch Local Lens from your applications menu

Option 2: Running from Source (For Developers)

This method is for developers who want to run the latest code or contribute to the project. It enables hot-reloading for both the frontend and backend.

1. Setup

First, ensure you have all the required software installed.

# 1. Clone the repository
git clone https://github.com/ashesbloom/LocalLens.git
cd LocalLens

# 2. Set up the Python backend
cd backend
python -m venv venv
# On Windows
venv\Scripts\activate
# On macOS/Linux
# source venv/bin/activate
pip install -r requirements.txt
cd ..

# 3. Set up the Node.js frontend
cd frontend
npm install
cd ..

2. Run the Application

You will need two separate terminals to run the application in development mode.

Terminal 1: Start the Backend Server

cd backend
# Activate your virtual environment if not already active
venv\Scripts\activate
# Start the server with hot-reloading
uvicorn main:app --reload

The backend will be running on http://127.0.0.1:8000.

Terminal 2: Start the Frontend Application

cd frontend
npm run tauri dev

This will open the Local Lens desktop application, which will automatically connect to your running backend server. Changes to the Python code will auto-reload the backend, and changes to the React code will auto-reload the frontend.

For Development

Required Software

Platform-Specific Requirements

Windows
  • Visual Studio Build Tools or Visual Studio Community
  • CMake - Download
macOS
brew install cmake
Linux (Ubuntu/Debian)
  • Build essentials and development tools
sudo apt update
sudo apt install build-essential cmake libopenblas-dev liblapack-dev
sudo apt install python3-dev python3-venv pkg-config
Linux (CentOS/RHEL/Fedora)
  • Development tools and dependencies
# CentOS/RHEL
sudo yum groupinstall "Development Tools"
sudo yum install cmake openblas-devel lapack-devel python3-devel

# Fedora
sudo dnf groupinstall "Development Tools"
sudo dnf install cmake openblas-devel lapack-devel python3-devel

📁 Project Structure

local-lens/
├── backend/                    # Python FastAPI backend
│   ├── main.py                # Main FastAPI application
│   ├── organizer_logic.py     # Core photo organization logic
│   ├── enrollment_logic.py    # Face recognition training
│   ├── exceptions.py          # Custom exception classes
│   ├── requirements.txt       # Python dependencies
│   ├── long_path_manifest.xml # Windows long path support
│   └── venv/                  # Python virtual environment
├── frontend/                   # React + Tauri frontend
│   ├── src/                   # React source code
│   │   ├── App.jsx           # Main application component
│   │   ├── components/       # React components
│   │   └── assets/           # Static assets
│   ├── src-tauri/            # Tauri configuration
│   │   ├── src/              # Rust source code
│   │   │   └── lib.rs        # Main Rust application
│   │   ├── tauri.conf.json   # Tauri configuration
│   │   ├── Cargo.toml        # Rust dependencies
│   │   └── icons/            # Application icons
│   ├── package.json          # Node.js dependencies
│   └── vite.config.js        # Vite configuration
├── docs/                      # Documentation
├── LICENSE                    # MIT License
└── README.md                  # This file

🤝 Contributing

We welcome contributions! Please see our Contributing Guidelines for details.

Development Workflow

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Make your changes
  4. Test thoroughly on your target platform(s)
  5. Commit your changes (git commit -m 'Add amazing feature')
  6. Push to the branch (git push origin feature/amazing-feature)
  7. Open a Pull Request

📄 License

This project is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0). See the LICENSE file for details.

🙏 Acknowledgments

  • face_recognition - Facial recognition library
  • Tauri - Desktop application framework
  • FastAPI - Modern Python web framework
  • React - Frontend framework
  • Vite - Build tool and development server

📞 Support


⛓️‍💥 Engineered with purpose by Mayank Pandey

If you found my project useful, please consider supporting me so I can build more projects like this, cuz I'm broke af: Buy Me A Coffee

Alternatively, you can scan this UPI ID:

image