CodeProject.AI worked briefly now does nothing

General discussion about Blue Iris
chuckw
Posts: 4
Joined: Wed Oct 11, 2023 8:01 pm

CodeProject.AI worked briefly now does nothing

Post by chuckw »

A couple days ago, I made another attempt to get CodeProject.AI working so that I can stop getting alerts every time a leaf blows, or a cloud moves. I initially had success and it was flagging clips that had people and cars in it, and not flagging other stuff. That worked for one evening.

The next day, it stopped working. I've rebooted, updated Blue Iris, checked that http://localhost:32168/ shows CodeProject.AI is up and running (and also shows that no images were sent to it for analysis). Blue Iris still sends me alerts if there is motion, but they don't appear to pass through CodeProject.AI and they don't have a little person or car icon on them. I can see the clips if I pick "All Clips" but not if I just pick "Flagged"; that is empty. The status page's AI tab has nothing in it, but it also had nothing in it when it briefly worked.

What am I doing wrong? The Blue Iris Settings AI tab has the correct host/port, and I have checked the box next to Auto start/stop with Blue Iris, Use custom models, Default object detection (medium), ALPR for plates (no idea if that works). I actually had unselected "use custom models" but the setting keeps reappearing.

I have no idea if it matters, but the camera's settings page has "object detection" checked (I tried it with and without this checked, didn't help either way)... I'm not sure what that does since I thought CodeProject.AI also does object (well, person/car) detection. I currently have "Edge vector" picked for the method.

Any ideas? Thanks!
User avatar
TimG
Posts: 2098
Joined: Tue Jun 18, 2019 10:45 am
Location: Nottinghamshire, UK.

Re: CodeProject.AI worked briefly now does nothing

Post by TimG »

Have you looked in Alerts or even confirmed Alerts ? That's where I find them. I think you are taking too many steps at a time :lol:

1. Clips are the actual video files which won't show triggers or Alerts. Set it to Alerts.
2. AI tab won't show anything unless you are saving DAT files for that camera. Even then you have to either drop a DAT file on the window or select it from the Alert list.
3. Flagged only works if you chose to flag a file. I've never used it.
4. I use the Simple detection, as I want everything to be looked at by AI rather than discounted by the detector.

Small steps 8-)
Forum Moderator.
Problem ? Ask and we will try to assist, but please check the Help file.
chuckw
Posts: 4
Joined: Wed Oct 11, 2023 8:01 pm

Re: CodeProject.AI worked briefly now does nothing

Post by chuckw »

Yes, my Alerts tab shows the same thing that "All clips" shows since the only thing I have is alerts.

I'm not entirely sure what you mean by point #2? How do I save a DAT file for a camera?

Where would I choose to flag a file? I thought flagging was something CodeProject.AI does when it sees a match. When CodeProject.AI was briefly working, what it was flagging was ending up in this Flagged tab, along with some cute little icons on it depending on whether it saw a person or a car. And, I could also see in the CodeProject.AI log that tons of traffic was going to it that it was looking at. Now, there's no more traffic in its logs... the module named "Object Detection (YOLOv5 6.2) " shows nothing going on. I'm not sure how to get back to what it was doing before.

I was wondering about the detection method and what's best to choose. It had been set (not by me... always been there, didn't realize it) to "Gaussian (deprecated)" and returned ridiculous amounts of hits, which might be fine for an indoor camera, but not an outdoor camera where every sun ray, leaf, or even fog or pellet stove smoke set it off. Then I was like hmmm what's this "deprecated" thing next to it, that doesn't sound good, lemme try Simple. I still got tons of hits. Then, I tried this Edge vector thing... now, amazingly, it actually is a whole lot better. At least the last day or so I've had it set to that. I see alerts when we walk in front of it, or drive in and out of the driveway. And, I don't usually see false alerts except a couple of exceptions... late at night, when cars drive by, their headlights light up a good portion of the upper part of the video. I use a mask to exclude the street, but the car lights go beyond the street into the yard. And, they sometimes alert. I was hoping the AI would fix that by recognizing that headlights going by is not a person (and not actually a car either... the car is masked and only its lights in my lawn or trees is visible).

