Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: gentlepumpkin/bi-aidetection
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: VorlonCD/bi-aidetection
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Can’t automatically merge. Don’t worry, you can still create the pull request.
Loading
Showing 344 changed files with 96,791 additions and 4,090 deletions.
4 changes: 4 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# These are supported funding model platforms

github: VorlonCD

10 changes: 9 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -258,4 +258,12 @@ paket-files/

# Python Tools for Visual Studio (PTVS)
__pycache__/
*.pyc
*.pyc
/src/UI/.vshistory
/src/UI/NamedPipeWrapper/.vshistory
/src/UI/OSVersionExt/.vshistory
/src/UI/Properties/.vshistory/AssemblyInfo.cs
/src/UI/SQLite/.vshistory
/src/AITool.Service/.vshistory
/src/.vshistory/bi-aidetection.sln
/src/AITool.Service/Properties/.vshistory/AssemblyInfo.cs
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
# AI Detection for Blue Iris
Alarm system for Blue Iris based on Artificial Intellience. Can send alerts to Telegram.

This is the VorlonCD fork of gentlepumpkins awesome AITool project.

Changes are listed in the commit history (hit ... for each to expand):
https://github.com/VorlonCD/bi-aidetection/commits/master

### Download
https://github.com/gentlepumpkin/bi-aidetection/releases
Click "> Assets" to find the .zip file.
https://github.com/VorlonCD/bi-aidetection/tree/master/src/UI/Installer

### Install guide and discussion
https://ipcamtalk.com/threads/tool-tutorial-free-ai-person-detection-for-blue-iris.37330/

* [MQTT Configuration Guide](mqtt.md)

### Key Features
- analyze Blue Iris motion alerts using Artificial Intelligence and sort out false alerts
- detect humans and selected objects
28 changes: 28 additions & 0 deletions mqtt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# MQTT with AI Tool & Blue Iris

