Giter Site home page Giter Site logo

whosatmyfeeder's People

Contributors

mmcc-xx avatar tomtom215 avatar

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  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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

whosatmyfeeder's Issues

dark mode?

First of all thank you for making this!

Just trying to think of things to improve this project but that's all I could think of.

Great work, thanks again.

How to tell if whosatmyfeeder is working?

New to all of these software packages. I installed both Frigate and WhosAtMyFeeder on my unraid box. Frigate appears to be detecting what is needed, only had one detection of a bird and it was actually a squirrel. The issue im potentially running into is, how do i know if this is actually working. When Frigate classified the squirrel as a bird, it never showed up in WhosAtMyFeeder even though it was incorrect, i also did not see anything in the logs for WhosAtMyFeeder to suggest it decided against the squirrel.

So, how do i know this is working?

Below is my frigate config

mqtt:
  host: 192.168.0.134
  port: 1883
  topic_prefix: frigate
  user: user
  password: pass
  stats_interval: 60
detectors:
  tensorrt:
    type: tensorrt
    device: 0
model:
  path: /trt-models/yolov7-tiny-416.trt
  input_tensor: nchw
  input_pixel_format: rgb
  width: 416
  height: 416
ffmpeg:
  global_args: -hide_banner -loglevel warning
  hwaccel_args: preset-nvidia-h264
  input_args: preset-rtsp-generic
  output_args:
    # Optional: output args for detect streams (default: shown below)
    detect: -threads 2 -f rawvideo -pix_fmt yuv420p
    # Optional: output args for record streams (default: shown below)
    record: preset-record-generic
detect:
  width: 1920
  height: 1080
  enabled: true
objects:
  track:
    - bird
    - dog
    - person
  filters:
    bird:
      threshold: 0.6
      min_area: 5000
snapshots:
  enabled: true
cameras:
  birdcam:
    record:
        enabled: True
        events:
          pre_capture: 5
          post_capture: 5
          objects:
            - bird
    ffmpeg:
      hwaccel_args: preset-nvidia-h264
      inputs:
        - path: rtsp://192.168.0.199:8554/cam
          roles:
            - detect
            - record
    live:
      stream_name: birdcam
    mqtt:
      enabled: True
      bounding_box: False #this will get rid of the box around the bird. We already know it is a bird. Sheesh.
      timestamp: False #this will get rid of the time stamp in the image. 
      quality: 95 #default quality is 70, which will get you lots of compression artifacts

Species Identification

Ever since Ubiquity updated Protect to version UniFi OS 3.1.16, Frigate has quite identifying bird species. It still identifies ~50 "birds" a day, but it doesn't identify the actual species like it used to. I am not seeing any errors that would indicate way.

v/r
Jon

Frigate detection tips

Any tips on how to get frigate to detect birds better? I've got a 4k camera and have tried various angles, settings, etc but it seems to only pick them up "sometimes" even with what I would consider a very clear and dead-on view on the bird. Love the app by the way this is super cool.

Log seems to show a recognition, but nothing appears in UI

I see this in the container's logs:

Category(index=481, score=0.515625, display_name='Turdus merula', category_name='/m/0197mw')
2023-05-27 09:06:07
Category(index=481, score=0.515625, display_name='Turdus merula', category_name='/m/0197mw')
2023-05-27 09:18:48

But there is nothing in the Daily Summary / Most recent visitors pages.

Any thoughts? Could the score be too low? (It is the correct species for the clip in Frigate)
Any file permissions issues?
There are no errors in the log.

get_daily_summary sorting problem

This is a fun project I find myself tinkering on a little bit at a time throughout the day.

One thing I noticed is that the tables sorting by "Total" wasn't working right. I played around with some queries but the total column still seems not sorted by highest to lowest.

MQTT Connected | Unexpected disconnection, trying to reconnect

Frigate is running fine without any errors, but WhosAtMyFeeder gives me te following error messages in the logs:

MQTT Connected
Unexpected disconnection, trying to reconnect

My config is as follows:

frigate:
  frigate_url: http://u2.lan:5000
  mqtt_server: u1.lan
  mqtt_auth: false
  mqtt_username: mosquitto
  mqtt_password: *******************
  main_topic: frigate
  camera:
    - d2ep
    - fi9900p
  object: bird
classification:
  model: model.tflite
  threshold: 0.7
webui:
  port: 7766
  host: 0.0.0.0

How can I troubleshoot this?

Web server not loading

EDIT: Just noticed that 7767 is the default webui port on config.yml but 7766 is listed on docker-compose. Changed config.yml to 7766 and it's now good to go

I'm running Frigate on Home Assistant and have exposed port 5000 per the instructions. I have confirmed I can access Frigate via URL:5000. The container seems to run fine but I am not getting anything when I go to the URL (localhost or from LAN). Is there anything I can do to see whats going on here? Not sure where the problem is.

-Docker compose is a direct copy from Git
-Config has been changed w/ proper information for Frigate + MQQT added to the config
-Folder configuration looks good per the directions

docker ps
image
netstat -lnpt | grep 7766:
image

docker-compose.yml:
image
ls -R whosatmyfeeder/:
image
As far as I can tell things look fine if I exec into the container:
image

Feature request

I know we have a daily summary but is it possible to get a weekly or monthly summary as well so we can see overall bird traffic, types, etc?

Can not get the Web Interface to work

So I am trying to set this up in an Unraid environment. I built Frigate with your config as an example, and it is running with no issues and the video feed looks good. I then installed WhosAtMyFeeder and gave this this simple config:

frigate:
frigate_url: http://frigate:1984
mqtt_server: mqtt
mqtt_auth: false
mqtt_username:
mqtt_password:
main_topic: frigate
camera:
- birdcam
object: bird
classification:
model: model.tflite
threshold: 0.7
webui:
port: 7766
host: 192.168.100.69

When I try to go to the Web UI, I get: "Unable to connect. Firefox can’t establish a connection to the server at 192.168.100.69:7766." Looking at the docker logs, I am seeing these errors:
text error warn system array login

client.connect(config['frigate']['mqtt_server'])

File "/usr/local/lib/python3.8/site-packages/paho/mqtt/client.py", line 914, in connect
return self.reconnect()
File "/usr/local/lib/python3.8/site-packages/paho/mqtt/client.py", line 1044, in reconnect
sock = self._create_socket_connection()
File "/usr/local/lib/python3.8/site-packages/paho/mqtt/client.py", line 3685, in _create_socket_connection
return socket.create_connection(addr, timeout=self._connect_timeout, source_address=source)
File "/usr/local/lib/python3.8/socket.py", line 787, in create_connection
for res in getaddrinfo(host, port, 0, SOCK_STREAM):
File "/usr/local/lib/python3.8/socket.py", line 918, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -2] Name or service not known
INFO: Created TensorFlow Lite XNNPACK delegate for CPU.
Process Process-2:
Traceback (most recent call last):
File "/usr/local/lib/python3.8/multiprocessing/process.py", line 315, in _bootstrap
self.run()
File "/usr/local/lib/python3.8/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "./speciesid.py", line 239, in run_mqtt_client
client.connect(config['frigate']['mqtt_server'])
File "/usr/local/lib/python3.8/site-packages/paho/mqtt/client.py", line 914, in connect
return self.reconnect()
File "/usr/local/lib/python3.8/site-packages/paho/mqtt/client.py", line 1044, in reconnect
sock = self._create_socket_connection()
File "/usr/local/lib/python3.8/site-packages/paho/mqtt/client.py", line 3685, in _create_socket_connection
return socket.create_connection(addr, timeout=self._connect_timeout, source_address=source)
File "/usr/local/lib/python3.8/socket.py", line 787, in create_connection
for res in getaddrinfo(host, port, 0, SOCK_STREAM):
File "/usr/local/lib/python3.8/socket.py", line 918, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -2] Name or service not known
Cannot assign requested address
INFO: Created TensorFlow Lite XNNPACK delegate for CPU.
Cannot assign requested address
INFO: Created TensorFlow Lite XNNPACK delegate for CPU.
Cannot assign requested address
INFO: Created TensorFlow Lite XNNPACK delegate for CPU.
Cannot assign requested address
Calling Main
Time: 2023-09-19 10:57:26.696
Python version
3.8.17 (default, Jun 13 2023, 16:09:51)
[GCC 10.2.1 20210110]
Version info.
sys.version_info(major=3, minor=8, micro=17, releaselevel='final', serial=0)
Starting threads for Flask and MQTT
Starting flask app
Starting MQTT client. Connecting to: 192.168.100.69:1883

  • Serving Flask app 'webui'
  • Debug mode: off
    Calling Main
    Time: 2023-09-20 08:09:48.465
    Python version
    3.8.17 (default, Jun 13 2023, 16:09:51)
    [GCC 10.2.1 20210110]
    Version info.
    sys.version_info(major=3, minor=8, micro=17, releaselevel='final', serial=0)
    Starting threads for Flask and MQTT
    Starting flask app
  • Serving Flask app 'webui'
  • Debug mode: off
    Starting MQTT client. Connecting to: 192.168.100.69
    MQTT Connected
    Calling Main
    Time: 2023-09-20 09:44:41.823
    Python version
    3.8.17 (default, Jun 13 2023, 16:09:51)
    [GCC 10.2.1 20210110]
    Version info.
    sys.version_info(major=3, minor=8, micro=17, releaselevel='final', serial=0)
    Starting threads for Flask and MQTT
    Starting flask app
  • Serving Flask app 'webui'
  • Debug mode: off
    Starting MQTT client. Connecting to: 192.168.100.69
    MQTT Connected
    Calling Main
    Time: 2023-09-20 09:59:52.838
    Python version
    3.8.17 (default, Jun 13 2023, 16:09:51)
    [GCC 10.2.1 20210110]
    Version info.
    sys.version_info(major=3, minor=8, micro=17, releaselevel='final', serial=0)
    Starting threads for Flask and MQTT
    Starting flask app
  • Serving Flask app 'webui'
  • Debug mode: off
    Starting MQTT client. Connecting to: mqtt
    MQTT Connected

Any ideas what is wrong?

Cannot start latest docker image

I have tried upgrading to the latest image but it will not start:

> sudo docker-compose up
[+] Running 19/19
 ✔ whosatmyfeeder 18 layers [⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿]      0B/0B      Pulled   87.6s
   ✔ 93c2d578e421 Pull complete                                           20.8s
   ✔ c87e6f3487e1 Pull complete                                           21.1s
   ✔ 65b4d59f9aba Pull complete                                           22.7s
   ✔ d7edca23d42b Pull complete                                           51.8s
   ✔ 312bf3dc89d4 Pull complete                                           52.0s
   ✔ 52a627168d88 Pull complete                                           52.4s
   ✔ 0c4fbab13778 Pull complete                                           52.5s
   ✔ 733391fd0ab8 Pull complete                                           52.7s
   ✔ 9e0b0a86dba8 Pull complete                                           68.6s
   ✔ d600bff75849 Pull complete                                           68.7s
   ✔ 93f0644afa2f Pull complete                                           84.4s
   ✔ 95b38cb92f69 Pull complete                                           84.5s
   ✔ fd164cbbd9e5 Pull complete                                           84.6s
   ✔ 989e3ffa9d54 Pull complete                                           84.7s
   ✔ a3939911630b Pull complete                                           84.8s
   ✔ e61fd0d509bb Pull complete                                           84.9s
   ✔ 5c023cf4ccbc Pull complete                                           84.9s
   ✔ 6ea6a24bdf6d Pull complete                                           85.0s
[+] Running 2/1
 ✔ Container whosatmyfeeder                                                  Created3.0s
 ! whosatmyfeeder Published ports are discarded when using host network mode 0.0s
Attaching to whosatmyfeeder
Error response from daemon: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: unable to apply cgroup configuration: unable to start unit "docker-fbff0f2188014f0ed8b18f96e900fa684e204aa5b29f56821293a63f97d553d4.scope" (properties [{Name:Description Value:"libcontainer container fbff0f2188014f0ed8b18f96e900fa684e204aa5b29f56821293a63f97d553d4"} {Name:Slice Value:"system.slice"} {Name:Delegate Value:true} {Name:PIDs Value:@au [15176]} {Name:MemoryAccounting Value:true} {Name:CPUAccounting Value:true} {Name:IOAccounting Value:true} {Name:TasksAccounting Value:true} {Name:DefaultDependencies Value:false}]): Launch helper exited with unknown return code 1: unknown

Where can I source more meaningful logs?

> lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 22.04.2 LTS
Release:        22.04
Codename:       jammy

> docker --version
Docker version 20.10.24, build 297e128
> docker-compose --version
Docker Compose version v2.17.2

Exception while receiving image

Hi, i got everything working with mosquitto broker and frigate but when frigate saves a picture and sends it over mqtt i get this log in WhosAtMyFeeder addon log.

Using HAOS on Odroid-M1
m.2 coral TPU
addon Frigate
addon WhosAtMyFeeder

Python version
3.9.2 (default, Feb 28 2021, 17:03:44) 
[GCC 10.2.1 20210110]
Version info.
sys.version_info(major=3, minor=9, micro=2, releaselevel='final', serial=0)
INFO: Created TensorFlow Lite XNNPACK delegate for CPU.
Starting threads for Flask and MQTT
Starting flask app
Starting MQTT client. Connecting to: 10.0.0.199
MQTT Connected
 * Serving Flask app 'webui'
 * Debug mode: off
WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
 * Running on all addresses (0.0.0.0)
 * Running on http://127.0.0.1:7767
 * Running on http://172.30.33.6:7767
Press CTRL+C to quit
172.30.32.2 - - [30/Oct/2023 21:05:26] "GET / HTTP/1.1" 200 -
skipping first message
Getting image for event: 1698696391.020262-n1t2to
Here's the URL: http://10.0.0.199:5000/api/events/1698696391.020262-n1t2to/snapshot.jpg
Process Process-2:
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/dist-packages/urllib3/connection.py", line 200, in _new_conn
    sock = connection.create_connection(
  File "/usr/local/lib/python3.9/dist-packages/urllib3/util/connection.py", line 85, in create_connection
    raise err
  File "/usr/local/lib/python3.9/dist-packages/urllib3/util/connection.py", line 73, in create_connection
    sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/dist-packages/urllib3/connectionpool.py", line 790, in urlopen
    response = self._make_request(
  File "/usr/local/lib/python3.9/dist-packages/urllib3/connectionpool.py", line 496, in _make_request
    conn.request(
  File "/usr/local/lib/python3.9/dist-packages/urllib3/connection.py", line 388, in request
    self.endheaders()
  File "/usr/lib/python3.9/http/client.py", line 1250, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.9/http/client.py", line 1010, in _send_output
    self.send(msg)
  File "/usr/lib/python3.9/http/client.py", line 950, in send
    self.connect()
  File "/usr/local/lib/python3.9/dist-packages/urllib3/connection.py", line 236, in connect
    self.sock = self._new_conn()
  File "/usr/local/lib/python3.9/dist-packages/urllib3/connection.py", line 215, in _new_conn
    raise NewConnectionError(
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0xffff9fefbac0>: Failed to establish a new connection: [Errno 111] Connection refused

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/dist-packages/requests/adapters.py", line 486, in send
    resp = conn.urlopen(
  File "/usr/local/lib/python3.9/dist-packages/urllib3/connectionpool.py", line 844, in urlopen
    retries = retries.increment(
  File "/usr/local/lib/python3.9/dist-packages/urllib3/util/retry.py", line 515, in increment
    raise MaxRetryError(_pool, url, reason) from reason  # type: ignore[arg-type]
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='10.0.0.199', port=5000): Max retries exceeded with url: /api/events/1698696391.020262-n1t2to/snapshot.jpg?crop=1&quality=95 (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0xffff9fefbac0>: Failed to establish a new connection: [Errno 111] Connection refused'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.9/multiprocessing/process.py", line 315, in _bootstrap
    self.run()
  File "/usr/lib/python3.9/multiprocessing/process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/app/speciesid.py", line 282, in run_mqtt_client
    client.loop_forever()
  File "/usr/local/lib/python3.9/dist-packages/paho/mqtt/client.py", line 1756, in loop_forever
    rc = self._loop(timeout)
  File "/usr/local/lib/python3.9/dist-packages/paho/mqtt/client.py", line 1164, in _loop
    rc = self.loop_read()
  File "/usr/local/lib/python3.9/dist-packages/paho/mqtt/client.py", line 1556, in loop_read
    rc = self._packet_read()
  File "/usr/local/lib/python3.9/dist-packages/paho/mqtt/client.py", line 2439, in _packet_read
    rc = self._packet_handle()
  File "/usr/local/lib/python3.9/dist-packages/paho/mqtt/client.py", line 3033, in _packet_handle
    return self._handle_publish()
  File "/usr/local/lib/python3.9/dist-packages/paho/mqtt/client.py", line 3327, in _handle_publish
    self._handle_on_message(message)
  File "/usr/local/lib/python3.9/dist-packages/paho/mqtt/client.py", line 3570, in _handle_on_message
    on_message(self, self._userdata, message)
  File "/usr/app/speciesid.py", line 106, in on_message
    response = requests.get(snapshot_url, params=params)
  File "/usr/local/lib/python3.9/dist-packages/requests/api.py", line 73, in get
    return request("get", url, params=params, **kwargs)
  File "/usr/local/lib/python3.9/dist-packages/requests/api.py", line 59, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/local/lib/python3.9/dist-packages/requests/sessions.py", line 587, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/local/lib/python3.9/dist-packages/requests/sessions.py", line 701, in send
    r = adapter.send(request, **kwargs)
  File "/usr/local/lib/python3.9/dist-packages/requests/adapters.py", line 519, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='10.0.0.199', port=5000): Max retries exceeded with url: /api/events/1698696391.020262-n1t2to/snapshot.jpg?crop=1&quality=95 (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0xffff9fefbac0>: Failed to establish a new connection: [Errno 111] Connection refused'))
172.30.32.2 - - [30/Oct/2023 21:07:40] "GET / HTTP/1.1" 200 -

And i have this error in Home Assistant Core

This error originated from a custom integration.

Logger: custom_components.frigate.api
Source: custom_components/frigate/api.py:227
Integration: Frigate (documentation, issues)
First occurred: 8:29:07 PM (14 occurrences)
Last logged: 9:02:45 PM

Error fetching information from http://ccab4aaf-frigate:5000/api/stats: Cannot connect to host ccab4aaf-frigate:5000 ssl:default [Connect call failed ('172.30.33.3', 5000)]
Error fetching information from http://ccab4aaf-frigate:5000/api/stats: 502, message='Bad Gateway', url=URL('http://ccab4aaf-frigate:5000/api/stats')
Error fetching information from http://ccab4aaf-frigate:5000/api/stats: Server disconnected

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.