Home

Awesome

HASS-Deepstack-scene

Home Assistant custom component for Deepstack scene recognition. Deepstack is a service which runs in a docker container and exposes deep-learning models via a REST API. Deepstack scene recognition classifies an image into one of 365 scenes (described in this readme). This integration adds an image processing entity with state that is the most likely scene for the image. The confidence of the classification is available in the entity attributes, and is on a scale from 0 to 1, with 0 being low confidence and 1 being high confidence.

Note that by default the component will not automatically scan images, but requires you to call the image_processing.scan service e.g. using an automation.

<p align="center"> <img src="https://github.com/robmarkcole/HASS-Deepstack-scene/blob/master/assets/main.png" width="800"> </p>

Home Assistant setup

Place the custom_components folder in your configuration directory (or add its contents to an existing custom_components folder). Then configure the integration. Add to your Home-Assistant config:

image_processing:
  - platform: deepstack_scene
    ip_address: localhost
    port: 5000
    api_key: mysecretkey
    source:
      - entity_id: camera.local_file

Configuration variables:

Scenes info

The 365 scenes are from the Places365 dataset. You can find them in this list.

Tensorflow lite alternative to deepstack

As an experiment I created a drop in replacement for deepstack that uses tensorflow-lite models at https://github.com/robmarkcole/tensorflow-lite-rest-server. Note that the predictions differ from those provided by Deepstack, and are less accurate. However it runs on a raspberry pi without requiring hardware acceleration.