Skip to content

BarathwajAnandan/EasyEdit

Repository files navigation

Easy EdIT

Easy EdIT is an interactive image processing and analysis platform that lets you edit images using natural language. Built with Python, it combines Streamlit's user interface with OpenCV and NumPy for image manipulation, powered by AI agents that understand your intent and execute the appropriate operations.

Why Easy EdIT?

  • 🎯 Simplicity First - Edit images without being an OpenCV expert. Just describe what you want to do in plain English.
  • 🔒 Privacy Focused - Process images locally instead of uploading to multiple online services.
  • 📖 Documentation Made Easy - Bypass the complexity of OpenCV/NumPy documentation by using natural language queries.
  • 🌟 Open Source - Free, transparent, and community-driven development.

Key Features

Natural Language Image Processing

  • Edit images by describing what you want in plain English
  • Intelligent AI agents translate your requests into precise OpenCV/NumPy operations
  • Version control system for your edits (similar to git)

Interactive Interface

  • Real-time image preview and side-by-side comparison
  • Click-to-get coordinates for precise editing
  • Detailed processing history with undo capabilities
  • Download processed images in PNG, JPG, or PDF formats

Supported Operations

  • Current supports most one line edits.
  • Image Editing: Resize, blur, draw shapes, add text, and more
  • Image Analysis: Get dimensions, pixel values, and other properties
  • Full list of tested operations in ( Need help to add more operations and test them):
    • functions.txt (editing operations)
    • analysis_functions.txt (analysis operations)
  • Add custom functions if they don't exist in cv2 - for eg - Crop has no function in cv2.

Note: Currently, multi-line code edits, such as Hough Circle detection, "Convert to Grayscale and resize...", "Add blur and draw circles", are not supported.

Examples:

❌ HoughCircle detection
❌ Convert to Grayscale and resize
❌ Add blur and draw circles
❌ Draw circle and rectangle at 0,0
❌ Crop the image and resize

✅ draw rectangle from 100,100 with h,w as 100,200
✅ draw circle with radius 10 and at the center of the image
✅ Crop image from 0,0 to 100,200
✅ Blur the image
✅ Convert image to grayscale
✅ Resize to 700x700

Still a WIP : Main idea was to make sure you get one liners accurately before going to multiline snippet edits. 🫡

Getting Started

Prerequisites

  • Python 3.7+
  • Git

Installation

  1. Clone the Repository

    git clone https://github.com/BarathwajAnandan/EasyEdit.git
    cd EasyEdit
  2. Set Up Environment

    python -m venv venv
    source venv/bin/activate  # On Windows: venv\Scripts\activate
    pip install -r requirements.txt
  3. Configure API Keys

    Create a .env file with your API keys:

    GROQ_API_KEY=your_groq_api_key_here    # from console.groq.com
    SNOVA_API_KEY=your_snova_api_key_here  # from cloud.sambanova.ai/apis

    Get your API keys from:

  4. Launch the App

    Start the app from the project root with:

    streamlit run swarm_ui.py

    This will launch the Easy EdIT interface in your default web browser and local host automatically.

How It Works

Easy EdIT uses a pipeline of specialized AI agents to:

  1. Parse your natural language query
  2. Determine the appropriate image processing operations
  3. Execute the operations using OpenCV/NumPy
  4. Provide human-friendly feedback

Try out a couple examples here

Project Structure

.
├── swarm/
│   ├── swarm_ui.py          # Streamlit-based UI for image upload, display, and query interaction
│   ├── clients.py           # API key configuration and provider selection
│   ├── main.py              # Core image processing logic and integration with AI agents
│   └── agents.py            # Definitions of agents for query parsing, function parameter construction, and result interpretation
├── .env                     # Environment configuration file (API keys, etc.)

Contributing

We welcome contributions! Whether it's adding new features, improving documentation, or reporting bugs, please feel free to:

  • Open an issue
  • Submit a pull request
  • Help test and improve our AI agents
  • Stars are always appreciated ;)

License

MIT License

Acknowledgements

Built with:

This project leverages the power of OpenAI Swarm, Streamlit, OpenCV, NumPy, Sambanova, Groq, and AI agents for an interactive and intelligent image processing experience.

About

Do basic Image edits using Natural Language

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages