CodeProject.AI Version 2.0

Is anyone having an issue where with a 4k Camera Codeproject.ai is not detecting and reading plates even when they are visible if zooming a little on the image.

However, If I crop the same 4k snapshot to just a smaller part of the same image, like just the vehicle and then use the c.ai explorer to test it, it does find the plate in the crop.

Frustrating that it doesn't find and OCR the plate in same whole image. Am I missing some Codeproject.AI setting?

Post the full field of screenshot of the image.
 
However, If I crop the same 4k snapshot to just a smaller part of the same image, like just the vehicle and then use the c.ai explorer to test it, it does find the plate in the crop.
Does CodeProject.AI explorer also fail on the full image? I ask to help determine whether the problem is CP.AI recognition, or perhaps BlueIris passing a lower-res version to CP.AI. If you're willing to share an attachment here (I assume an embedded image would get reduced) then others can better help. FYI, I use a 4MP (not 4K, but 4MP) camera and it does great.
 
Does CodeProject.AI explorer also fail on the full image? I ask to help determine whether the problem is CP.AI recognition, or perhaps BlueIris passing a lower-res version to CP.AI. If you're willing to share an attachment here (I assume an embedded image would get reduced) then others can better help. FYI, I use a 4MP (not 4K, but 4MP) camera and it does great.
Post the full field of screenshot of the image.
Which exact camera model?
Camera is IP8M-VB2696EW-AI
Here is an example of photo that with codeproject.ai explorer I get no license plate found but if I crop it to just the car, it finds the license plate and does OCR on it.
Crop of same photo: Dropbox

In codeproject.ai explorer the license plate reader only finds and reads the plate of the crop.
In codeproject.ai explorer yolov5 or yolov8 license-plate model the plate is only found in the crop.

So it does seem like a codeproject.ai problem of not finding the plate in a 4k image.
 
Last edited:
I see exactly the same thing with your images, using both CodeProject.AI v2.5.4 and 2.6.2, so this does appear to be an issue with CodeProject.AI and I don't think it has anything to do with BlueIris (with the disclaimer that my wife says I'm often wrong). Perhaps CodeProject.AI is reducing the resolution. I don't know, but at this point you should post the image on the CodeProject.AI forums so someone there can investigate.
 
Yeah that is a problematic field of view and the wrong camera. You need more OPTICAL zoom.

That is a 4K camera on a sensor designed for 2MP, so it will be really poor at night. And it maxes out at 13.5mm focal length, so you need to have vehicles realistically within 25 feet or so of the camera.

And then in a cul-de-sac, you have the wrong angle and location to get many plates.

Sure you will get some on ideal situations like this parked car, but a car moving thru at a decent speed like a perp...probably not...

Looks like the classic case of trying to do too much with one camera.

Keep in mind CodeProject downrezes the image before being processed, thus compounding your problem.



1718833094254.png

Sure you can get lucky with a lot of digital zoom, but it won't be consistent and will do poorly at night for any vehicle in motion.


1718833146670.png


For best performance, you would have to set the camera up specifically to read plates. You need the proper camera with OPTICAL zoom for the distance you are covering and the angle to get plates.

Regarding plates, keep in mind that this is a camera dedicated to plates and not an overview camera also. It is as much an art as it is a science. You will need two cameras. For LPR we need to OPTICALLY zoom in tight to make the plate as large as possible. For most of us, all you see is the not much more than a vehicle in the entire frame. Now maybe in the right location during the day it might be able to see some other things, but not at night.

At night, we have to run a very fast shutter speed (1/2,000) and in B/W with IR and the image will be black. All you will see are head/tail lights and the plate. Some people can get away with color if they have enough street lights, but most of us cannot. Here is a representative sample of plates I get at night of vehicles traveling about 45MPH at 175 feet from my 2MP 5241-Z12E camera (that is all that is needed for plates):

1675078711764.png



See the LPR subforum for more details.
 
@wittaj As I hope you know, I agree with everything you said about cameras, optical zoom, etc. etc. Having said that, do you know why CP.AI drops the resolution by default? I realize there's a significant performance issue, but shouldn't that be left up to the client application to decide? If someone wants to burn CPU/GPU, why not allow it? If the issue is customer support or reputation for CP.AI because too many people would complain that it's slow, then perhaps CP.AI can default to a downsized image while still allowing a 4k image through some configuration option. That in turn makes me wonder whether in fact CP.AI does allow it with some option that I just don't know about???

Is there some other factor in the decision to downsize images by default that I'm just not thinking about?
 
