Skip to content

Machine learning program that uses your hand as a brush!

License

Notifications You must be signed in to change notification settings

lorforlinux/hand-brush

Repository files navigation

Hand Brush 🖌️

Machine learning paint program that uses your hand as a brush!


Note:

1. Demos (gifs) will take a bit of time to load coz they are heavy 🧸

2. You are required to install tensorflow-2.0, opencv, numpy and other
  python libraries to get this application to work.

3. To run the notebooks locally you are required to install Jupyter-notebook
  OR Jupyter-lab.

4. Although python2 is deprecated, If you have both python2 and python3 installed 
  replace python with python3 for running the application and demos.

Demo of the program!


For hand traking my application here is using the pretrained ``SSD with MobilenetV1` model from EvilPort2's hand tracking repository. The paint toolbox uses the code from acl21's Webcam Paint OpenCV repository. Hand Brush program is truly a combination of those two repositories and i highly recommend you to check out their repositories 🦔

# for running hand brush program

python handbrush.py

Watch the demo with updated tool box here.

paint program demo


Hand detection demo!


This demo uses EvilPort2's hand tracking model but you can also try the victordibia's hand tracking model. I tried both and got better result from the first one.

# for running hand detection demo

python handdetect.py

OR

python detect_single_threaded.py

hand detect demo


Hand pointer demo!


This demo uses the akshaybahadur21's Hand Movement Tracking code for creating the pointer trail.

# for running hand pointer demo

python handpointer.py

pointer demo


Contour demo!


This one is just for fun and learning How can I find contours inside ROI using opencv and Python?.

# for running contour demo

python handcontour.py

pointer demo


Jupyter Notebooks


If you want to learn how does it work internally, the best way is to follow the Jupyter Notebooks i have included in this repository.

Notebook Purpose
detecthand.ipynb This notebook will give you the base code for all the other notebooks and for the application itself.
gethand.ipynb Here you'll learn to extract the detected hand as separate image data.
centeroid.ipynb We will calculate the centeroid point in this notebook.
countour.ipynb We will find the contours in the detected hand by taking it as ROI (Region Of Interest)

Jupyter Notebooks


If you find any issue in the code OR want any help please create an issue in the issue tracker :)


References

  1. https://github.com/EvilPort2/Hand-Tracking
  2. https://github.com/acl21/Webcam_Paint_OpenCV
  3. https://github.com/akshaybahadur21/HandMovementTracking
  4. https://github.com/victordibia/handtracking