Skip to content

Commit

Permalink
Analyzer - draw image even if no faces are detected
Browse files Browse the repository at this point in the history
  • Loading branch information
tomas-gajarsky committed Nov 13, 2022
1 parent 51ffe27 commit 6951cdf
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions facetorch/analyzer/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ def _predict_batch(
self.logger.info("Running FaceAnalyzer")
self.logger.info("Reading image", extra={"path_image": path_image})
data = self.reader.run(path_image, fix_img_size=fix_img_size)
path_output = None if path_output == "None" else path_output
data.path_output = path_output
data.version = pkg_resources.get_distribution("facetorch").version

self.logger.info("Detecting faces")
Expand All @@ -133,13 +135,13 @@ def _predict_batch(
self.logger.info(f"Running FacePredictor: {predictor_name}")
data = _predict_batch(data, predictor, predictor_name)

path_output = None if path_output == "None" else path_output
data.path_output = path_output

self.logger.info("Utilizing facial features")
for utilizer_name, utilizer in self.utilizers.items():
self.logger.info(f"Running BaseUtilizer: {utilizer_name}")
data = utilizer.run(data)
else:
if "save" in self.utilizers:
self.utilizers["save"].run(data)

if not include_tensors:
self.logger.debug(
Expand Down

0 comments on commit 6951cdf

Please sign in to comment.