Skip to content

Commit

Permalink
Catch 0 size images earlier + plaidml version + minor gui update (dee…
Browse files Browse the repository at this point in the history
  • Loading branch information
kilroythethird authored and torzdf committed Aug 7, 2019
1 parent c9c1e31 commit 62c1d43
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/gui/display_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ def add_option_refresh(self):
command=lambda: tk_var.set(True))
btnrefresh.pack(padx=2, side=tk.RIGHT)
Tooltip(btnrefresh,
text="Graph updates every 100 iterations. Click to refresh now.",
text="Graph updates at every model save. Click to refresh now.",
wraplength=200)
logger.debug("Added refresh option")

Expand Down
7 changes: 7 additions & 0 deletions plugins/extract/detect/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,13 @@ def finalize(self, output):
logger.trace("Item out: %s", {key: val
for key, val in output.items()
if key != "image"})
# Prevent zero size faces
iheight, iwidth = output["image"].shape[:2]
output["detected_faces"] = [
f for f in output.get("detected_faces", list())
if f["right"] > 0 and f["left"] < iwidth
and f["bottom"] > 0 and f["top"] < iheight
]
if self.min_size > 0 and output.get("detected_faces", None):
output["detected_faces"] = self.filter_small_faces(output["detected_faces"])
else:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ def update_tf_dep_conda(self):
def update_amd_dep(self):
""" Update amd dependency for AMD cards """
if self.enable_amd:
self.required_packages.append("plaidml-keras==0.6.3")
self.required_packages.append("plaidml-keras==0.6.4")


class Output():
Expand Down

0 comments on commit 62c1d43

Please sign in to comment.