一、实现的效果展示:

二、环境配置

conda create -n haircolor python=3.8
conda activate haircolor
pip install tensorflow==2.10.0 -i  https://mirror.baidu.com/pypi/simple
pip install opencv-python -i  https://mirror.baidu.com/pypi/simple
pip install pillow -i  https://mirror.baidu.com/pypi/simple
pip install dlib-19.19.0-cp38-cp38-win_amd64.whl

三、图片变色运行

python demo.py

四、视频实时变色运行

python live_demo.py