Winning project for WittyHacks 2.0 (central India's largest hackathon). Created by Prathamesh Naik, Raghav Mahajan & Mohit Nathrani.
A tool that takes video and replace with new background provided by user in real time.
Background removal helps with creative portrait photography and much more, helping provide the ability to change the background to a location of your choice. There are 4 methods available to use. One is a simple live-method using the webcam, a user can change the background by pressing and holding 'a', 'b', or 'c'. Other is live streaming from a mobile app. The last one is by requesting the server with pre-recorded video and background picture of choice. Fourth one is android app with a Flask server.
- Tensorflow
- OpenCV
- Flask
Input | Background | Result |
---|---|---|
![]() |
![]() |
![]() |
$ git clone https://github.com/neatpun/real-time-background-replacement
- Live Webcam Front
cd "Live Webcam Front"
- install dependencies
python live_webcam.py
- Server Front
cd "Server Front"
- install dependencies
FLASK_APP=index.py flask run
- then open localhost:5000
- provide video and background image
- after processing download of required video will begin
- Live Stream Output
cd "Live Stream Output"
- install dependencies
- connect any mobile device to same network and stream video.
- provide the ip address of mobile device in IP_Webcam_Out.py
python IP_Webcam_Out.py