How to run HRFAE face age editor on Windows

Code address  https://github.com/InterDigitalInc/HRFAE

Thesis << High Resolution Face Age Editing >>

Face age editing is to input a face photo to generate a photo of this person of any age. Thanks to the researchers of this work for providing such conscientious open source code.

 

Operating system windows 8.1, compiler VS2015

First of all, make sure your VS2015 can use python normally, and the students who use PyCharm do the same. Make sure that the python environment is set up normally.

Create a new python project and associate the python environment. According to the dependency library provided by the author, the corresponding python environments are:

mine

Then we start the whole code, we only see the effect, so only use test.py

Copy the contents of test.py to the main file of the python project,

parser.add_argument('--config', type=str, default='params', help='path to the config file.') 中params 改成 001

Copy the following files to the project directory

Since the computer is an Internet cafe, we only use cpu.

Change state_dict = torch.load(checkpoint_path) in trainer.py to state_dict = torch.load(checkpoint_path, map_location='cpu')

Finally, we download the model needed for the test, copy the model URL in logs/001/download.sh, rename it to checkpoint after downloading, and store it in this path.

Our project path is as long as this:

 

Put the test picture in the test/input folder, run the code, and save the result in test/output.

Modify parser.add_argument('--target_age', type=int, default=65, help='Age transform target, interger value between 20 and 70') to control the age, try using your own picture.

Guess you like

Origin blog.csdn.net/XLcaoyi/article/details/108793500