While developing my BI_gif_tool.ps1 utility (for sending GIF alerts via Pushover), I learned how to extract the JPG images embedded in Blue Iris Artificial Intelligence DAT files. This project resulted in 3 ideas:
This post introduces a Powershell script that does the following things with Blue Iris generated AI-analysis 'DAT' Files:
Saved JPG and JSON files are stored in a user-selected folder (specified in the user-settings file)
This screenshot shows the available set of commandline parameters. (EDIT: updated for v 1.2)
I will provide easier-to-consume scenario-based command examples in the next post.
The remainder of this post is the installation guide...
STEP #1:
Install the script and its companion 'user settings file'
Open PowerShell in Administrator mode, and type the following, then hit the Enter key:
(click here for a nice beginner's tutorial to using PowerShell).
STEP #2:
Edit the user settings file
Script Zip File
EDIT (2024-03-22): Script updated to V2
PLEASE NOTE: if you are updating to v2, you must replace the old user-settings file with the new one to support new features.
(This means you will need to edit the user-settings file again. Tip: before updating, rename the old file.)
- A utility that could remove selected DAT files that are no longer useful from Blue Iris storage (Alerts folder).
- A utility that could be used to inspect DAT files for information like image counts, AI labels found, etc.
- A utility that could be used to 'mine' DAT files for JPG images that could be useful in training AI models.
Using images extracted from DAT files is an efficient way to generate a lot of candidate AI model images for your specific fields of view and conditions (day/night, sunny/cloudy, etc.)
This post introduces a Powershell script that does the following things with Blue Iris generated AI-analysis 'DAT' Files:
- Inspect DAT files showing image counts, ages, alert memos, AL models used, and AI labels found (by image)
The results are displayed in the console, and also saved to a CSV file. - Filter / down select DAT files based on DAT filename(s), naming pattern(s), image count, age, and/or alert memo(s)
- Perform the following actions on a any set of filtered DAT files:
- Remove the files from Blue Iris storage to the recycle bin (by default), or permanently delete them
- Extract all JPG images
- Extract all JSON strings
- Down select which JPG images are extracted based on AI analysis RESULTS:
- the AI models used, and/or
- the AI labels found
- OR - - if 'Nothing found' is the AI analysis result for any (or all) models used, or
- if 'Something found' is the AI analysis result for any (or all) models used.
Saved JPG and JSON files are stored in a user-selected folder (specified in the user-settings file)
This screenshot shows the available set of commandline parameters. (EDIT: updated for v 1.2)
I will provide easier-to-consume scenario-based command examples in the next post.
The remainder of this post is the installation guide...
STEP #1:
Install the script and its companion 'user settings file'
- Extract all the files from the attached zip file to your desktop, or scripts folder.
- Please note that the folder used must be in your PC's environment path.
- Create a root folder for this script - it will be used to process the GIF files; to archive GIF and DAT files, etc.
- To use the folder, you must edit a user setting in the appropriate Powershell script file (see Step #3)
Open PowerShell in Administrator mode, and type the following, then hit the Enter key:
Set-ExecutionPolicy RemoteSigned
(click here for a nice beginner's tutorial to using PowerShell).
STEP #2:
Edit the user settings file
- Open the file in a code text editor (I use Notepad++)
- Edit the REQUIRED variables in the USER SETTINGS section.
- Ignore the remaining settings for now. They provide customizations that you may want to explore later.
Script Zip File
EDIT (2024-03-22): Script updated to V2
PLEASE NOTE: if you are updating to v2, you must replace the old user-settings file with the new one to support new features.
(This means you will need to edit the user-settings file again. Tip: before updating, rename the old file.)
Attachments
Last edited: