Skip to content

WIP: Adds facebox_face_detect#14248

Closed
robmarkcole wants to merge 57 commits intohome-assistant:devfrom
robmarkcole:facebox
Closed

WIP: Adds facebox_face_detect#14248
robmarkcole wants to merge 57 commits intohome-assistant:devfrom
robmarkcole:facebox

Conversation

@robmarkcole
Copy link
Copy Markdown
Contributor

@robmarkcole robmarkcole commented May 2, 2018

Description:

Adds component for face detection (number of faces) using facebox. Run facebox with:

MB_KEY="INSERT-YOUR-KEY-HERE"

docker run -p 8080:8080 -e "MB_KEY=$MB_KEY" -e "MB_FACEBOX_DISABLE_RECOGNITION=true" machinebox/facebox

Pull request in home-assistant.github.io with documentation (if applicable): home-assistant/home-assistant.github.io#<5300>

Example entry for configuration.yaml (if applicable):

image_processing:
  - platform: facebox_face_detect
    ip_address: 192.168.0.1
    port: 8080
    source:
      - entity_id: camera.local_file

Checklist:

  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • New dependencies have been added to the REQUIREMENTS variable ([example][ex-requir]).
  • New dependencies are only imported inside functions that use them ([example][ex-import]).
  • New dependencies have been added to requirements_all.txt by running script/gen_requirements_all.py.
  • New files were added to .coveragerc.

If the code does not interact with devices:

  • Tests have been added to verify that the new code works.

Use ImageProcessingFaceEntity
Confidence overcomplicates the component and is meaningless
@robmarkcole
Copy link
Copy Markdown
Contributor Author

Test giving error:

Error on receive image from entity: Can't connect to http://127.0.0.1:8123/api/camera_proxy/camera.demo_camera?token=612eded1d17a290f08ddcf78ec5980ee4b9ea101ef65685020e9862f85702ffd

@balloob advises that in the latest dev, calling the camera scan service does not cause the camera to request a frame so I'm not sure what is wrong here

@balloob
Copy link
Copy Markdown
Member

balloob commented May 2, 2018

My bad, I implemented that in #14231 which has not been merged yet.

mjg59 and others added 21 commits May 3, 2018 06:57
Python 3.6's http client passes an additional argument to _send_output,
so add that to the function definition.
* Working but incomplete

* Remove events on unload

* Add unload test

* Fix failing sensor test

* Improve unload test

* Move DeconzEvent to init

* Fix visual under-indentation
* add initial precipitation support

* move attr to component

* remove blank line

* add forecast attributes to platform and update demo

* add tests

* break long lines

* calc lower temp correctly

* move all new attributes to component

* convert temp low only when existing
With Darksky allowing only 1000 API requests per day, 2 minutes retry seems to be bit closer to running over the limit and actually it did for 5 days in my account. Hence proposing a change to 5 minutes to keep the API happy and also it doesn't hurt to check the weather for every 5 mins than 2 mins someone lives in Jupiter :-P
* Fix TypeError on round(self.humidity)

Some weather platforms postpone the first data fetch for a while on init. As a result round(self.humidity is called before it is assigned a value, producing an error. This is a fix for that.

* Rewrite to avoid false negative evaluation

As per the suggestion from @OttoWinter, rewrite to avoid matching e.g. 0.0 as false.
* Fixes #14169 (upstream version bump)

* bump pyupnp-async version
- Instead of registering listeners in the entity __init__, do it in
   async_added_to_hass to avoid errors updating an entity which isn't fully
   set up yet
 - Change from schedule_update_ha_state to async_schedule_update_ha_state
iMicknl and others added 7 commits May 3, 2018 06:57
* Add basic PostNL sensor (WIP)

* Update PostNL sensor

* Bump version

* Small updates to PostNL package based on feedback

* Remove unused import

* Pass api to sensor

* Refactor based on feedback

* Update based on feedback

* Fix feedback

* Clean up

* Bugfiix

* Bugfix

* SCAN_INTERVAL fix

* Remove unused import

* Refactor for new wrapper implementation

* Update postnl package requirement

* Change throttle logic

* Update package version

* Add new line

* Minor changes

* Change refresh time to 30 minutes

* Update requirements_all.txt
* update python-openzwave to 4.1.0

* add service which updates the configuration files from github

* 0.4.3
* Add unique_id to zwave node entity

* Wait 30s before adding zwave node if its unique_id is not ready

* Use only node_id in unique_id. Update name, manufacturer, and product attributes on node update.
* Add restore_state to optimistic switch

* no need to schedule update

* test added

* lint

* new async syntax

* lint
* add template fan

* add-template: address PR comments

* add-template: remove unused import

* add-template: revert async_track_state_change change

* add-template: use yield from

* Revert "add-template: use yield from"

This reverts commit 1e05371.

* add-template: use yield

* add-template: remove unused import

* add-template: remove async_add_job usages

* use components

* add-template: use async/await

* add-template: fix style

* add-template: remove str()

* address pr comments

* fix style
Clarify that this component is for face detection by renaming component
and class
@robmarkcole robmarkcole requested review from a team, Kane610, cdce8p, dgomes and kellerza as code owners May 3, 2018 05:57
@robmarkcole robmarkcole requested a review from a team May 3, 2018 05:57
@robmarkcole robmarkcole requested a review from a team as a code owner May 3, 2018 05:57
@robmarkcole robmarkcole changed the title WIP: Adds image_processing component Facebox WIP: Adds image_processing component facebox_face_detect May 3, 2018
@robmarkcole robmarkcole changed the title WIP: Adds image_processing component facebox_face_detect WIP: Adds facebox_face_detect May 3, 2018
Fix position of name
@robmarkcole
Copy link
Copy Markdown
Contributor Author

robmarkcole commented May 4, 2018

OK I'm in a world of pain trying to resolve all these conflicts. I'm afraid I am going to have to resort to my old trick of deleting my fork and creating a fresh one

@robmarkcole robmarkcole closed this May 4, 2018
@robmarkcole robmarkcole mentioned this pull request May 4, 2018
8 tasks
@home-assistant home-assistant locked and limited conversation to collaborators Sep 5, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.