Skip to content

🧐✨Using Semantics Segmentation to make a person disappears - Magic✨

License

Notifications You must be signed in to change notification settings

natelee-tw/cv-magic-trick

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cv-magic-trick

A simple weekend project, using Semantics Segmentation to make the class "Human" disappears, while everything remains.

Method

From the output of Deeplabv3 semantics segmentation algorithm, we find the location of "class 15 - People", and convert them to the background pixels that we take before hand in img/ folder, and output it onto webcam stream.

Instructions

  • Clone this repo https://github.com/mylee16/cv-magic-trick.git
  • cd cv-magic-trick
  • pip install -r requirements.txt to install the required packages
  • git clone https://github.com/bonlime/keras-deeplab-v3-plus.git to clone deeplab v3 code base
  • Update line 170 on keras-deeplab-v3-plus/model.py to in_channels = inputs.shape[-1] (a small bug on the deeplab v3 repo)
  • Rename the folder keras-deeplab-v3-plus to just deeplab
  • Then, take a photo of your background, and name it background.jpg and put it in img/ folder
  • Run python -m main
  • Press "t" on your keyboard to toggle between invisibility!
  • Have fun!

Magic Trick with Computer Vision

Acknoledgement

Deeplabv3 codebase: https://github.com/bonlime/keras-deeplab-v3-plus OpenCV Tutorial: https://www.freecodecamp.org/news/how-to-use-opencv-and-python-for-computer-vision-and-ai/

About

🧐✨Using Semantics Segmentation to make a person disappears - Magic✨

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages