Giter VIP home page Giter VIP logo

last-watch-ai's People

Contributors

akmolina28 avatar depuits avatar namoshek 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

last-watch-ai's Issues

Build failing?

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 usedocker-compose buildordocker-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.

Interface returning error code 500

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?

Ignore SSL exceptions in automation

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.

Interface to edit automations

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.

No processing?

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 come in with 12 hour delay

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.

Upgrading loses settings and data

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

Profile matching no longer using full path but filename only

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 ;)

ARM64 Jetson Nano

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?

Error when editing detection profile

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."
    ]
  }
}

Intensive CPU

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?

image

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!

Feature suggestion: Dark mode

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!

Dev branch add vendor/autoload and compose to dockerfile

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.

Alert via webhook and read snapshot-URL?

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.

Mqtt Posting?

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:

$replaced = str_replace('%image_file_name%', $event->image_file_name, $replaced);

We could just add %file_pattern%, and %ai_confidence% and the x/y coordinates to get this. Thoughts?

No image display on web interface.

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!

image

vendor/autoload.php not found

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.

Question: Negative doesn't seem to work as expected

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?

Adding web request automation returns error

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"
}

Passing additional variables via HA API body

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?

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.