Files
dekupai/README.md
T

105 lines
5.9 KiB
Markdown

# Dekupai 🍊
### *Premium Glassmorphic AI Background Remover & Decoupage Studio*
Developed by **Turunçgil AI**, **Dekupai** is a state-of-the-art desktop application built on **ElectronJS** that leverages the cutting-edge **BiRefNet** (Bilateral Reference Network) deep learning model for extremely high-resolution, pixel-perfect background extraction and image matting.
With a beautiful, modern **Glassmorphic interface** themed with glowing neon citrus accents, **Dekupai** bridges the gap between complex AI segmentation workflows and elite creator utilities, enabling instant edge-accurate transparent subject isolation, visual cropping, auto-trimming, custom background compositing, and professional asset exporting.
---
## ✨ Features
- 🍊 **Turunçgil Brand Accentuation**: Stunning glassmorphic dark theme styled with heavy back-filters (`backdrop-filter: blur(28px)`) and organic glowing neon orange and golden orbs.
- 🧠 **BiRefNet Neural Engine**: State-of-the-art segmentation that handles intricate visual details (e.g. hair, thin lines, translucent materials) using a lightweight CPU-optimized local inference pipeline.
- ⚙️ **Integrated Environment Setup**: An automated initial setup overlay that checks, builds, and configures an isolated Python virtual environment (`.venv`) and downloads requirements automatically.
- 📐 **Interactive Cropper Studio**: Full integration with `Cropper.js` enabling precise bounding boxes, standard aspect presets (Square, Story, Cinema, Portrait), 90-degree rotations, and horizontal/vertical mirroring.
-**Native Auto-Trim**: A high-performance client-side pixel iteration algorithm that scans the active transparent alpha borders and instantly snaps the crop boundaries tight around your subject.
- 🎨 **Creative Background Compositor**:
- **Transparent Mode**: Keeps alpha transparency (perfect for png stickers and web assets).
- **Solid Colors**: Burns clean flat fills with quick-selection swatches and a custom color wheel picker.
- **Premium Gradients**: Composes gorgeous, pre-curated linear gradients behind your isolated subject in real-time.
- 💾 **Lossless Export Studio**: Composite and save final assets to **PNG (transparent)**, **JPEG**, or **WebP** formats with configurable quality parameter sliders using native system dialogs and helpful "Show in Folder" explorer shortcut notifications.
---
## 📂 Directory Tree
The project structure is organized cleanly as follows:
```text
Dekupai/
├── backend/
│ ├── requirements.txt # Python dependency library list (torch, transformers, timm, einops, etc.)
│ ├── setup.py # Automated virtual environment builder and dependency installer
│ └── process.py # BiRefNet background segmentation processor (runs local AI inference)
├── node_modules/ # Electron & frontend packages (Ignored in Git)
├── .git/ # Git tracking files
├── .venv/ # Python isolated environment (Ignored in Git)
├── .gitignore # Git ignore instructions
├── package.json # Node project scripts, metadata, and dependencies
├── package-lock.json # Node dependency lock file
├── main.js # Electron main process (IPC handlers, dialogs, python executors)
├── preload.js # Secure sandbox context bridge mapping IPC communications
├── index.html # Main HTML5 layout and inline SVG vectors
├── styles.css # Glassmorphism styling variables, colors, and layout configurations
├── renderer.js # Renderer logic, drag-drop loops, cropper lifecycles, and export generators
└── README.md # Project documentation (This file)
```
---
## 🚀 Getting Started
### Prerequisites
Ensure you have the following installed on your machine:
* [Node.js](https://nodejs.org/) (v18 or above recommended)
* [Python](https://www.python.org/) (v3.10 to v3.12 recommended)
* [Git](https://git-scm.com/)
### Installation & Run
1. **Clone the Repository** (or move into the project directory):
```bash
cd d:\Works\2026\BiRefNet
```
2. **Install Node Dependencies**:
```bash
npm install
```
3. **Boot the Application**:
```bash
npm start
```
4. **Automatic AI Configuration**:
On your very first launch, the **DEKUPAI Initialization Wizard** will display. Click **Configure Engine (Automatic)**. The system will build a local virtual environment (`.venv`), upgrade pip, and install PyTorch CPU version, Hugging Face transformers, and runtime model dependencies.
*All progress is streamed in real-time straight to your dashboard progress bar and system terminal window!*
---
## 📖 Operational Guide
### 1. Load an Image
* Drag and drop any `PNG`, `JPG`/`JPEG`, or `WebP` file directly onto the large glowing dragzone.
* Or, click **Browse Local Files** and pick an image from your explorer.
### 2. Extract Background
* Click **Extract Subject** in the right-side control tower.
* The loader box will show real-time progress (`[STATUS] Loading model...`, `[STATUS] Running background removal...`).
* *Note: During the first extraction, the system will download the BiRefNet model weights (~200MB) from Hugging Face. This occurs only once and is cached for instant future runs.*
### 3. Crop & Edit
* Toggle between the **Drag Mode** (navigate) and **Crop Selection** buttons at the bottom.
* Apply aspect constraints, rotate, or flip your image.
* Click **Auto-Trim** to instantly snap the bounding box securely around your transparent subject's non-empty pixels!
### 4. Style & Export
* Select your background fill in Section 3: **Transparent**, **Solid**, or **Gradient**.
* In Section 4, pick your export format (PNG, JPEG, WebP) and adjust the quality slider.
* Click **Export Masterpiece**, choose your directory, and save.
* Click **Show in File Explorer** in the success toast to find your exported file instantly!