diff --git a/README.md b/README.md index b8710fd..5ba8a4e 100644 --- a/README.md +++ b/README.md @@ -70,9 +70,8 @@ Configuration variables:

#### Event `image_processing.object_detected` -An event `image_processing.object_detected` is fired for each object detected above the configured `confidence` threshold. An example use case for this is incrementing a [counter](https://www.home-assistant.io/components/counter/) when a person is detected. The `image_processing.object_detected` event payload includes: +An event `image_processing.object_detected` is fired for each object detected above the configured `confidence` threshold. This is the recommended way to check the confidence of detections, and to keep track of objects that are not configured as the `target` (configure logger level to `debug` to observe events in the Home Assistant logs). An example use case for event is to get an alert when some rarely appearing object is detected, or to increment a [counter](https://www.home-assistant.io/components/counter/). The `image_processing.object_detected` event payload includes: -- `classifier` : the classifier (i.e. `deepstack_object`) - `entity_id` : the entity id responsible for the event - `object` : the object detected - `confidence` : the confidence in detection in the range 0 - 1 where 1 is 100% confidence. @@ -98,7 +97,6 @@ An example automation using the `image_processing.object_detected` event is give #### Event `image_processing.file_saved` If `save_file_folder` is configured, an new image will be saved with bounding boxes of detected `target` objects, and the filename will include the time of the image capture. On saving this image a `image_processing.file_saved` event is fired, with a payload that includes: -- `classifier` : the classifier (i.e. `deepstack_object`) - `entity_id` : the entity id responsible for the event - `file` : the full path to the saved file diff --git a/custom_components/deepstack_object/image_processing.py b/custom_components/deepstack_object/image_processing.py index a533220..16f3952 100644 --- a/custom_components/deepstack_object/image_processing.py +++ b/custom_components/deepstack_object/image_processing.py @@ -42,7 +42,6 @@ _LOGGER = logging.getLogger(__name__) -CLASSIFIER = "deepstack_object" CONF_API_KEY = "api_key" CONF_TARGET = "target" CONF_TIMEOUT = "timeout" @@ -265,7 +264,6 @@ def fire_prediction_events(self, predictions, confidence): self.hass.bus.fire( EVENT_OBJECT_DETECTED, { - "classifier": CLASSIFIER, ATTR_ENTITY_ID: self.entity_id, OBJECT: prediction["label"], ATTR_CONFIDENCE: ds.format_confidence(prediction["confidence"]), @@ -275,8 +273,7 @@ def fire_prediction_events(self, predictions, confidence): def fire_saved_file_event(self, save_path): """Fire event when saving a file""" self.hass.bus.fire( - EVENT_FILE_SAVED, - {"classifier": CLASSIFIER, ATTR_ENTITY_ID: self.entity_id, FILE: save_path}, + EVENT_FILE_SAVED, {ATTR_ENTITY_ID: self.entity_id, FILE: save_path} ) @property @@ -307,10 +304,7 @@ def device_state_attributes(self): """Return device specific state attributes.""" attr = {} attr["target"] = self._target - attr["target_confidences"] = self._targets_confidences - attr["summary"] = self._summary if self._last_detection: attr["last_detection"] = self._last_detection.strftime("%Y-%m-%d %H:%M:%S") - if hasattr(self, "_save_file_folder"): - attr["save_file_folder"] = self._save_file_folder + attr["summary"] = self._summary return attr diff --git a/docs/object_detail.png b/docs/object_detail.png index f10f261..1926938 100644 Binary files a/docs/object_detail.png and b/docs/object_detail.png differ