Skip to content
This repository has been archived by the owner on Mar 19, 2023. It is now read-only.

Commit

Permalink
Update image_processing.py
Browse files Browse the repository at this point in the history
  • Loading branch information
robmarkcole committed Jan 1, 2021
1 parent 912415c commit 2f726d2
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions custom_components/deepstack_object/image_processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ def process_image(self, image):

if self._save_file_folder and self._state > 0:
saved_image_path = self.save_image(
image, self._targets, self._confidence, self._save_file_folder,
image, self._targets_found, self._save_file_folder,
)

# Fire events
Expand Down Expand Up @@ -338,7 +338,7 @@ def device_state_attributes(self) -> Dict:
attr[CONF_SAVE_TIMESTAMPTED_FILE] = self._save_timestamped_file
return attr

def save_image(self, image, targets, confidence, directory) -> str:
def save_image(self, image, targets, directory) -> str:
"""Draws the actual bounding box of the detected objects.
Returns: saved_image_path, which is the path to the saved timestamped file if configured, else the default saved image.
Expand All @@ -356,11 +356,9 @@ def save_image(self, image, targets, confidence, directory) -> str:
draw, roi_tuple, img.width, img.height, text="ROI", color=GREEN,
)

for obj in self._objects:
for obj in targets:
if not self._show_boxes:
break
if not obj["name"] in self._targets:
continue
name = obj["name"]
confidence = obj["confidence"]
box = obj["bounding_box"]
Expand Down

0 comments on commit 2f726d2

Please sign in to comment.