Skip to content

Commit

Permalink
Extract: Typing and standardization
Browse files Browse the repository at this point in the history
  • Loading branch information
torzdf committed Sep 30, 2022
1 parent 220335f commit 765e385
Show file tree
Hide file tree
Showing 22 changed files with 1,067 additions and 642 deletions.
12 changes: 12 additions & 0 deletions lib/align/detected_face.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,18 @@ def add_mask(self,
fsmask.add(mask, affine_matrix, interpolator)
self.mask[name] = fsmask

def add_landmarks_xy(self, landmarks: np.ndarray) -> None:
""" Add landmarks to the detected face object. If landmarks alread exist, they will be
overwritten.
Parameters
----------
landmarks: :class:`numpy.ndarray`
The 68 point face landmarks to add for the face
"""
logger.trace("landmarks shape: '%s'", landmarks.shape) # type: ignore
self._landmarks_xy = landmarks

def add_identity(self, name: Literal["vggface2"], embedding: np.ndarray, ) -> None:
""" Add an identity embedding to this detected face. If an identity already exists for the
given :attr:`name` it will be overwritten
Expand Down
4 changes: 2 additions & 2 deletions lib/training/preview_tk.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ def max_scale(self) -> int:

@property
def save_var(self) -> tk.BooleanVar:
""":class:`tkinter.IntVar`: Variable which is set to ``True`` when the save button has been.
pressed """
""":class:`tkinter.IntVar`: Variable which is set to ``True`` when the save button has
been. pressed """
retval = self._vars["save"]
assert isinstance(retval, tk.BooleanVar)
return retval
Expand Down
6 changes: 3 additions & 3 deletions plugins/convert/writer/ffmpeg.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ def _output_params(self) -> List[str]:

@property
def _audio_codec(self) -> Optional[str]:
""" str or ``None``: The audio codec to use. This will either be ``"copy"`` (the default) or
``None`` if skip muxing has been selected in configuration options, or if frame ranges have
been passed in the command line arguments. """
""" str or ``None``: The audio codec to use. This will either be ``"copy"`` (the default)
or ``None`` if skip muxing has been selected in configuration options, or if frame ranges
have been passed in the command line arguments. """
retval: Optional[str] = "copy"
if self.config["skip_mux"]:
logger.info("Skipping audio muxing due to configuration settings.")
Expand Down

0 comments on commit 765e385

Please sign in to comment.