Skip to content

πŸŽ₯ Camouflage-AI – A fast and flexible AI tool for removing video backgrounds using YOLOv8 segmentation. Customize with solid colors, blur, or images. Built with Python & CustomTkinter for a stunning desktop experience.

License

Notifications You must be signed in to change notification settings

Vishnu-tppr/Camouflage-AI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

11 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ–ΌοΈ Camouflage AI – Smart Video Background Remover πŸŽ₯🧠

🎯 An AI-powered desktop tool for removing video backgrounds using YOLOv8 segmentation.

🎨 Choose solid colors, images, or blur effects as your new backdrop β€” it's fast, clean, and stunningly simple!


πŸ“Œ Table of Contents


✨ Features

  • πŸ§β€β™‚οΈ AI-Powered Person Segmentation – Detects humans using YOLOv8n-seg.
  • 🎨 Background Options:
    • Solid color picker 🎨
    • Custom background image πŸ–ΌοΈ
    • Gaussian blur effect πŸ”
  • πŸ“‚ Video File Input – Select and process any video file.
  • πŸ”„ Progress Tracking – Real-time status updates with loading bars.
  • 🧠 Lightweight YOLOv8n Model – Fast, accurate, and ideal for personal devices.
  • πŸ–₯️ Cross-compatible – Works on both CPU and GPU environments.

πŸ“Έ Demo Screenshots

Screenshot 2025-05-16 224741 Screenshot 2025-05-16 221116 Screenshot 2025-05-16 221130 Screenshot 2025-05-16 221258 Screenshot 2025-05-16 225424 Screenshot 2025-05-16 221314 Screenshot 2025-05-16 221333 Screenshot 2025-05-16 221835 Screenshot 2025-05-16 225528


🧠 How It Works

1️⃣ YOLOv8 Segmentation

from ultralytics import YOLO
model = YOLO("yolov8n-seg.pt")
results = model.track(frame, persist=True, classes=0)

Detects the person (class ID 0) and generates binary masks for each frame.


2️⃣ Background Replacement

Based on your choice:

  • Color: Overlays the mask with the selected RGB color.
  • Image: Resizes and merges a new image background.
  • Blur: Applies cv2.GaussianBlur() behind the person.
mask = masks[0]
inverse_mask = cv2.bitwise_not(mask)
foreground = cv2.bitwise_and(frame, frame, mask=mask)
background = cv2.bitwise_and(chosen_bg, chosen_bg, mask=inverse_mask)
final = cv2.add(foreground, background)

πŸ“ File Structure

πŸ“¦ CamouflageAI/
 ┣ πŸ“„ Camouflage AI.py         # GUI App using CustomTkinter
 ┣ πŸ“„ process_video.py         # Main processing logic with YOLO
 ┣ πŸ“„ requirements.txt         # Dependencies
 β”— πŸ“„ README.md                # You’re here!

βš™οΈ Requirements

Install all required packages with:

pip install -r requirements.txt

Or manually:

pip install customtkinter opencv-python numpy rembg pillow tkinter moviepy matplotlib scikit-image tqdm pyperclip

πŸ“ Tested with Python 3.10+ on Windows


πŸš€ How to Run

python "Camouflage AI.py"

βœ… Make sure process_video.py is in the same directory. πŸ–ΌοΈ Output videos are automatically saved in the output/ folder.


🧩 Technologies Used


πŸ‘¨πŸ»β€πŸ’» Author

Made with ❀️ by Vishnu

β€œBuild with passion, debug with precision.” πŸ”₯


πŸ“œ License

This project is open-source and licensed under the MIT License.


🌟 If you found this useful, leave a ⭐ on the repo and share it!

About

πŸŽ₯ Camouflage-AI – A fast and flexible AI tool for removing video backgrounds using YOLOv8 segmentation. Customize with solid colors, blur, or images. Built with Python & CustomTkinter for a stunning desktop experience.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages