To setup AI Servers click on the icon at the top left of the main Agent DVR UI and then click on Settings under Configuration and select AI Servers in the drop down menu and click Configure.
Auto Lock Tags on this screen will automatically lock (prevent storage management or accidental deletion) recordings with specified tags. To delete these recordings you will need to Unlock them (in the UI).
Agent DVR integrates with CodeProject.AI to provide various AI features including object recognition, face recognition, ALPR and super resolution (enhance). We also support PlateRecognizer.com as an ALPR provider. CodeProject.AI is open source and free and runs on pretty much every platform.
To get started, install an AI server for your platform and connect Agent DVR to it by clicking the Configure button and then Add.
You can add as many AI servers to Agent as you like. Cameras in Agent can be configured to use different AI servers for each function or you can just use one AI server for everything.
Configuring your Server
- Name: Give your server a name, eg: Cat Catcher
- AI Server URL: Enter the URL of your AI server. For example: http://localhost:5000
- API Key: Enter your key if you have set one up (optional)
- Timeout: Timeout in seconds for the requests to the server.
- Retry delay: Time in seconds before retrying requests to this server if they fail.
Configure LPR (ANPR or License Plate Recognition) in Agent DVR by going to Server Settings - AI Settings and enter the settings under Plate Recognizer. Sign up for a Free Trial on Plate Recognizer. No credit card required.
- URL: This is the URL to the service. The default is "https://api.platerecognizer.com/v1/plate-reader/" but you can enter your own server if you have your own instance of it running.
- Token: After creating a Plate Recognizer account, go to the Plate Recognizer Account Page and copy the API Token value.
- Regions: Leave this blank for default or enter a CSV list of regions
- Config: You can enter an extra config value here from the docs
In the AI server list (see above) you can access features to configure, test, edit and remove AI servers. Click on the configure button to list the modules that are available or installed on the selected server.
Agent DVR gets the current module list from your server and provides a UI to install, uninstall, configure and test each module. We've added support for all default CodeProject.UI modules although Agent DVR only uses a subset of them.
To use ALPR, Super Resolution or Face Recognition in Agent DVR you will need to click to install the relevant module from this page. Typically you won't need to worry about changing any settings on the modules but if you want to just click on the icon under each module.
CodeProject.AI comes with several in-built object detection models. To add your own models into CodeProject.AI just copy the model file (usually ends in .pt) to (on Windows) C:\Program Files\CodeProject\AI\AnalysisLayer\ObjectDetectionYolo\custom-models.
When it's there you should be able to access it by editing a camera, click on the Object Recognition tab under AI in the menu and then click on Get Models. If you have added your own model file you will need to manually add the object list to Object Classes as currently there is no way to read the available classes from the model file.
If your models are stored in a different folder you can change where CodeProject.AI is looking for them by editing the installed Object Recognition module settings.
To alert on an AI detection event (from object recognition, LPR or Face recognition) you need to edit a camera and set the Mode on the Alerts tab to AI Detection. Then edit the AI configuration you want to use in the edit camera menu and click on the Alert Conditions button.
- Alert Pass-through: If your AI module stops working then this option will assume that motion events are alerts.
- Alert Zones: Agent compares the location of detected objects to zones you draw on the motion detector. Choose the zones you want to generate alerts for here. For example you could have zone 1 being the footpath and zone 2 being your driveway and you only want alerts about objects in your driveway.
- Prevent Repeat: Checking this will ignore repeat alerts until the object leaves and re-enters the zone
- Alert Condition: Select a condition. The default is "More Than". You can use Equals, More Than or Less Than
- Alert Number: Set a number. For example More than 0 will alert as soon as it finds something.
You then need to setup a trigger to trigger the AI to process frames from your camera. To do that choose a Mode on the AI configuration screen. Choose from Motion Detected, Alert, Interval or None. If you choose Motion Detected you will need to setup and enable the Motion Detector for the camera to generate motion events. Alternatively you can choose Interval and have Agent just send a frame off to the AI server every few seconds (This can use a lot of CPU though).