Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Revise README for clarity and additional details
Updated README to enhance project description, features, installation instructions, and usage for both GUI and CLI.
  • Loading branch information
Sakshi146-eng authored Oct 26, 2025
commit 74a63e9f964ffadd8afc9b2728ee48c66fba2b00
107 changes: 65 additions & 42 deletions AI Background Remover/README.md
Original file line number Diff line number Diff line change
@@ -1,72 +1,95 @@
# 🖼️ AI Background Remover

This project is a simple, fast, and AI-powered background removal tool built using **Streamlit** and **rembg** (ONNX-based background removal).
Users can upload any image, preview it, and download the background-removed output instantly.
An AI-powered desktop tool that automatically removes image backgrounds and saves the subject as a transparent PNG — perfect for designers, students, and automation scripts.

✅ Built with Python
✅ Uses `rembg` + U²-Net AI model
✅ Works with JPG & PNG images
✅ GUI + Command Line Interface
✅ Hacktoberfest friendly 🎉

---

## 🚀 Features

✔ Upload JPG/PNG images
✔ AI-powered background removal
✔ Live preview of original & processed image
✔ Download final output as PNG
✔ Fast & lightweight Streamlit UI
| Feature | Description |
| ------------------------ | ----------------------------------------- |
| ✂️ AI Background Removal | Removes background using machine learning |
| 🖥️ Streamlit GUI | Upload → Preview → Remove BG → Download |
| 💻 CLI Tool | Command-line support for automation |
| 📦 Output | Saves transparent PNG |
| 🔰 Beginner Friendly | Simple folder structure + clean code |

---

## 🛠️ Tech Stack
## 📌 Project Structure

| Component | Technology |
|----------|------------|
| Frontend | Streamlit |
| AI Model | rembg (U2-Net ONNX model) |
| Image Handling | Pillow (PIL) |
| Language | Python 3.8+ |
```
AI-Background-Remover/
├── src/
│ ├── streamlit_app.py # Streamlit UI version
│ ├── cli_app.py # Command-line background remover
├── assets/
│ ├── sample1.png
│ ├── sample2.png
├── requirements.txt
└── README.md
```

---

## 📦 Installation
## 📥 Installation

### 1️⃣ Clone the Repository

```bash
https://github.com/RK1905101/Mini_Python_Projects
git clone https://github.com/RK1905101/Mini_Python_Projects/AI-Background-Remover
cd AI-Background-Remover
```

2️⃣ Create & Activate Virtual Environment (Recommended)
conda create -n bgremove python=3.9 -y
conda activate bgremove
or using venv ⬇️
### 2️⃣ Install Dependencies

python -m venv venv
venv\Scripts\activate # Windows
> Recommended: Use a virtual environment ✅

3️⃣ Install Required Packages
```bash
pip install -r requirements.txt
```

If `onnxruntime` or `rembg` fails on your system:

If you face onnxruntime errors on Windows:
pip install onnxruntime
```bash
pip install rembg onnxruntime
```

---

▶️ Run the App
## 🖼️ Streamlit GUI Usage

Run the application:

```bash
streamlit run src/streamlit_app.py
Streamlit will open the app in your browser automatically ✅
If not, open the URL shown in the terminal (e.g., http://localhost:8501)
```

📂 Project Structure
AI-Background-Remover/
├── src/
│ └── streamlit_app.py # Main UI app
│ └── cli_app.py
├── requirements.txt # Dependencies
├── README.md # Project Documentation
└── assets/
# Demo images
📸 Screenshots
<img width="1024" height="1024" alt="bgremover" src="https://github.com/user-attachments/assets/3a095fd2-db7f-4882-980d-bd98f9fc3780" />
<img width="1024" height="1024" alt="output2" src="https://github.com/user-attachments/assets/c71f9643-8b86-4a05-8d1c-c2d7580c88c5" />
Then open the browser link shown in the terminal ✅
Upload your image → Click **Remove Background** → Download PNG

---

## 💻 CLI Tool Usage

```bash
python src/cli_app.py input.jpg -o output.png
```

## 📸 Screenshots

| Before |
| ----------------------------------- |
| <img width="200" height="1024" alt="bgremover" src="https://github.com/user-attachments/assets/5b93d1ae-e3cc-424c-a5e6-c5a3bbc75e69" />
| After |
<img width="200" height="1024" alt="output2" src="https://github.com/user-attachments/assets/7087cf33-b6eb-444d-81b2-187a498d4a1d" />|
Comment on lines +90 to +94
Copy link

Copilot AI Oct 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The markdown table structure is malformed. Line 92 has an extra pipe character at the start, and line 94's image tag is outside the table cell structure. This will render incorrectly. The table should have consistent pipe placement: | Before | <img...> | and | After | <img...> |

Suggested change
| Before |
| ----------------------------------- |
| <img width="200" height="1024" alt="bgremover" src="https://github.com/user-attachments/assets/5b93d1ae-e3cc-424c-a5e6-c5a3bbc75e69" />
| After |
<img width="200" height="1024" alt="output2" src="https://github.com/user-attachments/assets/7087cf33-b6eb-444d-81b2-187a498d4a1d" />|
| Before | After |
| ------ | ----- |
| <img width="200" height="1024" alt="bgremover" src="https://github.com/user-attachments/assets/5b93d1ae-e3cc-424c-a5e6-c5a3bbc75e69" /> | <img width="200" height="1024" alt="output2" src="https://github.com/user-attachments/assets/7087cf33-b6eb-444d-81b2-187a498d4a1d" /> |

Copilot uses AI. Check for mistakes.