              type=str,
              choices=("blur", "face", "face-cnn", "face-cnn-dissim", "face-yaw", "hist",
                       "hist-dissim", "color-gray", "color-luma", "color-green", "color-orange"),
              dest='sort_method',
              group="sort settings",
              default="face",
              help="R|Sort by method. Choose how images are sorted. "
                   "\nL|'blur': Sort faces by blurriness."
                   "\nL|'face': Use VGG Face to sort by face similarity. This uses a pairwise "
                   "clustering algorithm to check the distances between 512 features on every face "
 
</s> remove             group="data",
            help="Output directory for sorted aligned faces."))
 </s> add             group=_("data"),
            help=_("Output directory for sorted aligned faces."))) </s> remove             group="plugins",
            help="The number of times to re-feed the detected face into the aligner. Each time "
                 "the face is re-fed into the aligner the bounding box is adjusted by a small "
                 "amount. The final landmarks are then averaged from each iteration. Helps to "
                 "remove 'micro-jitter' but at the cost of slower extraction speed. The more "
                 "times the face is re-fed into the aligner, the less micro-jitter should occur "
                 "but the longer extraction will take."))
 </s> add             group=_("Plugins"),
            help=_("The number of times to re-feed the detected face into the aligner. Each time "
                   "the face is re-fed into the aligner the bounding box is adjusted by a small "
                   "amount. The final landmarks are then averaged from each iteration. Helps to "
                   "remove 'micro-jitter' but at the cost of slower extraction speed. The more "
                   "times the face is re-fed into the aligner, the less micro-jitter should occur "
                   "but the longer extraction will take."))) </s> remove             help="Integer value. Number of folders that will be used to group by blur and "
                 "face-yaw. For blur folder 0 will be the least blurry, while the last folder "
                 "will be the blurriest. For face-yaw the number of bins is by how much 180 "
                 "degrees is divided. So if you use 18, then each folder will be a 10 degree "
                 "increment. Folder 0 will contain faces looking the most to the left whereas the "
                 "last folder will contain the faces looking the most to the right. If the number "
                 "of images doesn't divide evenly into the number of bins, the remaining images "
                 "get put in the last bin. Default value: 5"))
 </s> add             help=_("Integer value. Number of folders that will be used to group by blur and "
                   "face-yaw. For blur folder 0 will be the least blurry, while the last folder "
                   "will be the blurriest. For face-yaw the number of bins is by how much 180 "
                   "degrees is divided. So if you use 18, then each folder will be a 10 degree "
                   "increment. Folder 0 will contain faces looking the most to the left whereas "
                   "the last folder will contain the faces looking the most to the right. If the "
                   "number of images doesn't divide evenly into the number of bins, the remaining "
                   "images get put in the last bin. Default value: 5"))) </s> remove             help="R|Choose which action you want to perform. NB: All actions require an "
                 "alignments file (-a) to be passed in."
                 "\nL|'draw': Draw landmarks on frames in the selected folder/video. A subfolder "
                 "will be created within the frames folder to hold the output.{0}"
                 "\nL|'extract': Re-extract faces from the source frames/video based on alignment "
                 "data. This is a lot quicker than re-detecting faces. Can pass in the '-een' "
                 "(--extract-every-n) parameter to only extract every nth frame.{1}"
                 "\nL|'missing-alignments': Identify frames that do not exist in the alignments "
                 "file.{2}{0}"
                 "\nL|'missing-frames': Identify frames in the alignments file that do not appear "
                 "within the frames folder/video.{2}{0}"
                 "\nL|'multi-faces': Identify where multiple faces exist within the alignments "
                 "file.{2}{4}"
                 "\nL|'no-faces': Identify frames that exist within the alignment file but no "
                 "faces were detected.{2}{0}"
                 "\nL|'remove-faces': Remove deleted faces from an alignments file. The original "
                 "alignments file will be backed up.{3}"
                 "\nL|'rename' - Rename faces to correspond with their parent frame and position "
                 "index in the alignments file (i.e. how they are named after running extract).{3}"
                 "\nL|'sort': Re-index the alignments from left to right. For alignments with "
                 "multiple faces this will ensure that the left-most face is at index 0."
                 "\nL|'spatial': Perform spatial and temporal filtering to smooth alignments "
                 "(EXPERIMENTAL!)".format(frames_dir, frames_and_faces_dir, output_opts, faces_dir,
                                          frames_or_faces_dir)))
 </s> add             help=_("R|Choose which action you want to perform. NB: All actions require an "
                   "alignments file (-a) to be passed in."
                   "\nL|'draw': Draw landmarks on frames in the selected folder/video. A "
                   "subfolder will be created within the frames folder to hold the output.{0}"
                   "\nL|'extract': Re-extract faces from the source frames/video based on "
                   "alignment data. This is a lot quicker than re-detecting faces. Can pass in "
                   "the '-een' (--extract-every-n) parameter to only extract every nth frame.{1}"
                   "\nL|'missing-alignments': Identify frames that do not exist in the alignments "
                   "file.{2}{0}"
                   "\nL|'missing-frames': Identify frames in the alignments file that do not "
                   "appear within the frames folder/video.{2}{0}"
                   "\nL|'multi-faces': Identify where multiple faces exist within the alignments "
                   "file.{2}{4}"
                   "\nL|'no-faces': Identify frames that exist within the alignment file but no "
                   "faces were detected.{2}{0}"
                   "\nL|'remove-faces': Remove deleted faces from an alignments file. The "
                   "original alignments file will be backed up.{3}"
                   "\nL|'rename' - Rename faces to correspond with their parent frame and "
                   "position index in the alignments file (i.e. how they are named after running "
                   "extract).{3}"
                   "\nL|'sort': Re-index the alignments from left to right. For alignments with "
                   "multiple faces this will ensure that the left-most face is at index 0."
                   "\nL|'spatial': Perform spatial and temporal filtering to smooth alignments "
                   "(EXPERIMENTAL!)").format(frames_dir, frames_and_faces_dir, output_opts,
                                             faces_dir, frames_or_faces_dir))) </s> remove             group="faces",
            help="Input directory. A directory containing training images for face B. This is "
                 "the swap face, i.e. the face that you want to place onto the head of person "
                 "A."))
 </s> add             group=_("faces"),
            help=_("Input directory. A directory containing training images for face B. This is "
                   "the swap face, i.e. the face that you want to place onto the head of person "
                   "A.")))
            group=_("sort settings"),
              type=str,
              choices=("blur", "face", "face-cnn", "face-cnn-dissim", "face-yaw", "hist",
                       "hist-dissim", "color-gray", "color-luma", "color-green", "color-orange"),
              dest='sort_method',
            group=_("sort settings"),
              default="face",
              help="R|Sort by method. Choose how images are sorted. "
                   "\nL|'blur': Sort faces by blurriness."
                   "\nL|'face': Use VGG Face to sort by face similarity. This uses a pairwise "
                   "clustering algorithm to check the distances between 512 features on every face "
keep keep keep keep replace keep keep keep keep keep
 Add Locale support for cli arguments 
tools/sort/cli.py