-
Notifications
You must be signed in to change notification settings - Fork 145
Closes issue #261 #311
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Sakshi146-eng
wants to merge
4
commits into
RK1905101:master
Choose a base branch
from
Sakshi146-eng:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Closes issue #261 #311
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
35429ff
Add AI Background Remover project
Sakshi146-eng b5a444b
Add README.md for AI Background Remover project
Sakshi146-eng 27ccdc6
Update README.md for AI Background Remover
Sakshi146-eng 74a63e9
Revise README for clarity and additional details
Sakshi146-eng File filter
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
commit 74a63e9f964ffadd8afc9b2728ee48c66fba2b00
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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" />| | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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...> |