Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for DOODS Image Processing #26208

Merged
merged 15 commits into from Sep 11, 2019

Conversation

@snowzach
Copy link
Contributor

commented Aug 26, 2019

Description:

This change adds support for DOODS Object Detection service. It's basically an easy way to run Tensorflow remotely.

Pull request with documentation for home-assistant.io (if applicable): home-assistant/home-assistant.io/pull/10228

Example entry for configuration.yaml (if applicable):

image_processing:
  - platform: doods
    scan_interval: 1000
    url: "http://<my docker host>:8080"
    detector: default
    file_out:
      - "/tmp/{{ camera_entity.split('.')[1] }}_latest.jpg"
    source:
      - entity_id: camera.front_yard
    confidence: 50
    labels:
      - name: person
        confidence: 40
        area:
          # Exclude top 10% of image
          top: 0.1
          # Exclude right 15% of image
          right: 0.85
      - car
      - truck

Checklist:

  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist

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

home-assistant/home-assistant.io#10228

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

  • [X]The manifest file_]manifest-docs has all fields filled out correctly. Update and include derived files by running python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt by running python3 -m script.gen_requirements_all.
  • Untested files have been added to .coveragerc.

If the code does not interact with devices:

  • Tests have been added to verify that the new code works.
@project-bot project-bot bot added this to Needs review in Dev Aug 26, 2019
@snowzach snowzach referenced this pull request Aug 26, 2019
2 of 2 tasks complete
Copy link
Member

left a comment

It does not allow to use requests directly. You need to create a small wrapper library.

Dev automation moved this from Needs review to Review in progress Aug 26, 2019
@snowzach

This comment has been minimized.

Copy link
Contributor Author

commented Aug 26, 2019

It does not allow to use requests directly. You need to create a small wrapper library.

@pvizeli can you give me an example of a library that implements a wrapper for requests? I'm not great at python and would prefer to copy one. I looked at a handful and it appears that everyone uses requests directly.
Nevermind, I see what you meant. I have to create a doods library and add it to pypi

@snowzach

This comment has been minimized.

Copy link
Contributor Author

commented Aug 27, 2019

@pvizeli I made the connection into a module.

@pvizeli

This comment has been minimized.

Copy link
Member

commented Aug 27, 2019

@snowzach now you need address all CI issues. Until everthing is not green, there will be no review

snowzach added 4 commits Aug 27, 2019
@snowzach

This comment has been minimized.

Copy link
Contributor Author

commented Aug 28, 2019

@pvizeli all green now.

homeassistant/components/doods/image_processing.py Outdated Show resolved Hide resolved
homeassistant/components/doods/image_processing.py Outdated Show resolved Hide resolved
homeassistant/components/doods/image_processing.py Outdated Show resolved Hide resolved
homeassistant/components/doods/image_processing.py Outdated Show resolved Hide resolved
homeassistant/components/doods/image_processing.py Outdated Show resolved Hide resolved
homeassistant/components/doods/image_processing.py Outdated Show resolved Hide resolved
homeassistant/components/doods/image_processing.py Outdated Show resolved Hide resolved
homeassistant/components/doods/image_processing.py Outdated Show resolved Hide resolved
@snowzach

This comment has been minimized.

Copy link
Contributor Author

commented Sep 3, 2019

@MartinHjelmare or @pvizeli do I need to do anything else to get this accepted? I may have messed up the process. I committed the changes by hand vs accepting yours because I ended up fixing another problem.

Copy link
Member

left a comment

Looks good!

@pvizeli?

@snowzach

This comment has been minimized.

Copy link
Contributor Author

commented Sep 4, 2019

@pvizeli are you able to complete your review?

@snowzach

This comment has been minimized.

Copy link
Contributor Author

commented Sep 11, 2019

Hi @pvizeli just checking in if you are able to review this? Sorry if there's a formal process for this. I'm not familiar.

@snowzach

This comment has been minimized.

Copy link
Contributor Author

commented Sep 11, 2019

@MartinHjelmare are you able to keep this moving since I address @pvizeli 's request to wrap server interaction in a library?

@MartinHjelmare

This comment has been minimized.

Copy link
Member

commented Sep 11, 2019

Ok. We have a whole release cycle to address things if needed.

@MartinHjelmare MartinHjelmare merged commit 1eef758 into home-assistant:dev Sep 11, 2019
11 checks passed
11 checks passed
CI Build #20190903.40 succeeded
Details
CI (FullCheck Mypy) FullCheck Mypy succeeded
Details
CI (FullCheck Pylint) FullCheck Pylint succeeded
Details
CI (Overview CheckFormat) Overview CheckFormat succeeded
Details
CI (Overview Lint) Overview Lint succeeded
Details
CI (Overview Validate) Overview Validate succeeded
Details
CI (Tests PyTest Python36) Tests PyTest Python36 succeeded
Details
CI (Tests PyTest Python37) Tests PyTest Python37 succeeded
Details
cla-bot Everyone involved has signed the CLA
codecov/patch Coverage not affected when comparing 248619a...801943d
Details
codecov/project 93.98% (target 90%)
Details
Dev automation moved this from Review in progress to Done Sep 11, 2019
@pvizeli

This comment has been minimized.

Copy link
Member

commented Sep 12, 2019

I think we did not allow in past to write out images. I think we should enable that as entity picture and use it on component itself, because it work for all platform all time in same way. Maybe @snowzach have the knowlage to address this for all image processing platforms?

@lock lock bot locked and limited conversation to collaborators Sep 13, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Dev
  
Done
4 participants
You can’t perform that action at this time.