Code Monkey home page Code Monkey logo

hass-sighthound's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

hass-sighthound's Issues

Graph Vehicle Statistics

Firstly, thank you for an awesome add to Home Assistant. I've been playing with this, and thoroughly enjoy it. I have a suggestion for an improvement. As someone who has high traffic in front of their house, it would be interesting to see statistics on vehicles that pass by. For example, right now in my events I can see the following data:

{"entity_id": "image_processing.sighthound_garage_2", "plate": "JDJ7182", "vehicle_type": "car", "make": "Mercedes-Benz", "model": "CLS-Class", "color": "black", "region": "Mississippi", "bounding_box": [0.13503, 0.20703, 0.47454, 0.47266]}

It would be great to gather statistics on how many Ford, Mercedes-Benz, etc... the system recognizes over time. The same for color, region, model, etc...

At this time, the only method I can identify is a database query.

Add test

with patch("pillow.save_image") as mock_save:
    # call the HA code
    mock_save.assert_called_with(*args, **kwargs)

Blacklist

I tried to add this into HACS and it said that this repo is in the blacklist. Was curious if its possible for it to be un-blacklisted

Possible to make it work locally?

I cannot rely on internet connection in the area where i plan to use this. So is offline motion detection as trigger possible? I thought the desktop apps is also offline?

[feature request] Add `watched_plate` config arg

Add watched_plate config arg which is a list of plates to watch for, with an entity created for each where the state is the time of the last detection of the plate. If a plate with the same number is matched, or similar by at least 4 characters, update this entity.

Archive this repo

As of HA 0.107 most of the functionality of this CC will be in the official integration. The only difference being that this CC provides the sighthound.file_saved events (can be reproduced using the folder_watcher integration), and supports face detection. Update the official integration docs and archive this repo

[feature request] Add option to always save image

Is it possible to add a configuration option (boolean true/false) to always save the image, even when no vehicle/people is found?
At the moment the image is written only if detections are greater than zero.

I use the generated image as a local_file camera in HA, so it can be useful to use the latest image to show the updated situation (in a picture-glance card).

Home Assistant 2022.3.8 with Home Assistant OS 7.6 Requirements for sighthound not found: ['pillow==7.2.0'].

Hello,
When upgrated to Home Assistant OS 7.6 I see;

ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts
WARNING: You are using pip version 22.0.3; however, version 22.0.4 is available.
You should consider upgrading via the '/usr/local/bin/python3 -m pip install --upgrade pip' command.
2022-04-09 14:15:44 ERROR (stream_worker) [homeassistant.components.stream.stream.camera.kamera_dome1] Error from stream worker: Error opening stream (ERRORTYPE_113, Host is unreachable) rtsp://192.168.1.7/ch0_0.h264
2022-04-09 14:15:45 ERROR (SyncWorker_7) [homeassistant.util.package] Unable to install package pillow==7.2.0: ERROR: Cannot install pillow==7.2.0 because these package versions have conflicting dependencies.
ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts
WARNING: You are using pip version 22.0.3; however, version 22.0.4 is available.
You should consider upgrading via the '/usr/local/bin/python3 -m pip install --upgrade pip' command.

in logs. Can Ypu please tell me what to do?

Sighthound throws ERROR_UNAUTHORIZED error

I keep getting an error

2018-06-19 09:03:52 ERROR (SyncWorker_9) [custom_components.image_processing.sighthound] sighthound error code 401: {"error":"ERROR_UNAUTHORIZED","reason":"Unauthorized token","reasonCode":40102}

I tried the curl command and get the same error:

arsaboo@aloknuc:~$ curl -X POST https://dev.sighthoundapi.com/v1/detections?type=face,person&faceOption=landmark,gender \
> -H "Content-Type: application/json" \
> -H "X-Access-Token: APIKEY" \
> -d '{"image": "https://images.pexels.com/photos/415829/pexels-photo-415829.jpeg"}'
[1] 31237
-H: command not found
arsaboo@aloknuc:~$ {"error":"ERROR_UNAUTHORIZED","reason":"Required header: X-Access-Token","reasonCode":40101}

Changing the order in the curl command works. So, the following works:

arsaboo@aloknuc:~$ curl -X POST -H "Content-Type: application/json" -H "X-Access-Token: APIKEY" -d '{"image": "https://images.pexels.com/photos/415829/pexels-photo-415829.jpeg"}' https://dev.sighthoundapi.com/v1/detections?type=face,person&faceOption=landmark,gender

Defocus event unknown

My Hikvision ANPR camera throws out lots of ‘defocus‘ events, which aren’t in the list of event constants for pyhik and fill the hass log with errors. It’s one of the Smart Events on the camera, though switching those off in the config UI makes no difference. Possible to add this event name to the list?

image_processing.file_saved event never fires

I'm using this custom integration through HACS. I'm running Home Assistant on Docker (version 0.105). I'm able to run image_processing.scan successfully and it saves the processed image to my www folder. The person_detected' event fires but the file_saved` event is never fired. So I'm struggling to use this in an automation to send the image in a notification. Let me know what additional information is needed to help debug this error.

Limited vehicle data back from Sighthound

How did you get the vechicle make and model to show up? When I run Image processing: scan all I get is the following in attributes

last_vehicle: 2021-05-12_16:46:17
plates: unknown, unknown
unit_of_measurement: vehicle
friendly_name: sighthound_vehicle_driveway

need to check and exit on None detections

As reported on forums:

File “/config/custom_components/sighthound/image_processing.py”, line 112, in process_image
self.faces = hound.get_faces(detections)
File “/usr/local/lib/python3.7/site-packages/simplehound/core.py”, line 54, in get_faces
for obj in detections[“objects”]:
TypeError: ‘NoneType’ object is not subscriptable

Caused when detections is None and we are calling get_faces(). We need to check and exit on None detections

Check response status code

The following error is caused by status code not being checked:

Update for image_processing.sighthound_porch fails
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 197, in async_update_ha_state
    yield from self.async_device_update()
  File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 318, in async_device_update
    yield from self.async_update()
  File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/components/image_processing/__init__.py", line 145, in async_update
    yield from self.async_process_image(image.content)
  File "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 56, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/home/homeassistant/.homeassistant/custom_components/image_processing/sighthound.py", line 110, in process_image
    self.faces, self.persons = parse_api_response(response)
  File "/home/homeassistant/.homeassistant/custom_components/image_processing/sighthound.py", line 41, in parse_api_response
    for obj in response.json()['objects']:
KeyError: 'objects'

Car color and model

Is there anyway, sorry if i missed it, to get the car color and model detection working?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.