akmolina28 / last-watch-ai Goto Github PK
View Code? Open in Web Editor NEWSelf-hosted computer vision automation application
License: MIT License
Self-hosted computer vision automation application
License: MIT License
Hello, I'm following the procedure step by step and looks like there is an issue happening when building the containers.
Successfully built b07eac5f96d9 Successfully tagged last-watch-ai_artisan:latest WARNING: Image for service artisan was built because it did not already exist. To rebuild this image you must use
docker-compose buildor
docker-compose up --build`.
Creating last-watch-ai_artisan_run ... done
Route cache cleared!
Routes cached successfully!
Creating last-watch-ai_artisan_run ... done
In KeyGenerateCommand.php line 96:
file_put_contents(/var/www/app/.env): failed to open stream: Operation not permitted
ERROR: 1
`
If I try to run the stack after that error, I face an error 500 message with no helpful debug. I'll try to dig a bit more on this.
When unzipping in linux I get following warning warning: last-watch-ai-latest.zip appears to use backslashes as path separators
. Apparently this has to do with the zip program being used (https://superuser.com/a/1382853/702386)
After running the setup and browsing to the url on port 8080 the server returns error 500. The body is empty and the nginx and php container logs only log the return without error message.
What could this issue be and where can I find a more detailed log for to debug this problem?
It would be great to ignore SSL issues within automation webhooks. This is mainly to support local servers that might not have valid SSL certs.
Currently the only way to edit the automations is through the sql database. It would probably be nice if we could edit those using the ui.
Hi Andrew, I'm continuing my quest on running this on my Mac... The good news is that I see it consuming images and counting them on the UI as images processed... The bad news is that looks like the app is not sending requests to deepstack because I don't see any processing results on "deepstack logs" and nothing shows on "error logs" either :(
Any luck/suggestion on how to debug this?
Events and files come in with a huge delay. The detection itself is great, but because of the delay the events are useless. I've looked at the file watcher log and I can see the files being detected there after a second.
The time used in the event is also off by this delay so it would say 25 minutes ago
for a file from almost a day ago.
I'm not sure what the next step is for looking where the delay comes from. If there are any more details that could help let me know.
I'm probably doing something wrong but whenever I upgrade to a new version I lose all the data and configuration in the app. These are the steps I use to upgrade on linux/debian:
# stop the current app
cd last-watch-ai
sudo docker-compose down
cd ..
# move old install
mv last-watch-ai last-watch-ai-old
# download new version
curl -s https://api.github.com/repos/akmolina28/last-watch-ai/releases/latest \
| grep "browser_download_url" \
| cut -d : -f 2,3 \
| tr -d \" \
| wget -qi - -O - > last-watch-ai-latest.zip
unzip -q last-watch-ai-latest.zip -d .
# copy previous config file
cp last-watch-ai-old/.env last-watch-ai/.env
# copy sql data
sudo cp -R last-watch-ai-old/mysql last-watch-ai/mysql
cd last-watch-ai
sudo chown -R www-data:www-data src
sudo find src -type f -exec chmod 644 {} \;
sudo find src -type d -exec chmod 755 {} \;
# run migration
sudo docker-compose run --rm artisan migrate
#start the program
sudo docker-compose up -d --build site
sudo docker exec -it lw_php rm /var/www/app/public/storage
sudo docker exec -it lw_php php artisan storage:link
# remove old files
sudo rm -rf ../last-watch-ai-old
Or as a gist
What does the Smart filter
do and how does the Mask File
work?
My image files are nested under specific sub folders (ex. frontGate/2021-04-06/17-17-31.jpg) but only have the time in the name (ex. 17-17-31.jpg).
I can see the full path in the log of the file watcher but on the interface I only get the file name. This makes it impossible to match a camera specific profile. In an older folder the full path was used so I'm not sure if this is no an option or this behavior changed? Or maybe I'm just doing something wrong ;)
In UI defined here:
there are missing several supported substitutions defined in:I tried %image_url%, even if it was not specified in the UI, and it worked as expected.
Hi, I was trying to get it up and running on a Jetson Nano 4GB model where I got deepstack going. Following the Ubuntu instructions I get this error:
Creating network "lastwatchai_default" with the default driver
Creating network "lastwatchai_laravel" with the default driver
Pulling mysql (mysql:5.7.29)...
5.7.29: Pulling from library/mysql
ERROR: no matching manifest for linux/arm64/v8 in the manifest list entries
I think that the docker-compose.yml file is for X64 platform.
To much for me to get to the solution.
It maybe easier getting it running on my BlueIris machine on Docker, but it's a little bit underpowerd.
Somebody?
Add travis CI and style CI
When editing the detection profiles I always get the following error:
The given data was invalid. The name field is required.
The changes do get saved so I suspect the error is thrown incorrectly.
Following is the request body:
-----------------------------339948305736921379503347736070
Content-Disposition: form-data; name="id"
2
-----------------------------339948305736921379503347736070
Content-Disposition: form-data; name="name"
All
-----------------------------339948305736921379503347736070
Content-Disposition: form-data; name="file_pattern"
*
-----------------------------339948305736921379503347736070
Content-Disposition: form-data; name="min_confidence"
0.45
-----------------------------339948305736921379503347736070
Content-Disposition: form-data; name="use_regex"
false
-----------------------------339948305736921379503347736070
Content-Disposition: form-data; name="use_smart_filter"
false
-----------------------------339948305736921379503347736070
Content-Disposition: form-data; name="smart_filter_precision"
0.01
-----------------------------339948305736921379503347736070
Content-Disposition: form-data; name="mask"
null
-----------------------------339948305736921379503347736070
Content-Disposition: form-data; name="object_classes"
["person","bicycle","car","motorcycle","airplane","bus","train","truck","boat","bird","cat","dog","horse","sheep","cow","bear"]
-----------------------------339948305736921379503347736070
Content-Disposition: form-data; name="is_negative"
false
-----------------------------339948305736921379503347736070--
and response body:
{
"message": "The given data was invalid.",
"errors": {
"name": [
"The name field is required."
],
"file_pattern": [
"The file pattern field is required."
],
"min_confidence": [
"The min confidence field is required."
],
"object_classes": [
"The object classes field is required."
]
}
}
Hi,
I am running Last Watch on Windows 10, Docker Desktop, 3.1.0. I have the following as a config file for WSL 2:
[wsl2]
memory=3GB # Limits VM memory in WSL 2 to 4 GB
processors=5 # Makes the WSL 2 VM use two virtual processors
I noticed that it was consuming a lot of resources, specifically lw_watcher, at around 25% CPU. It is also spawning a lot of effort through the COM Surrogate process, making total CPU up to 80%. Is this expected?
On research, it appears there may be an issue with regard to the access of files within Windows outside of the Container. This is known to cause problems although I am unsure how to resolve it.
Great product btw! Many thanks for your efforts!
Thank you so much for this app! I embed this on my home assistant dashboard in an iframe. I use dark mode in HA. It would be great if there was an option to show lastwatch-ai webpage in dark mode too.
I am spoiled with all the new features and improvements. It feels like I should not even be asking for more. Thank you again!
Anyway to send builds to dockerhub (or GHCR) for ease of deployment?
I'm trying to use the latest changes you added (yay mqtt!) but running into some problems with the docker build. I think there's a missing ../vendor/ directory, likely because composer wasn't run in the docker install. I'm not sure what should be in that to finish testing.
I'm currently experimenting in using Shinobi as my NVR software.
However shinobi unlike BI or Zoneminder doesn't have an option to save jpegs of events in a folder (unless doing this with a user script)
However it can call webhooks and has a snapshot URL for each camera.
So my thinking was an alternate workflow could be to alert last-watch-ai via a webhook and have last-watch-ai then read the image from a snapshot url.
I know motioneye also supports webhooks, so that would be another software this solution could work with.
It'd be great if one of the automations is an mqtt post (though I think we can now replicate this as a HTTP post into Node-RED - need to verify).
Even more awesome if there were some variables added to those currently parsed, I'm thinking time matched would be good for debugging and that matching x/y coordinates might help know where something was seen in the image.
Maybe if they use this automation, auto-enter a default json that specifies the usable parameters, but that user can override:
{
"profile name" : %profile_name%,
"image file pattern" : file_pattern,
"image file name" : %image_file_name%
"relevant pattern" : %object_classes%,
"confidence" : ai_confidence,
"top_left_x": top_left.x,
"top_left_y": top_left.y,
"bot_right_x": bot_right.x,
"bot_right_y": bot_right.y
}
It looks like from:
We could just add %file_pattern%, and %ai_confidence% and the x/y coordinates to get this. Thoughts?
Can't seem to figure out why I don't get the image displayed on the web interface. It is just blank. Everything else seems to work fine. Also it generates a bunch of console errors in Chrome. That all look like this....
app.js?id=1d007da1358979320604:2 Uncaught DOMException: Failed to execute 'drawImage' on 'CanvasRenderingContext2D': The HTMLImageElement provided is in the 'broken' state.
at h.Image._draw (http://192.168.1.176:8080/js/app.js?id=1d007da1358979320604:2:2347029)
at h.renderWithContext (http://192.168.1.176:8080/js/app.js?id=1d007da1358979320604:2:2337108)
at h.Image.h.Entity.draw (http://192.168.1.176:8080/js/app.js?id=1d007da1358979320604:2:2341057)
at h.addToStage (http://192.168.1.176:8080/js/app.js?id=1d007da1358979320604:2:2336043)
at h._callback (http://192.168.1.176:8080/js/app.js?id=1d007da1358979320604:2:2099528)
at h._animate (http://192.168.1.176:8080/js/app.js?id=1d007da1358979320604:2:2338182)
Thanks!
When running the containers and going to the site I'm getting the following error:
Warning: require(/var/www/app/public/../vendor/autoload.php): failed to open stream: No such file or directory in /var/www/app/public/index.php on line 24
Fatal error: require(): Failed opening required '/var/www/app/public/../vendor/autoload.php' (include_path='.:/usr/local/lib/php') in /var/www/app/public/index.php on line 24
After inspecting the container I could not find the file within the container. I'm running the containers on debian.
I've created a detection profile that uses a camera in my garage to detect if the car is there or not. I've created one profile checking if "car" is detected with more than 60% accuracy (due to the extreme angle, it doesn't look like a car as much in the image, plus there's a cargo rack on top). I'd also like to detect it not being there so I created a negative car profile. Should I invert the confidence? When I look at the detection events when the garage is empty, there is no prediction relating to car, so no relevant profile. Any ideas, or what else can I provide for details?
When trying to add a web request automation I receive an error and so I can't add those automation. I've also tested the telegram automation and that one works.
request
{
"name": "HA motion detected",
"url": "https://hass.test.net/api/states/sensor.cctv_motion_detection",
"is_post": true,
"body_json": "{\n \"state\": \"lwa\"\n}",
"headers_json": "{\n \"Authorization\": \"Bearer secret\",\n \"Content-Type\": \"application/json\"\n}"
}
Response
{
"message": "Server Error"
}
Hello!
Thank you for creating this awesome project. I'm getting errors when I'm trying to pass additional values to HA API based on the documentation from HA.
Below is the body:
{
"state": "on",
"unique_id": "garage_ext_activity",
"name": "Activity outside Garage",
"attributes": {
"object_classes": %object_classes%,
"event_url": %event_url%,
"image_download_link": %image_download_link%
}
}
However, I keep getting the following errors:
Automation Type | Event | Error | Occurred At |
---|---|---|---|
web_request | 192.168.200.3_01_20220201102441030_MOTION_DETECTION.jpg | Argument 3 passed to App\WebRequestConfig::postRequest() must be of the type array, null given, called in /var/www/app/app/WebRequestConfig.php on line 75 | 2 hours ago |
What am I missing here?
I think it would be great to be able to view the images as a thumbnails as you look at the events list maybe as a column to the left of "Image File". Thank you.
#20 introduced a bug that prevents subscribing to automations
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.