Try to beautify with Talking Head Anime from a Single Image [python preparation]

Introduction

This article is a follow-up to "Talking Head Anime from a Single Image". I recommend reading from that article first.

Python is required to run Talking Head Anime from a Single Image. In this article, I would like to introduce Python from scratch so that anyone can enjoy Babiniku.

Things necessary

Read the README.md in talking-head-anime-demo and you'll see that you need the following:

What is written on the left is the Python itself and the library. The number on the right is version, and you need to prepare a newer one.

Also, pytorch requires CUDA, and dlib requires a C ++ development environment and a library called cmake, so we will prepare them as well.

Anaconda We will install Anaconda on the premise that we have everything we need. Anaconda is a platform that provides Python itself and several libraries for scientific computing. You can easily build an environment that uses Python by installing it. Also, pillow and numpy are installed by default, so you don't need to install them.

  1. First, go to this Anaconda Distribution.

  2. Select Python 3 version from Download to download. Select version 3.6 or higher as described in What You Need.

  3. Follow the steps to install Anaconda.

CUDA

CUDA is the platform and programming model required for parallel computing on GPUs.

  1. Go to the CUDA Toolkit (https://developer.nvidia.com/cuda-toolkit) and click Download Now.

  2. Select the platform that suits your environment from Select Target Platform and download it.

  3. Follow the steps to install CUDA.

C ++ development environment

Set up a C ++ development environment to install dlib, one of the required libraries. Microsoft Visual Studio provides that environment.

  1. Go to Visual Studio (https://visualstudio.microsoft.com/en/downloads/).

  2. Download the Visual Studio Community and launch the installer.

  3. Check and install desktop development with C ++.

C++.png

Library installation

We will install the necessary libraries.

  1. Start Anaconda Prompt.

  2. Enter conda install pytorch torchvision -c pytorch in Anaconda Prompt, press the Enter key and wait for a while, then you will be askedPerocnceed ([y] / n)?, So enter y to install. To do.

  3. Install opencv-python with pip install opencv-python.

  4. Install cmake with pip install cmake.

  5. Install dlib with pip install dlib.

Summary

This completes the preparation of Python. Go back to "Talking Head Anime from a Single Image" and let's actually move it.

Recommended Posts

Try to beautify with Talking Head Anime from a Single Image [python preparation]
Try to extract a character string from an image with Python3
Try to draw a life curve with python
Try to make a "cryptanalysis" cipher with Python
Try to make a dihedral group with Python
WEB scraping with python and try to make a word cloud from reviews
How to scrape image data from flickr with python
Try to make a command standby tool with python
From buying a computer to running a program with python
Perform a Twitter search from Python and try to generate sentences with Markov chains.
Try to bring up a subwindow with PyQt5 and Python
Try to generate a cyclic peptide from an amino acid sequence with Python and RDKit
Create folders from '01' to '12' with python
Try to operate Facebook with Python
[Python] Try to graph from the image of Ring Fit [OCR]
Try to create a python environment with Visual Studio Code & WSL
Pass a list by reference from Python to C ++ with pybind11
Try adding a wall to your IFC file with IfcOpenShell python
Try to create a Qiita article with REST API [Environmental preparation]
[Python] Try to recognize characters from images with OpenCV and pyocr
Try to reproduce color film with Python
[Cloudian # 3] Try to create a new object storage bucket with Python (boto3)
Try logging in to qiita with Python
From preparation for morphological analysis with python using polyglot to part-of-speech tagging
HTML email with image to send with python
Create a dummy image with Python + PIL.
Introduction to Python Image Inflating Image inflating with ImageDataGenerator
Send a message from Python to Slack
Try to make a capture software with as high accuracy as possible with python (2)
Create a tool to automatically furigana with html using Mecab from Python3
Try to image the elevation data of the Geographical Survey Institute with Python
Single pixel camera to experience with Python
Image acquisition from camera with Python + OpenCV
Try HTML scraping with a Python library
Try calling Python from Ruby with thrift
Try to solve a set problem of high school math with Python
Try drawing a map with python + cartopy 0.18.0
Try to generate an image with aliasing
Sample to convert image to Wavelet with Python
Try to measure the position of the object on the desk (real coordinate system) from the camera image with Python + OpenCV
Try to solve the traveling salesman problem with a genetic algorithm (Python code)
Try image processing with Python when asked for entertainment at a wedding ceremony
Region extraction method using cellular automaton Try region extraction from the image with growcut (Python)
I tried to extract a line art from an image with Deep Learning
Edit Excel from Python to create a PivotTable
Try to calculate a statistical problem in Python
How to open a web browser from python
Convert PDF to image (JPEG / PNG) with Python
Image processing from scratch with python (5) Fourier transform
Try to solve the man-machine chart with Python
I want to make a game with Python
How to crop an image with Python + OpenCV
How to generate a Python object from JSON
Try to automatically generate Python documents with Sphinx
Image processing from scratch with python (4) Contour extraction
Decide to assign a laboratory with Python (fiction)
Steps to create a Twitter bot with python
Create a decision tree from 0 with Python (1. Overview)
Read line by line from a file with Python
From Python environment construction to virtual environment construction with anaconda
I want to write to a file with Python