{"id":29350729,"url":"https://github.com/aayushinit/aibackgroundsubtractor","last_synced_at":"2026-04-29T21:06:57.507Z","repository":{"id":303552745,"uuid":"1015897431","full_name":"Aayushinit/AiBackgroundSubtractor","owner":"Aayushinit","description":"Real-time background subtraction using OpenCV + Flask with switchable detection algorithms and stylish frontend","archived":false,"fork":false,"pushed_at":"2025-07-08T07:54:14.000Z","size":0,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-08T08:22:17.158Z","etag":null,"topics":["ai-project","background-subtraction","computer-vision","flask","image-processing","knn","mog2","opencv","python","realtime","tailwindcss","video-processing","webcam"],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Aayushinit.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-07-08T07:40:19.000Z","updated_at":"2025-07-08T07:54:18.000Z","dependencies_parsed_at":"2025-07-08T08:22:29.675Z","dependency_job_id":null,"html_url":"https://github.com/Aayushinit/AiBackgroundSubtractor","commit_stats":null,"previous_names":["aayushinit/aibackgroundsubtractor"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Aayushinit/AiBackgroundSubtractor","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aayushinit%2FAiBackgroundSubtractor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aayushinit%2FAiBackgroundSubtractor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aayushinit%2FAiBackgroundSubtractor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aayushinit%2FAiBackgroundSubtractor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Aayushinit","download_url":"https://codeload.github.com/Aayushinit/AiBackgroundSubtractor/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aayushinit%2FAiBackgroundSubtractor/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264363943,"owners_count":23596532,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai-project","background-subtraction","computer-vision","flask","image-processing","knn","mog2","opencv","python","realtime","tailwindcss","video-processing","webcam"],"created_at":"2025-07-08T23:19:05.981Z","updated_at":"2026-04-29T21:06:57.502Z","avatar_url":"https://github.com/Aayushinit.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🧠 AI Background Subtractor\n\nA real-time background subtraction web application built using **Python**, **OpenCV**, and **Flask**. It features dynamic foreground detection using classic computer vision algorithms — **KNN** and **MOG2** — with a smooth, modern UI.\n\n---\n\n## 🚀 Features\n\n- 📸 Live Webcam Feed  \n- ✂️ Real-time Background Subtraction  \n- 🧠 Toggle Between KNN and MOG2 Algorithms  \n- 🌈 Colored Foreground \u0026 Shadow Detection (Green = Foreground, Red = Shadows)  \n- 🖼️ Side-by-Side Original vs Processed Display  \n- 🧪 Algorithm Selection UI  \n- 🎨 Stylish Tailwind CSS Interface  \n- ✅ Fully Local Python-Flask App (No external API needed)\n\n---\n\n## 📂 Folder Structure\n\n```\nAiBackgroundSubtractor/\n├── templates/\n│   └── index.html           # Web UI\n└── app.py                   # Flask backend with OpenCV logic\n```\n\n---\n\n## ⚙️ Technologies Used\n\n| Technology      | Purpose                                  |\n|-----------------|------------------------------------------|\n| **Python**      | Backend logic and OpenCV processing      |\n| **OpenCV**      | Video capture and background subtraction |\n| **Flask**       | Local web server and API routes          |\n| **Tailwind CSS**| Modern, responsive UI styling            |\n| **HTML / JS**   | Frontend structure and interactivity     |\n\n---\n\n## 🎯 How It Works\n\n- Your webcam provides a live video stream via **OpenCV**.  \n- Each frame is processed by a **background subtractor**:\n  - `KNN`: K-Nearest Neighbors method.\n  - `MOG2`: Gaussian Mixture Model approach.\n- Foreground and shadows are highlighted using color masks:\n  - 🟩 Foreground → Green\n  - 🟥 Shadows → Red\n- The processed output is streamed in real-time alongside the raw feed.\n\n---\n\n## 🛠️ How to Run Locally\n\n1. **Clone the repository**:\n   ```bash\n   git clone https://github.com/Aayushinit/AiBackgroundSubtractor.git\n   cd AiBackgroundSubtractor\n   ```\n\n2. **Install dependencies**:\n   ```bash\n   pip install flask opencv-python\n   ```\n\n3. **Run the app**:\n   ```bash\n   python app.py\n   ```\n\n4. **View in browser**:  \n   Open [http://127.0.0.1:5000](http://127.0.0.1:5000) in your browser.\n\n\u003e 📸 Make sure your webcam is connected and not being used by another app.\n\n---\n\n## 📌 Use Cases\n\n- Motion detection and surveillance  \n- Human-computer interaction projects  \n- Educational demos for Computer Vision  \n- Lightweight vision system for robotics  \n\n---\n\n## 📃 License\n\nThis project is licensed under the [MIT License](LICENSE).\n\n---\n\n## 👨‍💻 Author\n\n**Aayush Kadam**  \nFinal Year AI \u0026 Robotics Enthusiast  \nGitHub: [github.com/Aayushinit](https://github.com/Aayushinit)\n\n---\n\n---\n\n\u003e ⭐ If you found this project useful, give it a star and share it!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faayushinit%2Faibackgroundsubtractor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faayushinit%2Faibackgroundsubtractor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faayushinit%2Faibackgroundsubtractor/lists"}