- Sort - Fix rare help-text parsing bug
  - Manual - Fix issue where frame count is incorrect when een > 1 used on extract
This commit is contained in:
torzdf 2022-03-30 02:54:29 +01:00
parent 7f3e6bc3cf
commit 23d92c1f0d
5 changed files with 11 additions and 6 deletions

View File

@ -184,7 +184,7 @@ msgid ""
"right. If the number of images doesn't divide evenly into the number of "
"bins, the remaining images get put in the last bin. For black-pixels it "
"represents the divider of the percentage of black pixels. For 10, first "
"folder will have the faces with 0 to 10% black pixels, second 11 to 20%, "
"folder will have the faces with 0 to 10%% black pixels, second 11 to 20%%, "
"etc. Default value: 5"
msgstr ""
"Valor entero. Número de carpetas que se utilizarán al agrupar por 'blur' y "
@ -196,8 +196,8 @@ msgstr ""
"caras que miren más a la derecha. Si el número de imágenes no se divide "
"uniformemente en el número de carpetas, las imágenes restantes se colocan en "
"la última carpeta. Para píxeles negros, representa el divisor del porcentaje "
"de píxeles negros. Para 10, la primera carpeta tendrá las caras con 0 a 10% "
"de píxeles negros, la segunda de 11 a 20%, etc. Valor por defecto: 5"
"de píxeles negros. Para 10, la primera carpeta tendrá las caras con 0 a 10%% "
"de píxeles negros, la segunda de 11 a 20%%, etc. Valor por defecto: 5"
#: tools/sort/cli.py:154 tools/sort/cli.py:164
msgid "settings"

View File

@ -85,7 +85,7 @@ msgid "Group by method. When -fp/--final-processing by folders choose the how th
msgstr ""
#: tools/sort/cli.py:140
msgid "Integer value. Number of folders that will be used to group by blur, face-yaw and black-pixels. 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. For black-pixels it represents the divider of the percentage of black pixels. For 10, first folder will have the faces with 0 to 10% black pixels, second 11 to 20%, etc. Default value: 5"
msgid "Integer value. Number of folders that will be used to group by blur, face-yaw and black-pixels. 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. For black-pixels it represents the divider of the percentage of black pixels. For 10, first folder will have the faces with 0 to 10%% black pixels, second 11 to 20%%, etc. Default value: 5"
msgstr ""
#: tools/sort/cli.py:154 tools/sort/cli.py:164

View File

@ -255,7 +255,9 @@ class _DiskIO(): # pylint:disable=too-few-public-methods
self._tk_edited = detected_faces.tk_edited
self._tk_face_count_changed = detected_faces.tk_face_count_changed
self._globals = detected_faces._globals
self._sorted_frame_names = sorted(self._alignments.data)
# Must be populated after loading faces as video_meta_data may have increased frame count
self._sorted_frame_names = None
logger.debug("Initialized %s", self.__class__.__name__)
def load(self):
@ -270,6 +272,7 @@ class _DiskIO(): # pylint:disable=too-few-public-methods
_ = face.aligned.average_distance # cache the distances
this_frame_faces.append(face)
self._frame_faces.append(this_frame_faces)
self._sorted_frame_names = sorted(self._alignments.data)
def save(self):
""" Convert updated :class:`~lib.align.DetectedFace` objects to alignments format
@ -301,6 +304,8 @@ class _DiskIO(): # pylint:disable=too-few-public-methods
logger.debug("Alignments not amended. Returning")
return
logger.verbose("Reverting alignments for frame_index %s", frame_index)
print(frame_index)
print(len(self._sorted_frame_names))
alignments = self._alignments.data[self._sorted_frame_names[frame_index]]["faces"]
faces = self._frame_faces[frame_index]

View File

@ -146,7 +146,7 @@ class SortArgs(FaceSwapArgs):
"right. If the number of images doesn't divide evenly into the number of "
"bins, the remaining images get put in the last bin. For black-pixels it "
"represents the divider of the percentage of black pixels. For 10, first "
"folder will have the faces with 0 to 10% black pixels, second 11 to 20%, "
"folder will have the faces with 0 to 10%% black pixels, second 11 to 20%%, "
"etc. Default value: 5")))
argument_list.append(dict(
opts=('-l', '--log-changes'),