And I'd also like to actually see animals of significant size go by... cats, skunks, turkeys, deer, Chupacabra... all stuff I want to see. Chipmunks, nope. I'm not sure how to reliably get that working, or if AI knows how to detect these animals. When I was using another detection method, I'd get everything including the critters but the volume is too much to search through.

Thanks!
User avatar
Pogo
Posts: 396
Joined: Tue Jul 18, 2023 7:21 pm
Location: Reportedly in the Area

Re: CodeProject.AI worked briefly now does nothing

Post by Pogo »

CPAI is simply an additional tool for Blue Iris. It is not a quick fix substitute for learning and understanding the fundamentals required for an effective Blue Iris setup and will create more problems than it solves if viewed in such a manner.

Understanding the BI basics is the key to understanding AI integration in whatever form you choose to implement it, including the IVS functionality of cameras themselves if so equipped..., if you choose to use AI all.

There are some very fundamental considerations included in the link below that may or may not be helpful in just putting context to the bigger BI picture as your learning curve flattens a bit and the comfort level in finding your way around increases accordingly. Not comprehensive by any means. Bare minimum basic examples that are easy to try and generally work as described. They should provide some perspective on how the AI component can also fit into the tool box.

viewtopic.php?t=3262
chuckw
Posts: 4
Joined: Wed Oct 11, 2023 8:01 pm

Re: CodeProject.AI worked briefly now does nothing

Post by chuckw »

I've actually been using Blue Iris for around 8 years or so, but most of the time alerts for motion haven't been set up all that well. Surprisingly at the moment, even without AI, it is doing pretty well... the only substantial change I'm aware of is to switch to that edge vector thing. But, I still get the occasional car headlights at night alert, would be nice to get rid of alerts for something like this (that glowing circle is the IR from the camera, car out by road is what sets it off despite it being masked):
caratnightb.jpg
caratnightb.jpg (194.75 KiB) Viewed 145415 times
User avatar
Pogo
Posts: 396
Joined: Tue Jul 18, 2023 7:21 pm
Location: Reportedly in the Area

Re: CodeProject.AI worked briefly now does nothing

Post by Pogo »

I don't think CPAI would be able to do much with that image, though I may be wrong about that.

My driveway scene is very similar. Headlights were a PITA until I realized the reflections off of the trees and driveway itself were equally effective at triggering the camera when I first set it up. Masked those areas. Fixed.

Now one line of pixels across the driveway entrance does the trick for anything entering (or leaving) using a clone of the master camera. Poor man's trip wire.

The master handles anything within the general zone. I get a MMs alert from the clone entrance trigger and use the master for the general zone recording, which also includes the entrance trigger activity, of course.

As mentioned in the referenced link, I came up short trying to accomplish both tasks with one camera and two independent triggers -- which still seems like it should be a very simple configuration, but it seems like multiple actions from a single camera still rely on the functionality of a single trigger being manipulated for multiple actions. A second trigger would certainly provide a whole new level of flexibility (and simplicity) in setting up more complicated scenes and zones. Probably not so much for the developer or I imagine it would already be a prominent feature.

Oh, well. Clones work.
chuckw
Posts: 4
Joined: Wed Oct 11, 2023 8:01 pm

Re: CodeProject.AI worked briefly now does nothing

Post by chuckw »

Interesting idea, hadn't realized you could clone a camera and make one trigger on a thin line at the driveway. It sounds like it'd take me a while to set up, maybe I'll try that sometime if I keep getting too many false alerts. I just made my mask slightly smaller to exclude more trees that the headlights may shine on... lets see if that helps.
User avatar
TimG
Posts: 2098
Joined: Tue Jun 18, 2019 10:45 am
Location: Nottinghamshire, UK.

Re: CodeProject.AI worked briefly now does nothing

