Here, frac (that is, the fraction of variation to retain) and kmax (that is, the maximum number of eigenvectors to retain) can be optionally set through command-line options, although the default settings of 0.95 and 20, respectively, tend to work well in most cases. Finally, with the command-line argument argv[2] containing the path to save the trained shape model to, saving can be performed by a single function call as follows: