Skip to content

Add support for DOODS Image Processing#26208

Merged
MartinHjelmare merged 15 commits into
home-assistant:devfrom
snowzach:doods
Sep 11, 2019
Merged

Add support for DOODS Image Processing#26208
MartinHjelmare merged 15 commits into
home-assistant:devfrom
snowzach:doods

Conversation

@snowzach
Copy link
Copy Markdown
Contributor

@snowzach snowzach 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.

Copy link
Copy Markdown
Member

@pvizeli pvizeli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@snowzach
Copy link
Copy Markdown
Contributor Author

snowzach 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
Copy link
Copy Markdown
Contributor Author

@pvizeli I made the connection into a module.

@pvizeli
Copy link
Copy Markdown
Member

pvizeli commented Aug 27, 2019

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

@snowzach
Copy link
Copy Markdown
Contributor Author

@pvizeli all green now.

Comment thread homeassistant/components/doods/image_processing.py
Comment thread homeassistant/components/doods/image_processing.py Outdated
Comment thread homeassistant/components/doods/image_processing.py Outdated
Comment thread homeassistant/components/doods/image_processing.py
Comment thread homeassistant/components/doods/image_processing.py Outdated
Comment thread homeassistant/components/doods/image_processing.py Outdated
Comment thread homeassistant/components/doods/image_processing.py Outdated
Comment thread homeassistant/components/doods/image_processing.py Outdated
Comment thread homeassistant/components/doods/image_processing.py Outdated
Comment thread homeassistant/components/doods/image_processing.py Outdated
Comment thread homeassistant/components/doods/image_processing.py Outdated
Comment thread homeassistant/components/doods/image_processing.py Outdated
Comment thread homeassistant/components/doods/image_processing.py Outdated
@snowzach
Copy link
Copy Markdown
Contributor Author

snowzach 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
Copy Markdown
Member

@MartinHjelmare MartinHjelmare left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@pvizeli?

@snowzach
Copy link
Copy Markdown
Contributor Author

snowzach commented Sep 4, 2019

@pvizeli are you able to complete your review?

@snowzach
Copy link
Copy Markdown
Contributor Author

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
Copy link
Copy Markdown
Contributor Author

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

@MartinHjelmare
Copy link
Copy Markdown
Member

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

@MartinHjelmare MartinHjelmare merged commit 1eef758 into home-assistant:dev Sep 11, 2019
@pvizeli
Copy link
Copy Markdown
Member

pvizeli 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

None yet

Development

Successfully merging this pull request may close these issues.

4 participants