Post by TimG »

I'm not entirely sure what you mean by point #2? How do I save a DAT file for a camera?
DAT files are enabled per camera in the Alerts/Artificial Intelligence menu by checking the "Save AI analysis details" box. When you have next had a "Confirmed Alert" with that camera, you hold down the Ctrl button and double click the Alert image. That should open up the DAT file in the Status/AI window you saw earlier.

When you have finished using the DAT files, uncheck the save analysis box.
Forum Moderator.
Problem ? Ask and we will try to assist, but please check the Help file.
User avatar
Pogo
Posts: 396
Joined: Tue Jul 18, 2023 7:21 pm
Location: Reportedly in the Area

Re: CodeProject.AI worked briefly now does nothing

Post by Pogo »

chuckw wrote: Fri Oct 13, 2023 7:56 pm Interesting idea, hadn't realized you could clone a camera and make one trigger on a thin line at the driveway. It sounds like it'd take me a while to set up, maybe I'll try that sometime if I keep getting too many false alerts. I just made my mask slightly smaller to exclude more trees that the headlights may shine on... lets see if that helps.
I'll try to post my zone examples for you a bit later. Tuning your main zone live certainly makes it a little easier to achieve the desired results.

And a clone is quick and easy to set up with only a few steps and considerations involved. It uses the same stream as the 'master' and very little additional CPU.
User avatar
Pogo
Posts: 396
Joined: Tue Jul 18, 2023 7:21 pm
Location: Reportedly in the Area

Re: CodeProject.AI worked briefly now does nothing

Post by Pogo »

Following is a very simple but effective approach to setting up a couple of driveway triggers for different purposes using a master/clone camera method for the same scene/frame. No AI necessary for what has proven to be a very reliable and efficient setup.

First is the general idea of the frame/camera view with the road at the top to show that it presents the typical headlights and reflections challenge during night time hours along with passing traffic needing consideration during daylight. Typical stuff.

This example is from the sub-stream of a cloned 1080p camera at a fairly low resolution to show the effect of low-res pixel size on trigger considerations. It can be pretty dramatic. Many folks don't actually realize that triggers are primarily based on the sub-stream and the sub-stream resolution and don't understand why their motion and zone settings don't produce the expected results. They just know sub-streams generally look like crap but can dramatically reduce CPU load. They gladly accept the trade-off and that's it while not taking into consideration the impact on triggering sensitivity and associated responses.
Zones B.jpg
Zones B.jpg (108.49 KiB) Viewed 145379 times
The same frame example at night for better contrast/definition with the sub-stream de-activated and using the 1080 mainstream instead. Quite a difference in the degree of tuning sensitivity and detail obtainable with all the extra pixels. Each situation is different, of course, but the lower you choose to run your sub-stream resolutions, the less finesse you'll likely have available in your triggering setups if and when a little finesse may come in handy. On the other hand, more and smaller pixels also pick up smaller items and more subtle motion and may not be desired for certain types of environments. Point is, the sub-stream resolution can be an additional (and valuable) tool for customizing and tuning triggers when folks realize it does more than just save space and reduce CPU load.

Your basic Poor Man's trip wire right here. Works like a charm with very, very few false alerts. Sends a MMS text to my phone when triggered which I receive within seconds whether on my home wi-fi or Verizon 4G. I was very impressed when I finally got the connectivity all sorted out. Still am.
EntranceTrip.jpg
EntranceTrip.jpg (172.36 KiB) Viewed 145379 times
Here's a Poor Man's perimeter setup example. It's not an active configuration on the camera, but again gives an idea of how the mainstream resolution can provide much cleaner definition to lines and areas, not to mention the sensitivity aspect. Nothing complicated. Easy stuff. Very few false alerts from the normal nuisance sources. Can be set for bi-directional triggering easily by simply setting duration and re-triggering params.
Perimeter Intrusion.jpg
Perimeter Intrusion.jpg (170.71 KiB) Viewed 145379 times
Post Reply