Skip to content

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

Cortex AI Gallery 🖼️🚀

Cortex AI Gallery is a sophisticated, AI-powered media management system designed for high-performance indexing, searching, and organizing of personal photo and video collections. It combines a modern FastAPI backend with a high-fidelity Flutter mobile frontend.

✨ Key Features

🧠 Intelligent Backend (FastAPI + AI)

  • Face Analysis & Clustering: Uses InsightFace for industrial-grade face detection, age/gender estimation, and automatic person grouping using DBSCAN clustering.
  • Natural Language Search: Implements Salesforce/BLIP for automatic image captioning, enabling you to search your gallery using descriptive text (e.g., "mountain sunset").
  • Efficient Media Pipeline: Dual-stage upload with pre-flight hash checks to avoid duplicates and a background worker system for non-blocking AI processing.
  • Modular Architecture: Clean, enterprise-ready folder structure separating API routes, database logic, and AI services.
  • Smart Thumbnails: Automatic generation of optimized thumbnails for both images and videos.

📱 Premium Frontend (Flutter)

  • Fluid User Experience: Built with Flutter for a smooth, native feel across mobile platforms.
  • Smart Gallery: Paginated "lazy loading" of media to minimize data usage and maximize performance.
  • People Discovery: Auto-generated profiles for detected persons, allowing you to filter your gallery by individuals.
  • Advanced Filters: Combine text search, person filters, and demographic data (age/gender) to find exactly what you're looking for.

📂 Project Structure

Cortex-AI-Gallery/
├── backend/                # FastAPI Application
│   ├── app/
│   │   ├── api/            # API Route definitions
│   │   ├── core/           # Configuration & Global settings
│   │   ├── db/             # Database initialization & Session management
│   │   ├── models/         # Pydantic schemas for request/response
│   │   ├── services/       # AI logic, Workers, & Media processing
│   │   └── main.py         # Application entry point & Lifespan
│   ├── requirements.txt    # Python dependencies
│   └── .env.example        # Environment variable template
├── frontend/               # Flutter Mobile App
│   ├── lib/
│   │   ├── models/         # Data models
│   │   ├── providers/      # State management
│   │   ├── screens/        # UI Pages
│   │   ├── services/       # API integration layer
│   │   └── widgets/        # Reusable UI components
│   └── pubspec.yaml        # Flutter configuration
└── README.md               # Main Documentation (You are here)

🚀 Getting Started

Backend Setup

  1. Navigate to backend:
    cd backend
  2. Install Dependencies:
    pip install -r requirements.txt
    Note: Requires Python 3.9+ and PyTorch for AI features.
  3. Configure Environment:
    cp .env.example .env
    # Edit .env to adjust ports or storage paths if needed
  4. Run the Server:
    python -m app.main
    The API will be available at http://localhost:8000 with interactive docs at /docs.

Frontend Setup

  1. Navigate to frontend:
    cd frontend
  2. Install Packages:
    flutter pub get
  3. Configure API: Open lib/services/api_service.dart and update _baseUrl to point to your backend IP.
  4. Launch App:
    flutter run

🛠️ Technology Stack

  • Backend: Python, FastAPI, SQLite (aiosqlite), InsightFace, BLIP (Transformers), PyTorch, OpenCV, Scikit-learn.
  • Frontend: Dart, Flutter, Dio (HTTP client).
  • Core Logic: Multi-process/Multi-thread execution pools for handling heavy AI workloads.

📜 License

This project is licensed under the MIT License - see the LICENSE file for details.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages