Motion AI - Detection and classification of entities

I pushed a new release of #motionai using #homeassistant and #openhorizon services to provide #edgeai using your RaspberryPi, nVidia Jetson, or general-purpose AMD64 hardware. See http://github.com/dcmartin/motion-ai and let me know your thoughts (and my spelling and grammar mistakes).

There is a video now off the github.com repository README.md

No, it doesn’t work on an existing installation; it requires a fresh VM or device.

It is not designed to be added to an existing installation; it is designed to be as automated as possible for a fresh VM or device.

You can install the addon into an existing HA installation, but you will not be able to use the default configuration as it contains secrets defined externally (i.e. through HA).

You will also need to define appropriate sensors and cameras for the MQTT payloads sent.

You need to define the MQTT server using an IP address and not a locally defined DNS name.

The addon alone only captures motion detection events and transmits to MQTT; you will need to install the yolo4motion container configured to listen to the same MQTT broker and define sensors in your configuration.yaml (et. al) for the JSON payloads sent and cameras for the JPEG and GIF images sent.

Since most people already have an existing install it would really be helpful to have a walkthrough for that method

Please can we make a simple walthrough for people with existing HA installation.

Tx

Thanks for you share. It’s very cool.
I have a arm64 device board, and Intel Neural Compute Stick version 2. It installed ubuntu 18.04 .
I had compiled opencv4.3 and openvino openvino-2020.3.0 successfully on it.

can you support Motion AI arm64 borad devices and NCS2 ?

yolo may be can update to yolov4-tiny ?

Thanks !

links:


Not Yolov4 (yet). Still working on the implementations for OpenVino.

Arno, it isn’t designed to be added to an existing HA; perhaps I could do it via HACS, but I am not familiar enough w/ HACS to know. The primary impediment to “adding” this to an existing HA is including the YAML files, which includes template YAML for generating artefacts for each camera defined in the top-level webcams.json file.

If you want to try it quickly, just spin up an Ubuntu18 VM or grab a spare Rpi3/4 and uSD card w/ Raspian

See my response to Arno; willing to take guidance on HACS.

@robmarkcole I’m not as skilled as you both but maybe you could help each other out here

I’m loving this project and starting to integrate it with my existing solution. I currently have cameras going into Blue Iris, then using Deep Stack to identify when there are people or dogs or bears in the image.

Works well, but I want to up my game. Are you still developing this? Any new awesome adances?

@jaycrossler re ‘up my game’ what features specifically are you lacking currently?

I’ve been playing with (using LastWatchAI and BlueIris). I’ve prototyped many of these steps using curl and python, but nowhere near putting them together yet:

  1. taking any images that match a model (person), then taking the bounding box of those and chipping them out - and saving each series into a directory for that “event”. Event seems to work when there is a similar model match with at least 10% overlap of the polygon within the previously found polygon within the last 10 seconds

  2. show those series of events to the user (not sure best how, probably just a web page of each image in the directory in a flip grid), and let user add a name to that event (or delete images from that event. Give a pull-down of previous names, or ability to add a new name. Send a few to the recognizer to predict the person’s name, and show confidence to user

  3. when event is named, then send each of those images to the Deepstack face trainer and train it with that name. Also attach a home-assistant identity optionally

  4. have a way of adding “Zones” that overlap and correspond to areas on a camera feed. Things like “driveway” with a “near” and “far” subzone. Or “backyard”, etc.

  5. when looking at an event that is looking at a person model, also pass to the face recognizer and if a face certainty is surpassed, add an mqtt event of “Jay is walking towards the front door” or “Jay and two people and 1 dog entered the backyard”. Still not sure of the schema yet

Basically, I want to know when:

  • a bear is walking in the backyard toward the house
  • dogs in the backyard are sitting near the back door
  • kids and dogs playing in the backyard leave the yard
  • neighborhood kids are walking over to play
  • neighbor Dave is approaching the front door (get the drinks ready)
  • neighbors Karen and Janice are approaching the front door (deploy the water gun turret)

Thoughts?

@dcmartin, while following your YT installation instructions I ran into an issue. Having cloned your repo I don’t have the camera template file - how come? wbcams.json.tmpl is missing…

That video is old; read the instructions in the README

1 Like

Wow! Excellent job. I followed through your VDO on freshly installed rpi4 with 4G. Everything went smoothly, I can integrate a local camera physically attached to the same pi. The system has been running and detected motions, persons, etc. However, I had some questions.

  1. I tried to add my own integration and the UI allows me to go through building until successfully saved the automation but after it was saved, that automation isn’t listed and it seems to disappeared.
  2. I’d like to change the number of days to keep the VDO and pic record. On this trial, I keep all my HW at min requirements including the available mem space.
  3. I have esp 32 cam and would like to add to camera. I successfully streamed into motion but after a few minutes, that camera seems to be dead. I guess this camera board isn’t capable.
  4. All the entities and automations seem to be under motion platform.
    It is very useful but I still struggle to modify or add new automation.
    Again, Thank so much for exhaustive work.