/python-photo-skin-detection

Python Script that runs multiple skin detection algorithms on an image

Primary LanguagePython

python-photo-skin-detection

Python Script that runs multiple skin detection algorithms on an image

Python Skin Detection Algorithm Script

This is a python script which will take a given image and run it through multiple algorithms to save new images that tries to guess what parts of the image are skin. The algorithms that are run are based on the Explicitly Defined Skin Region Model, Colour Segmentation in Normalization rg Colour Model, Colour Segmentation in HSV Colour Model and Color Segmentation in YCBCR Color Model.

Setup

Run pip3 install requirements.txt to install any modules you might be missing for this script.

Running Scripts

You can run the script by running python3 SkinDetection.py this will use the default image path which leads to Images/skin.jpg.

If you wish to use a different image just add a command line argument of the path to that image. For example: python3 SkinDetection.py Images/skin1.png.

Saving locations for each algorithm is hard coded within each function. Each algorithm has its own unique name so you can tell which image is generated by which algorithm. Just be sure to change the name of an image or move it if you want to keep it saved or else it will be overwritten the next time the script is run.

It is also possible to run each individual function through the python CLI but you will have to be sure to add the path of the image as an argument.