Skip to content

Commit

Permalink
Bugfixes
Browse files Browse the repository at this point in the history
  - Sort - Fix rare help-text parsing bug
  - Manual - Fix issue where frame count is incorrect when een > 1 used on extract
  • Loading branch information
torzdf committed Mar 30, 2022
1 parent 7f3e6bc commit 23d92c1
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 6 deletions.
Binary file modified locales/es/LC_MESSAGES/tools.sort.cli.mo
Binary file not shown.
6 changes: 3 additions & 3 deletions locales/es/LC_MESSAGES/tools.sort.cli.po
Original file line number Diff line number Diff line change
Expand Up @@ -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 "
Expand All @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion locales/tools.sort.cli.pot
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 6 additions & 1 deletion tools/manual/detected_faces.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,9 @@ def __init__(self, detected_faces, input_location):
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):
Expand All @@ -270,6 +272,7 @@ def load(self):
_ = 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
Expand Down Expand Up @@ -301,6 +304,8 @@ def revert_to_saved(self, frame_index):
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]

Expand Down
2 changes: 1 addition & 1 deletion tools/sort/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ def get_argument_list():
"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'),
Expand Down

0 comments on commit 23d92c1

Please sign in to comment.