Configuration file

The file config.txt is located in the main AutoFace directory. It defines the locations of the various directories used by this add-on. The forward slash "/" is used as separator between directories, as is standard on Linux and Mac. On Windows the separator is the backslash "\", but python accepts forward slash as directory separator as well.

The first variable specifies the main AutoFace work directory:

AUTOFACE_DIR = "~/Documents/Autoface/"

Here "~" denotes your home folder. On my Windows 7 computers, the absolute address to my Documents folder is C:/Users/Thomas/Documents.

AutoFace uses a number of directories to store temporary files. They are all located under AUTOFACE_DIR:
  • AUTOFACE_DIR/icons: Contains a small copy of the original image, to be used as thumbnails in DAZ Studio.
  • AUTOFACE_DIR/figures: A copy of the input image and a csv file specifying the face's bounding box. This directory will be uploaded to Google Drive for analysis with the deep neural network.
  • AUTOFACE_DIR/results: Contains data about the image, to be used by other scripts.
  • AUTOFACE_DIR/parameters: Will contain the amplitudes for the eigenfaces after analysis by the deep neural network.
  • AUTOFACE_DIR/textures: Will contain the modified textures generated by the patch.py script.

The standalone scripts look for input images at the following locations:
  • A directory explicitly specified with the -d (or --dir) keyword.
  • In the directory AUTOFACE_DIR/inputs/.
  • In the example folder, autoface/exprnet/figures/ included with the add-on.
This example directory contains images of three of the candidates of the 2016 US presidential election. The preferred workflow is to create the AUTOFACE_DIR/inputs/ directory and put you images there.


The next item specifies the location of the modified Basel Face Model (BFM) . This is a MATLAB file which can be downloaded from https://www.dropbox.com/s/ej80o9lnj0k49qu/Shape_Model.tar.gz. This was described in point 13 of the Prerequisites.

BFM_PATH = "/home/svn/expression-net/trunk/Shape_Model/BaselFaceModel_mod.mat"

The value of BFM_PATH is simple where I happened to download it on my computers. However,  the BFM is not needed to run any critical part of AutoFace. Rather, it is useful for debugging and for developing the data files that are included with AutoFace.


The next two variables specify where DAZ Studio has been installed.

DAZ_BASE_DIR = "C:/Users/Public/Documents/My DAZ 3D Library/"
OUTPUT_BASE_DIR = "~/Documents/DAZ 3D/Studio/My Library/"

The DAZ base directory contains a subdirectoy where the Genesis 8 male and female characters have been install, and the  output base directory is the parent directory of the location of the generated DAZ Studio (.duf and .dsf) files. The default values should work with the default installation paths for DAZ Studio, at least under Windows 7.

If you want to distribute your files it can be a good idea to change the output base directory to an empty directory. Then all files generated by the DAZ importer will end up in subdirectories of this directory. The entire directory structure can then be zipped to a single file and unzipped on somebody else's computer.

The variables at the end of the config file are normally not changed. They describe the location relative the base directories. The patched textures will be located at OUTPUT_BASE_DIR/OUTPUT_TEX_DIR, where

OUTPUT_TEX_DIR = "/Runtime/textures/autoface/"

The relative paths that apply to a female character, or more specifically a character based on the Genesis 8 Female, are

G8F_CHARACTER = "genesis_8_female"
G8F_ID = "Genesis8Female"
G8F_TEX_DIR = "/Runtime/Textures/DAZ/Characters/Genesis8/FemaleBase/"
G8F_DIFFUSE_TEXTURE = "G8FBaseFaceMapD_1001.jpg"
G8F_MORPH_DIR = "/data/DAZ 3D/Genesis 8/Female/Morphs/AutoFace/"
G8F_PARENT = "/data/DAZ 3D/Genesis 8/Female/Genesis8Female.dsf"
G8F_PEOPLE_DIR = "/People/Genesis 8 Female/"
G8F_DAZ_BASE = "Genesis 8 Basic Female.duf"


The variables for the Genesis 8 Male are analogous and the variables start with G8M.

Although these paths are usually not changed, there is at least one exception. The default textures apply to fair-skinned people, so if your character has dark skin, you might want to change G8F_TEX_DIR and  G8F_DIFFUSE_TEXTURE to something more appropriate. However, for the time being the texture coordinates must be compatible with the Genesis 8 Female and Male.