@wittaj As I hope you know, I agree with everything you said about cameras, optical zoom, etc. etc. Having said that, do you know why CP.AI drops the resolution by default? I realize there's a significant performance issue, but shouldn't that be left up to the client application to decide? If someone wants to burn CPU/GPU, why not allow it? If the issue is customer support or reputation for CP.AI because too many people would complain that it's slow, then perhaps CP.AI can default to a downsized image while still allowing a 4k image through some configuration option. That in turn makes me wonder whether in fact CP.AI does allow it with some option that I just don't know about???

Is there some other factor in the decision to downsize images by default that I'm just not thinking about?

It was stated by @MikeLud1 that the AI models are trained for an image no more than 640 x 640 resolution, so when the plate is as small as it is in the example above because the field of view and thus PPF is too low, CPAI will fail every time even if you can digital zoom some images and read the plate.
 
Got it. It all goes back to the training of the model. Thanks.
 
FWIW, older models like MobileNet are even lower resolution at 320x320px. I put some tiling functionality into the Coral CPAI module, but don’t expect it to see much use. Maybe if the Coral TPU was more capable, tiling would be more useful, since it would mean running 2x or 4x the number of inferences.
 
Hey guys,

It's been a while since I posted on here. I finally got around to switching to CodeProject AI from Deepstack today as I finally had time to sit in front of my computer and dedicate time to it. I ran into a little hiccup, but a reinstall of CodeProject resolved that. I'm using the custom models and YOLO5 6.2 and my GPU. It seems as if everything is working just fine, but I have a few questions.

When using the custom models, in the "Custom Models" field for each camera, am I putting in ipcam-XXX or IPcam-XXX or does it not matter? When testing, it doesn't seem to make a difference.

Also, I'm currently using three of the custom models for a few of my cameras. I'm using ipcam-general, ipcam-animal and ipcam-dark. I'm looking to catch people on these cameras so in the "To confirm" field I have person, as well as other 13 entries to look for. My question is, since the ipcam-general model also contains the dark models, I shouldn't have to add Person to the "To confirm" field for the ipcam-dark model correct? The ipcam-general model will Just look for both normal and dark images of people using person to confirm. Am I correct in saying that?

Also, I'm seeing times of 400ms-600ms with these cameras, this seems high. Is this because I'm running three models on these cameras?

Lastly, Would removing the ipcam-gerneral and ipcam-animal models and adding the ipcam-combined model be a better move here? I'd only be using two models rather than three, so I'm assuming faster times, but the ipcam-combined model is much larger so who knows. Was ipcam-combined trained with the same person and vehicle images as ipcam-general? I guess I can always test for myself, but just wondering if I'd get worse results using combined.

Thanks guys,
Appreciate you taking the time to read
Chris
 
When using the custom models, in the "Custom Models" field for each camera, am I putting in ipcam-XXX or IPcam-XXX or does it not matter? When testing, it doesn't seem to make a difference.
File names in Windows are case-insensitive, so if you're running CodeProject AI on Windows, it doesn't matter.

Also, I'm seeing times of 400ms-600ms with these cameras, this seems high. Is this because I'm running three models on these cameras?
Are you using a Coral TPU, a GPU, or the CPU?
 
Can anyone please confirm if CPAI can use the Intel igpu (UHD 630) to offload face detection ?

Mine is using only cpu :(

Thanks.
 
It was stated by @MikeLud1 that the AI models are trained for an image no more than 640 x 640 resolution, so when the plate is as small as it is in the example above because the field of view and thus PPF is too low, CPAI will fail every time even if you can digital zoom some images and read the plate.

Woah. I must have missed this all along?? I'm running the IPC-HFW5241E-Z12E-S2 primary stream at 1080p with a zoom of 0.906822 into CPAI for APLR using CPU with an i7-8700 and often get perfect reads, but sometimes it takes several seconds to process, but often fails to read the plate despite being near 100% sure the images contain a plate. Unfortunately I can't figure out how to get CPAI ALPR to run on the Tesla P4s I have in my server (running docker with my main CPAI instance, and have no way to upgrade those datacenter GPUs to something more modern because of no GPU power available in an aging enterprise chassis) so have to run it on the NVR box itself. My "workaround" for this issue of not always reading plates, I just record the main stream of all motion events so I can scrub through and manually read the vehicle plate if needed.

Given what you've said, if I set my cameras main stream to a lower resolution, then bumped the sub-stream up to 1080p and set BI to record all motion events on sub for archival/manual review, would that improve the accuracy and processing time of CPAI's ALPR?!

Day CPAI settings for BI:
1733382528950.png

Night CPAI settings for BI:
1733382478692.png

I set the night time pre-trigger images down to 5 because an approaching vehicles headlights triggers the motion, starting the 30-post frames to review and I was missing almost everything. Not perfect, but works OK sometimes..
 
  • Like
Reactions: DouglasteR