Skip to content

Commit

Permalink
Formatting cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
torzdf committed Jun 16, 2019
1 parent 5917cc4 commit 416c52e
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 14 deletions.
7 changes: 5 additions & 2 deletions lib/cli.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/usr/bin/env python3
""" Command Line Arguments """

# pylint: disable=too-many-lines

import argparse
import logging
import os
Expand Down Expand Up @@ -532,7 +535,7 @@ def get_optional_arguments():
"extraction speed cost. Different methods will yield "
"different results on different sets."
"\nL|'none': Don't perform normalization on the face."
"\nL|`clahe`: Perform Contrast Limited Adaptive Histogram "
"\nL|'clahe': Perform Contrast Limited Adaptive Histogram "
"Equalization on the face."
"\nL|'hist': Equalize the histograms on the RGB channels."
"\nL|'mean': Normalize the face colors to the mean."})
Expand Down Expand Up @@ -734,7 +737,7 @@ def get_optional_arguments():
False),
"default": "opencv",
"help": "R|The plugin to use to output the converted images. The "
"writers are configurable in '/config/convert.ini' or `Edit "
"writers are configurable in '/config/convert.ini' or 'Edit "
"> Configure Convert Plugins:'"
"\nL|ffmpeg: [video] Writes out the convert straight to "
"video. When the input is a series of images then the "
Expand Down
2 changes: 1 addition & 1 deletion lib/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def stream_handler(loglevel, is_gui):


def crash_handler(log_format):
""" Add a handler that sores the last 50 debug lines to `debug_buffer`
""" Add a handler that sores the last 50 debug lines to 'debug_buffer'
for use in crash reports """
log_crash = logging.StreamHandler(debug_buffer)
log_crash.setFormatter(log_format)
Expand Down
41 changes: 30 additions & 11 deletions lib/umeyama.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,33 @@
## License (Modified BSD)
## Copyright (C) 2011, the scikit-image team All rights reserved.
##
## Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
##
## Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
## Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
## Neither the name of skimage nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
## THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

# umeyama function from scikit-image/skimage/transform/_geometric.py
#!/usr/bin/env python3
""" Umeyama for Faceswap
License (Modified BSD)
Copyright (C) 2011, the scikit-image team All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted
provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list of conditions
and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this list of
conditions and the following disclaimer in the documentation and/or other materials provided
with the distribution.
Neither the name of skimage nor the names of its contributors may be used to endorse or promote
products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
umeyama function from scikit-image/skimage/transform/_geometric.py
"""
import numpy as np

MEAN_FACE_X = np.array([
Expand All @@ -32,6 +50,7 @@
0.864805, 0.784792, 0.778746, 0.785343, 0.778746, 0.784792, 0.824182,
0.831803, 0.824182])


def umeyama(src, estimate_scale, dst=None):
"""Estimate N-D similarity transformation with or without scaling.
Parameters
Expand Down

0 comments on commit 416c52e

Please sign in to comment.