Science Score: 44.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (11.9%) to scientific vocabulary
Last synced: 9 months ago · JSON representation ·

Repository

Basic Info
  • Host: GitHub
  • Owner: comput3ai
  • License: mit
  • Language: Python
  • Default Branch: main
  • Size: 32.6 MB
Statistics
  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Created 11 months ago · Last pushed 11 months ago
Metadata Files
Readme Funding License Citation

README.md

🎨 Rembg Gradio Interface

Python 3.10 Gradio Rembg License

A clean Gradio interface for Rembg, inspired by the original Rembg server implementation but designed as a standalone, Docker-friendly application.

✨ Features

  • 🎯 Multiple AI Models: Choose from 15+ specialized models for different use cases
  • 🖼️ Live Preview: See results instantly with side-by-side comparison
  • ⚙️ Advanced Options: Fine-tune with alpha matting and post-processing controls
  • 🐳 Docker Ready: Easy deployment with included Dockerfile and docker-compose
  • 🚀 GPU Acceleration: Optimized for CUDA-enabled GPUs
  • 📁 Batch Processing: Process multiple images efficiently

🚀 Quick Start

Local Installation

  1. Clone this repository: bash git clone https://github.com/yourusername/rembg.git cd rembg

  2. Install dependencies: bash pip install rembg[gpu] gradio

  3. Download the default model: bash rembg d u2net

  4. Launch the application: bash python app.py

  5. Open your browser and navigate to http://localhost:7860

🐳 Docker Deployment

Build and run with Docker Compose:

bash docker-compose up --build

The interface will be available at http://localhost:7860

🎮 Usage Guide

Basic Usage

  1. Upload Image: Drag and drop or click to upload an image
  2. Select Model: Choose from available models (default: u2net)
  3. Remove Background: Click the button to process
  4. Download Result: Save the output image with transparent background

Available Models

U2Net Family

  • 🎯 u2net (default): A pre-trained model for general use cases
  • u2netp: A lightweight version of u2net model
  • 👤 u2nethumanseg: A pre-trained model for human segmentation
  • 👔 u2netclothseg: A pre-trained model for clothes parsing from human portrait

ISNet Models

  • 🔍 isnet-general-use: A new pre-trained model for general use cases
  • 🎌 isnet-anime: A high-accuracy segmentation for anime character

BiRefNet Family

  • birefnet-general: A pre-trained model for general use cases
  • 🚀 birefnet-general-lite: A light pre-trained model for general use cases
  • 👨 birefnet-portrait: A pre-trained model for human portraits
  • 🎯 birefnet-dis: A pre-trained model for dichotomous image segmentation (DIS)
  • 🔬 birefnet-hrsod: A pre-trained model for high-resolution salient object detection (HRSOD)
  • 🕵️ birefnet-cod: A pre-trained model for concealed object detection (COD)
  • 💪 birefnet-massive: A pre-trained model with massive dataset

Other Models

  • 🤖 sam: A pre-trained model for any use cases
  • 🎨 silueta: Same as u2net but the size is reduced to 43Mb
  • 🏢 bria-rmbg: Commercial-grade background removal model (Bria AI)

Advanced Options

  • Alpha Matting: Improves edge quality for hair and fur

    • Foreground Threshold: Higher values keep more foreground
    • Background Threshold: Lower values remove more background
    • Erode Size: Shrinks the foreground mask
  • Output Options:

    • Mask Only: Output segmentation mask instead of transparent image
    • Post Process: Apply morphological operations to clean the mask

⚙️ Configuration

Environment Variables

Create a .env file for docker-compose:

env PUBLIC_PORT=7860:7860 REPLICAS_COUNT=1

GPU Support

For GPU acceleration, ensure you have: - NVIDIA GPU with CUDA support - nvidia-docker installed - --gpus all flag when running Docker

🔧 Development

Project Structure

rembg/ ├── app.py # Gradio interface ├── Dockerfile # Docker configuration ├── docker-compose.yml # Docker Compose setup ├── requirements.txt # Python dependencies └── examples/ # Sample images

Customization

To add new features or modify the interface, edit app.py. The main components are:

  • process_image(): Core processing function
  • gr.Blocks(): Gradio interface layout
  • Model selection and parameter controls

📊 Performance Tips

  • 🚀 Model Selection: Start with u2net for general images, use specialized models for specific content
  • GPU Usage: Ensure CUDA is available for 10x+ speedup
  • 🎯 Alpha Matting: Enable only when needed (adds processing time)
  • 📦 Batch Processing: Process multiple similar images with the same model loaded

🙏 Acknowledgements

  • Rembg by Daniel Gatis for the core background removal functionality
  • Gradio for the web interface framework
  • All the model authors whose work powers the background removal

📄 License

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


Made with ❤️ inspired by the original Rembg project

Owner

  • Name: comput3.AI
  • Login: comput3ai
  • Kind: organization
  • Email: hello@comput3.ai

Cloud infrastructure for the future of AI.

Citation (CITATION.cff)

cff-version: 1.2.0
title: rembg
message: Rembg is a tool to remove images background
type: software
authors:
  - given-names: Daniel
    family-names: Gatis
    email: danielgatis@gmail.com
identifiers:
  - type: url
    value: 'https://github.com/danielgatis'
repository-code: 'https://github.com/danielgatis/rembg'
url: 'https://github.com/danielgatis/rembg'
abstract: Rembg is a tool to remove images background.
license: MIT
commit: 9079508935ae55d6eefa0fd75f870599640e8593
version: 2.0.66
date-released: '2025-02-21'

GitHub Events

Total
  • Watch event: 1
  • Push event: 1
  • Create event: 1
Last Year
  • Watch event: 1
  • Push event: 1
  • Create event: 1

Dependencies

.github/workflows/close_inactive_issues.yml actions
  • actions/stale v9 composite
.github/workflows/lint_python.yml actions
  • actions/checkout v4 composite
  • actions/setup-python v5 composite
.github/workflows/publish_docker.yml actions
  • actions/checkout v4 composite
  • docker/build-push-action v6 composite
  • docker/login-action v3 composite
  • docker/metadata-action v5 composite
  • docker/setup-buildx-action v3 composite
  • docker/setup-qemu-action v3 composite
.github/workflows/publish_pypi.yml actions
  • actions/checkout v4 composite
  • actions/setup-python v5 composite
.github/workflows/test_install.yml actions
  • actions/checkout v4 composite
  • actions/setup-python v5 composite
.github/workflows/windows_installer.yml actions
  • Minionguyjpro/Inno-Setup-Action v1.2.2 composite
  • actions/checkout v4 composite
  • actions/setup-python v5 composite
  • svenstaro/upload-release-action v2 composite
Dockerfile docker
  • python 3.10-slim build
docker-compose.yml docker
pyproject.toml pypi
setup.py pypi
  • jsonschema *
  • numpy *
  • opencv-python-headless *
  • pillow *
  • pooch *
  • pymatting *
  • scikit-image *
  • scipy *
  • tqdm *