Blue Iris [MQTT](https://mqtt.org/) ([ELI5](https://www.reddit.com/r/homeautomation/comments/515fh5/eli5_mqtt/))
support provides a way to [control the system](https://wiki.instar.com/Software/Windows/Blue_Iris_v5/INSTAR_MQTT/#controlling-blueiris-through-mqtt)
without relying on HTTP and URL based authentication.

## Requirements

A MQTT broker running on your local network, https://mosquitto.org/ is a commonly used OSS MQTT Broker.

## Setup

1. [Configure Blue Iris](https://wiki.instar.com/Software/Windows/Blue_Iris_v5/INSTAR_MQTT/#configuring-the-blueiris-mqtt-service)
to connect to your MQTT broker.
1. Configure AI Tool to connect to your MQTT Broker
* Cameras > [camera] > Action Settings > MQTT Settings
* ![MQTT Config](https://imgur.com/S4sDjzs.png)
1. Configure AI Tool to trigger the Camera via MQTT
* Cameras > [camera] > Action Settings
* MQTT Trigger Topic: `ai/[camera]/motion | BlueIris/admin`
* MQTT Trigger Payload: `[detections] | camera=[camera]&trigger&memo=[SummaryNonEscaped]`

NOTE: Use `[SummaryNonEscaped]` instead of `[Summary]` in the BlueIris payload to avoid getting escaped characters in
the Blue Iris UI.

Now when AI Tool triggers it will publish to two MQTT topics `ai/[camera]/motion` and `BlueIris/admin`. BlueIris
subscribes to the `BlueIris/admin` topic and will trigger the named camera with the specified memo. With this setup
you no longer need the URL based integrations with BlueIris.
4 changes: 4 additions & 0 deletions src/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[*.cs]

# CS4014: Because this call is not awaited, execution of the current method continues before the call is completed
dotnet_diagnostic.CS4014.severity = silent
79 changes: 79 additions & 0 deletions src/AITool.Service/AITool.Service.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{4FA49B76-97E6-4729-8F87-CFCEBACBAB9F}</ProjectGuid>
<OutputType>WinExe</OutputType>
<RootNamespace>AITool.Service</RootNamespace>
<AssemblyName>AITool.Service</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>logo.ico</ApplicationIcon>
</PropertyGroup>
<PropertyGroup>
<StartupObject>AITool.Service.Program</StartupObject>
</PropertyGroup>
<ItemGroup>
<Reference Include="AWSSDK.Core, Version=3.3.0.0, Culture=neutral, PublicKeyToken=885c28607f98e604, processorArchitecture=MSIL">
<HintPath>..\packages\AWSSDK.Core.3.7.10.3\lib\net45\AWSSDK.Core.dll</HintPath>
</Reference>
<Reference Include="AWSSDK.Rekognition, Version=3.3.0.0, Culture=neutral, PublicKeyToken=885c28607f98e604, processorArchitecture=MSIL">
<HintPath>..\packages\AWSSDK.Rekognition.3.7.7.33\lib\net45\AWSSDK.Rekognition.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.ServiceProcess" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="AIToolsService.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="AIToolsService.Designer.cs">
<DependentUpon>AIToolsService.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<Content Include="logo.ico" />
</ItemGroup>
<ItemGroup>
<Analyzer Include="..\packages\AWSSDK.Rekognition.3.7.7.33\analyzers\dotnet\cs\AWSSDK.Rekognition.CodeAnalysis.dll" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
37 changes: 37 additions & 0 deletions src/AITool.Service/AIToolsService.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

60 changes: 60 additions & 0 deletions src/AITool.Service/AIToolsService.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Linq;
using System.ServiceProcess;
using System.Text;
using System.Threading.Tasks;

namespace AITool.Service
{
public partial class AIToolsService : ServiceBase
{
public AIToolsService()
{
InitializeComponent();
}

public override EventLog EventLog => base.EventLog;

protected override void OnContinue()
{
base.OnContinue();
}

protected override void OnCustomCommand(int command)
{
base.OnCustomCommand(command);
}

protected override void OnPause()
{
base.OnPause();
}

protected override bool OnPowerEvent(PowerBroadcastStatus powerStatus)
{
return base.OnPowerEvent(powerStatus);
}

protected override void OnSessionChange(SessionChangeDescription changeDescription)
{
base.OnSessionChange(changeDescription);
}

protected override void OnShutdown()
{
base.OnShutdown();
}

protected override void OnStart(string[] args)
{
}

protected override void OnStop()
{
}
}
}
6 changes: 6 additions & 0 deletions src/AITool.Service/App.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
</configuration>
25 changes: 25 additions & 0 deletions src/AITool.Service/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceProcess;
using System.Text;
using System.Threading.Tasks;

namespace AITool.Service
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
static void Main()
{
ServiceBase[] ServicesToRun;
ServicesToRun = new ServiceBase[]
{
new AIToolsService()
};
ServiceBase.Run(ServicesToRun);
}
}
}
38 changes: 38 additions & 0 deletions src/AITool.Service/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("AITool.Service")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("AITool.Service")]
[assembly: AssemblyCopyright("Copyright © 2020")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("4fa49b76-97e6-4729-8f87-cfcebacbab9f")]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.441.8548")]
[assembly: AssemblyFileVersion("1.0.441.8548")]

[assembly: AssemblyInformationalVersion("0.0.8.8548")]
File renamed without changes.
5 changes: 5 additions & 0 deletions src/AITool.Service/packages.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="AWSSDK.Core" version="3.7.10.3" targetFramework="net472" />
<package id="AWSSDK.Rekognition" version="3.7.7.33" targetFramework="net472" />
</packages>
2 changes: 2 additions & 0 deletions src/AITool.Setup/BUILD.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
"%~dp0INNO\ISCC.exe" "%~dp0Script.iss"
::pause
Binary file added src/AITool.Setup/INNO/Compil32.exe
Binary file not shown.
Loading