robmarkcole / HASS-amazon-rekognition

Home Assistant Object detection with Amazon Rekognition
https://aws.amazon.com/blogs/aws/amazon-rekognition-image-detection-and-recognition-powered-by-deep-learning/
MIT License
87 stars 8 forks source link

Summary 0 #118

Open chimcanhcut1112 opened 2 years ago

chimcanhcut1112 commented 2 years ago

I dont know i have mistake somewhere, can help me 🥺

I see All object 98.533 but Summary = 0 , don't know why.

Here's my setting.

  - platform: amazon_rekognition
    aws_access_key_id: XXX
    aws_secret_access_key: XXX
    region_name: ap-southeast-1 # optional region, default is us-east-1
    confidence: 60 # Optional, default is 80 percent
    targets:
      - target: person
      - target: car
      - target: cat
      - target: dog
      - target: pug
        confidence: 60
    # show_boxes: False
    # roi_x_min: 0.35 # optional, range 0-1, must be less than roi_x_max
    roi_x_max: 0.8 # optional, range 0-1, must be more than roi_x_min
    roi_y_min: 0.4 # optional, range 0-1, must be less than roi_y_max
    roi_y_max: 0.8 # optional, range 0-1, must be more than roi_y_min
    scale: 0.75
    save_file_format: png
    save_file_folder: /config/www/amazon-rekognition/ # Optional image storage
    save_timestamped_file: True # Set True to save timestamped images, default False
    s3_bucket: my_already_existing_bucket
    always_save_latest_file: True
    source:
      - entity_id: camera.frontgate

Screenshot_20220730_001931_io homeassistant companion android

robmarkcole commented 2 years ago

@chimcanhcut1112 you really dont want to be posting your aws creds online, so I commented them out

Everything looks fine, so all I can suggest is restarting the integration. Possibly the detections are outside the ROI so you could remove that also

chimcanhcut1112 commented 2 years ago

are

@chimcanhcut1112 you really dont want to be posting your aws creds online, so I commented them out

Everything looks fine, so all I can suggest is restarting the integration. Possibly the detections are outside the ROI so you could remove that also

Thank you. I will try remove ROI

chimcanhcut1112 commented 2 years ago

@chimcanhcut1112 you really dont want to be posting your aws creds online, so I commented them out

Everything looks fine, so all I can suggest is restarting the integration. Possibly the detections are outside the ROI so you could remove that also

I try remove ROI and reinstall bắc but nothing happend :(

robmarkcole commented 2 years ago

Which version of home assistant are you running?

chimcanhcut1112 commented 2 years ago

Hi, im use latest version

![Uploading Screenshot_20220730_114541_io.homeassistant.companion.android.jpg…]()

robmarkcole commented 2 years ago

I dont have this issue on Home Assistant 2022.8.0

fberbert commented 1 year ago

To circumvent this problem you can create a sensor based on templates, since in the entity attributes report you have the objects listed. Just create a loop interacting with the "all_objects" array. An example template for your case would be (configuration.yaml):

sensor:
  - platform: template
    sensors:
      has_person:
        friendly_name: "has person"
        unit_of_measurement: 'persons'
        value_template: >
          {% set arr_obj = state_attr('image_processing.rekognition_livingroomcam', 'all_objects') %}
          {% for obj in arr_obj %}
            {% for key in obj %}
              {% if obj[key] >= 60 and key == "person" %}
                1
              {% endif %}
            {% endfor %}
          {% endfor %}

Restart HA, call recognition service and you will have a sensor called has_person.