Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

6 Commits

Folders and files

Repository files navigation

🎨 Background Remover Pro

Background Remover Pro is an AI-powered web application developed using Python, Flask, OpenCV, Pillow, and Rembg (U²-Net). It enables users to remove image backgrounds, replace backgrounds with custom images, apply virtual backgrounds to live webcam streams, and record processed videos in real time.

The application uses deep learning-based background segmentation to produce accurate foreground extraction while maintaining a simple and user-friendly interface.


🚀 Features

🖼 AI Background Removal

  • Remove backgrounds from PNG, JPG, JPEG, and WEBP images.
  • Generates transparent PNG output while preserving image quality.
  • Uses the U²-Net deep learning model through the Rembg library for accurate segmentation.

🌄 Background Replacement

  • Upload a foreground image and a custom background image.
  • Automatically removes the original background.
  • Combines the extracted foreground with the uploaded background to generate a new image.

🎥 Live Virtual Background

  • Captures live webcam feed.
  • Removes the background from every frame in real time.
  • Replaces it with a selected virtual background.
  • Streams the processed video directly through the browser.

🎬 Video Recording

  • Record live virtual background sessions.
  • Saves recordings in MP4 format.
  • Uses FFmpeg after recording to optimize playback, frame rate, and video quality.

🖼 Custom Background Upload

  • Upload custom background images.
  • Uploaded backgrounds can be selected for live virtual background replacement.

📁 Recording Management

  • View previously recorded videos.
  • Displays recording size and creation time.
  • Delete recordings directly from the application.

🛠 Technologies Used

Backend

  • Python
  • Flask

Computer Vision & AI

  • OpenCV
  • Rembg (U²-Net)
  • Pillow
  • NumPy

Utilities

  • Werkzeug
  • FFmpeg
  • Threading
  • UUID

⚙ How It Works

Image Background Removal

  1. User uploads an image.
  2. Flask receives the uploaded file.
  3. The image is converted into RGBA format.
  4. The U²-Net model removes the background.
  5. The processed image is saved.
  6. The transparent image is returned for download.

Background Replacement

  1. User uploads a foreground image.
  2. User uploads a background image.
  3. Background is removed from the foreground image.
  4. Background image is resized to match the foreground.
  5. Both images are merged together.
  6. Final image is generated and returned.

Live Virtual Background

  1. Webcam captures live frames.
  2. Each frame is processed using the U²-Net model.
  3. The foreground is extracted.
  4. The selected background image is resized to match the frame.
  5. Foreground and background are composited together.
  6. The processed frames are streamed continuously.

Video Recording

  1. User starts recording.
  2. Every processed frame is written into an MP4 file.
  3. When recording stops, FFmpeg optimizes the video by:
    • Re-encoding using H.264
    • Correcting playback speed
    • Maintaining proper frame rate
    • Improving compatibility across media players

📌 Supported File Formats

Images

  • PNG
  • JPG
  • JPEG
  • WEBP

Videos

  • MP4

📦 Python Libraries

pip install flask
pip install rembg
pip install pillow
pip install numpy
pip install opencv-python
pip install werkzeug
pip install onnxruntime

▶ Running the Project

Clone the repository

git clone https://github.com/your-username/background-remover-pro.git

Move into the project directory

cd background-remover-pro

Run the application

python app.py

Open your browser and visit

http://127.0.0.1:5000

💡 Applications

  • Passport photo background removal
  • Product photography
  • E-commerce product images
  • Social media content creation
  • Online meeting virtual backgrounds
  • Graphic design
  • Content creation

🔮 Future Improvements

  • Batch image processing
  • Background blur mode
  • AI-powered background suggestions
  • GIF background support
  • Cloud storage integration
  • User authentication
  • Mobile responsive interface

👩‍💻 Author

Sanika Umesh Shinde

Third Year Information Technology Engineering Student

Interested in Full Stack Development, Machine Learning, and Computer Vision.


📄 License

This project is developed for educational and learning purposes.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages