table of Contents
Foreword
As the friend you want to experience the magic of modern machine learning, to help a friend installed from scratch once pytorch operating environment, the way to write an article about note-taking. (I'm not greedy of his 2080)
at Talking Head from A Single Image Anime Project blog
talking-head-anime-demo project github
Anaconda installation
Download link
replace domestic sources
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/
Configuration python environment
Install and update pip3
cd D:\Anaconda3\Scripts
easy_install.exe pip
pip3 install --upgrade pip -i https://mirrors.ustc.edu.cn/pypi/web/simple
Install / update dependencies
pip3 install opencv-python -i https://mirrors.ustc.edu.cn/pypi/web/simple
pip3 install --upgrade numpy -i https://mirrors.ustc.edu.cn/pypi/web/simple
pip3 install --upgrade pillow -i https://mirrors.ustc.edu.cn/pypi/web/simple
Installation CUDA
Installation CUDNN
Download Link
unzip to C: \ Program Files \ NVIDIA GPU Computing Toolkit \ CUDA \ v10.1 folder
Add the environment variable C: \ Program Files \ NVIDIA GPU Computing Toolkit \ CUDA \ v10.1 \ lib \ x64
Installation pytorch
Find download command input download and install https://pytorch.org/get-started/locally/
pip3 install torch===1.4.0 torchvision===0.5.0 -f https://download.pytorch.org/whl/torch_stable.html
Installation dlib
Download project files
git clone https://github.com/pkhungurn/talking-head-anime-demo.git
Or download the Zip file and extract it to the appropriate location.
In here, download and unzip data model folder
in here to download shape_predictor_68_face_landmarks.dat
the file and unzip data folder.
Project comes in some pictures, if you want to use your own images, the picture in data/illust
. The image must meet the following requirements:
- PNG format
- 256 x 256。
- The first task to be 128 x 128 in the middle box.
- There must be four channels (RGBA).
- Not a person must have a pixel value (0,0,0,0,0). In other words, the background must be transparent. ( This pit )
run
Project files into the root directory, run
python app/puppeteer.py
Click on the bottom of the screen after running Load Image ...
Load picture