Skip to content

Latest commit

 

History

History
270 lines (216 loc) · 7.49 KB

README.md

File metadata and controls

270 lines (216 loc) · 7.49 KB

Saka

A Modern AI-Powered Video Enhancement Microservice

Saka Logo

Python 3.10+ CUDA 11.8+ Docker License

🌐 Overview

Saka is a high-performance video enhancement platform that leverages state-of-the-art AI models to upscale and improve video quality. Built with scalability and performance in mind, it offers both API and CLI interfaces for seamless integration into existing workflows.

✨ Key Features

Category Features
Enhancement Capabilities • 2x/4x Video Upscaling
• Anime-Optimized Processing
• Artifact Removal
• Face Enhancement
Performance • GPU Auto-Scaling
• Dynamic Batch Processing
• Asynchronous Operations
• Multi-GPU Support
Infrastructure • S3-Compatible Storage
• Real-time Monitoring
• Docker Support
• Quality Metrics (SSIM)

🏡 System Architecture

flowchart TD
    A[Client] -->|HTTP Request| B[serve_enhancer.py]
    B -->|Load Model| C[Real-ESRGAN]
    B -->|Config| D[configs/]
    C -->|Process| E[GPU Processing]
    E -->|Enhanced Video| F[storage.py]
    F -->|Store| G[S3/Local Storage]
    B -->|Metrics| H[Prometheus]
    H -->|Monitor| I[Grafana]
    
    subgraph Saka Microservice
        B
        C
        D
        E
        F
    end
    
    subgraph Monitoring
        H
        I
    end
    
    subgraph Storage
        G
    end
Loading

🚀 Getting Started

Prerequisites

  • NVIDIA GPU with CUDA 11.8+
  • Docker 20.10+ (for containerized deployment)
  • Python 3.10+
  • 16GB+ RAM recommended

Installation

  1. Clone the Repository
    git clone --recursive https://github.com/vikramxD/saka.git
    cd saka
  2. Set Up Python Environment
    python -m venv venv
    source venv/bin/activate  # On Windows: .\venv\Scripts\activate
    pip install -r requirements.txt
  3. Configure Environment
    cp .env.example .env
    # Edit .env with your configuration

Docker Deployment

  1. Build and Run with Docker Compose
    docker-compose up -d
  2. Check Service Status
    docker-compose ps

💻 Usage

API Interface

from saka.client import VideoEnhancerClient

# Initialize client
client = VideoEnhancerClient()

# Enhance video
result = client.enhance_video(
    input_path="input.mp4",
    upscale_factor=2,
    calculate_ssim=True
)

print(f"Enhanced video available at: {result['output_url']}")

CLI Interface

# Basic enhancement
saka enhance video.mp4 --output enhanced.mp4

# Advanced options
saka enhance video.mp4 --scale 4 --quality high --model anime

📎 Configuration

Core Settings (configs/settings.py)

class Settings(BaseSettings):
    realesrgan: UpscalerSettings = UpscalerSettings()
    api: APISettings = APISettings()
    s3: S3Settings = S3Settings()

Available Environment Variables

Variable Description Default
SAKA_MODEL_PATH Path to model weights ./models
SAKA_GPU_IDS GPUs to use (comma-separated) 0
SAKA_BATCH_SIZE Processing batch size 4
SAKA_API_PORT API server port 8000

📊 Monitoring

Metrics Dashboard

Access the Grafana dashboard at http://localhost:3000 with default credentials:

  • Username: admin
  • Password: admin

Key Metrics

  • GPU Utilization
  • Processing Latency
  • Memory Usage
  • Batch Processing Efficiency
  • SSIM Quality Scores

Setup Monitoring Stack

./scripts/setup_monitoring.sh

📁 Project Structure

saka/
── api/                 # API implementation
──     ─ client.py       # Client library
──     ─ serve.py        # API server
──     ─ storage.py      # Storage handlers
── configs/            # Configuration
──     ─ settings.py     # Core settings
──     ─ models.py       # Model configs
── models/             # Model implementations
── scripts/            # Utility scripts
── tests/              # Test suite
── docker/             # Docker configurations

📜 Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

📖 License

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

🙂 Acknowledgments


Made with ❤ by VikramxD

DocumentationIssuesContributing