More work on the GUI

This commit is contained in:
Tadas Baltrusaitis 2016-05-20 17:38:03 -04:00
parent e6e547b0a1
commit b262b479ae
26 changed files with 34 additions and 2399 deletions

View file

@ -125,8 +125,8 @@ Global
{A4760F41-2B1F-4144-B7B2-62785AFFE79B}.Debug|Win32.Build.0 = Debug|x86 {A4760F41-2B1F-4144-B7B2-62785AFFE79B}.Debug|Win32.Build.0 = Debug|x86
{A4760F41-2B1F-4144-B7B2-62785AFFE79B}.Debug|x64.ActiveCfg = Debug|Any CPU {A4760F41-2B1F-4144-B7B2-62785AFFE79B}.Debug|x64.ActiveCfg = Debug|Any CPU
{A4760F41-2B1F-4144-B7B2-62785AFFE79B}.Debug|x64.Build.0 = Debug|Any CPU {A4760F41-2B1F-4144-B7B2-62785AFFE79B}.Debug|x64.Build.0 = Debug|Any CPU
{A4760F41-2B1F-4144-B7B2-62785AFFE79B}.Release|Win32.ActiveCfg = Release|Any CPU {A4760F41-2B1F-4144-B7B2-62785AFFE79B}.Release|Win32.ActiveCfg = Release|x86
{A4760F41-2B1F-4144-B7B2-62785AFFE79B}.Release|Win32.Build.0 = Release|Any CPU {A4760F41-2B1F-4144-B7B2-62785AFFE79B}.Release|Win32.Build.0 = Release|x86
{A4760F41-2B1F-4144-B7B2-62785AFFE79B}.Release|x64.ActiveCfg = Release|Any CPU {A4760F41-2B1F-4144-B7B2-62785AFFE79B}.Release|x64.ActiveCfg = Release|Any CPU
{A4760F41-2B1F-4144-B7B2-62785AFFE79B}.Release|x64.Build.0 = Release|Any CPU {A4760F41-2B1F-4144-B7B2-62785AFFE79B}.Release|x64.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection

View file

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
</startup>
</configuration>

View file

@ -1,9 +0,0 @@
<Application x:Class="OpenFaceOffline.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:OpenFaceOffline"
StartupUri="MainWindow.xaml">
<Application.Resources>
</Application.Resources>
</Application>

View file

@ -1,17 +0,0 @@
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;
namespace OpenFaceOffline
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
{
}
}

View file

@ -1,38 +0,0 @@
using System;
using System.Collections.Generic;
namespace OpenFaceOffline
{
public class FpsTracker
{
public TimeSpan HistoryLength { get; set; }
public FpsTracker()
{
HistoryLength = TimeSpan.FromSeconds(2);
}
private Queue<DateTime> frameTimes = new Queue<DateTime>();
private void DiscardOldFrames()
{
while (frameTimes.Count > 0 && (MainWindow.CurrentTime - frameTimes.Peek()) > HistoryLength)
frameTimes.Dequeue();
}
public void AddFrame()
{
frameTimes.Enqueue(MainWindow.CurrentTime);
DiscardOldFrames();
}
public double GetFPS()
{
DiscardOldFrames();
if (frameTimes.Count == 0)
return 0;
return frameTimes.Count / (MainWindow.CurrentTime - frameTimes.Peek()).TotalSeconds;
}
}
}

View file

@ -1,171 +0,0 @@
<Window x:Class="OpenFaceOffline.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:OpenFaceOffline="clr-namespace:OpenFaceOffline"
Title="OpenFace offline" Height="500" Width="1300" MinWidth="700" MinHeight="350" Closing="Window_Closing" WindowStartupLocation="CenterScreen">
<Grid Name="MainGrid">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2.1*"/>
<ColumnDefinition Width="0.8*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1.6*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="20"/>
<RowDefinition Height="3*" MinHeight="220"/>
<RowDefinition Height="0.4*"/>
<RowDefinition Height="auto"/>
</Grid.RowDefinitions>
<Menu IsMainMenu="True" Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="4">
<MenuItem Header="File">
<MenuItem Header="Open video(s)" Click="videoFileOpenClick">
</MenuItem>
<MenuItem Header="Open image(s)" Click="imageFileOpenClick">
</MenuItem>
<MenuItem Header="Open image sequence" Click="imageSequenceFileOpenClick">
</MenuItem>
</MenuItem>
<MenuItem Name="RecordingMenu" Header="Recording settings">
<MenuItem Header="Set Location"></MenuItem>
<MenuItem Name="RecordAUCheckBox" IsCheckable="True" Header="Record AUs" Click="recordCheckBox_click"></MenuItem>
<MenuItem Name="RecordPoseCheckBox" IsCheckable="True" Header="Record pose" Click="recordCheckBox_click"></MenuItem>
<MenuItem Name="RecordLandmarks2DCheckBox" IsCheckable="True" Header="Record 2D landmarks" Click="recordCheckBox_click"></MenuItem>
<MenuItem Name="RecordGazeCheckBox" IsCheckable="True" Header="Record gaze" Click="recordCheckBox_click"></MenuItem>
<MenuItem Name="RecordLandmarks3DCheckBox" IsCheckable="True" Header="Record 3D landmarks" Click="recordCheckBox_click"></MenuItem>
<MenuItem Name="RecordHOGCheckBox" IsCheckable="True" Header="Record HOG" Click="recordCheckBox_click"></MenuItem>
<MenuItem Name="RecordParamsCheckBox" IsCheckable="True" Header="Record model parameters" Click="recordCheckBox_click"></MenuItem>
<MenuItem Name="RecordAlignedCheckBox" IsCheckable="True" Header="Record aligned faces" Click="recordCheckBox_click"></MenuItem>
<MenuItem Name="RecordTrackedVidCheckBox" IsCheckable="True" Header="Record tracked video" Click="recordCheckBox_click"></MenuItem>
</MenuItem>
<MenuItem Header="AU settings">
<MenuItem Name="UseDynamicModelsCheckBox" IsChecked="True" IsCheckable="True" Header="Use dynamic models" Click="UseDynamicModelsCheckBox_Click"></MenuItem>
<MenuItem Name="UseDynamicShiftingCheckBox" IsCheckable="True" Header="Use dynamic shifting" Click="UseDynamicModelsCheckBox_Click"></MenuItem>
<MenuItem Name="UseDynamicScalingCheckBox" IsCheckable="True" Header="Use dynamic scaling" Click="UseDynamicModelsCheckBox_Click"></MenuItem>
</MenuItem>
<MenuItem Header="View">
<MenuItem Name="ShowVideoCheckBox" IsChecked="True" IsCheckable="True" Header="Show Video" Click="VisualisationCheckBox_Click"></MenuItem>
<MenuItem Name="ShowAppearanceFeaturesCheckBox" IsChecked="True" IsCheckable="True" Header="Show Appearance" Click="VisualisationCheckBox_Click"></MenuItem>
<MenuItem Name="ShowGeometryFeaturesCheckBox" IsChecked="True" IsCheckable="True" Header="Show Geometry" Click="VisualisationCheckBox_Click"></MenuItem>
<MenuItem Name="ShowAUsCheckBox" IsChecked="True" IsCheckable="True" Header="Show AUs" Click="VisualisationCheckBox_Click"></MenuItem>
</MenuItem>
</Menu>
<Border Name="VideoBorder" Grid.Row="1" Grid.Column="0" BorderBrush="Black" BorderThickness="1" Background="LightGray" Margin="5,5,0,0">
<OpenFaceOffline:OverlayImage x:Name="video" />
</Border>
<GroupBox Name="AppearanceBorder" Grid.Row="1" Grid.Column="1" BorderBrush="Black" BorderThickness="1" MinHeight="100">
<GroupBox.Header>
Appearance features
</GroupBox.Header>
<Grid HorizontalAlignment="Center">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="auto"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Border Grid.Row="0">
<OpenFaceOffline:SimpleImage x:Name="AlignedFace" MaxHeight="150"/>
</Border>
<Border Grid.Row="1">
<OpenFaceOffline:SimpleImage x:Name="AlignedHOG" MaxHeight="150"/>
</Border>
</Grid>
</GroupBox>
<GroupBox Name="GeometryBorder" Grid.Row="1" Grid.Column="2" BorderBrush="Black" BorderThickness="1" MinHeight="100">
<GroupBox.Header>
Geometry features
</GroupBox.Header>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<StackPanel Orientation="Vertical" Grid.Row="0" >
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Center">
<StackPanel Width="120" >
<Label Name="headOrientationLabel" FontSize="18" HorizontalContentAlignment="Left">Orientation</Label>
<StackPanel Orientation="Horizontal">
<Label Margin="5,0,0,0" FontSize="12" Width="60" HorizontalContentAlignment="Left">Turn:</Label>
<Label Name="YawLabel" FontSize="12" MinWidth="30" HorizontalContentAlignment="Right">0°</Label>
</StackPanel>
<StackPanel Orientation="Horizontal">
<Label Margin="5,0,0,0" FontSize="12" Width="60" HorizontalContentAlignment="Left">Up/down:</Label>
<Label Name="PitchLabel" FontSize="12" Width="30" HorizontalContentAlignment="Right">0°</Label>
</StackPanel>
<StackPanel Orientation="Horizontal">
<Label Margin="5,0,0,0" FontSize="12" Width="60" HorizontalContentAlignment="Left">Tilt:</Label>
<Label Name="RollLabel" FontSize="12" Width="30" HorizontalContentAlignment="Right">0°</Label>
</StackPanel>
</StackPanel>
<Line X1="0" X2="0" Y1="20" Y2="90" Width="2" Stroke="Gray"></Line>
<StackPanel>
<Label Name="headPoseLabel" FontSize="18" HorizontalContentAlignment="Left">Pose</Label>
<StackPanel Orientation="Horizontal">
<Label Margin="5,0,0,0" FontSize="12" HorizontalContentAlignment="Left" Width="20">X:</Label>
<Label Name="XPoseLabel" FontSize="12" HorizontalContentAlignment="Right" Width="50">0 mm</Label>
</StackPanel>
<StackPanel Orientation="Horizontal">
<Label Margin="5,0,0,0" FontSize="12" HorizontalContentAlignment="Left" Width="20">Y:</Label>
<Label Name="YPoseLabel" FontSize="12" HorizontalContentAlignment="Right" Width="50">0 mm</Label>
</StackPanel>
<StackPanel Orientation="Horizontal">
<Label Margin="5,0,0,0" FontSize="12" HorizontalContentAlignment="Left" Width="20">Z:</Label>
<Label Name="ZPoseLabel" FontSize="12" HorizontalContentAlignment="Right" Width="50">0 mm</Label>
</StackPanel>
</StackPanel>
</StackPanel>
<StackPanel>
<StackPanel Width="120" >
<Label Name="gazePanelLabel" FontSize="18" HorizontalContentAlignment="Left">Gaze</Label>
<StackPanel Orientation="Horizontal">
<Label Margin="5,-5,0,0" FontSize="12" Width="60" HorizontalContentAlignment="Left">Left-right:</Label>
<Label Margin="0,-5,0,0" Name="GazeXLabel" FontSize="12" MinWidth="30" HorizontalContentAlignment="Right">0</Label>
</StackPanel>
<StackPanel Orientation="Horizontal">
<Label Margin="5,-5,0,0" FontSize="12" Width="60" HorizontalContentAlignment="Left">Up/down:</Label>
<Label Margin="0,-5,0,0" Name="GazeYLabel" FontSize="12" Width="30" HorizontalContentAlignment="Right">0</Label>
</StackPanel>
</StackPanel>
</StackPanel>
</StackPanel>
<StackPanel Grid.Row="1" VerticalAlignment="Center">
<OpenFaceOffline:MultiBarGraph x:Name="nonRigidGraph" HorizontalAlignment="Center" MinHeight="100"/>
<Label HorizontalAlignment="Center">Non rigid parameters</Label>
</StackPanel>
</Grid>
</GroupBox>
<GroupBox Name="ActionUnitBorder" Grid.Row="1" Grid.Column="3" BorderBrush="Black" BorderThickness="1" MinHeight="100">
<GroupBox.Header>
Action Units
</GroupBox.Header>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
<GroupBox>
<GroupBox.Header>
Classification
</GroupBox.Header>
<OpenFaceOffline:MultiBarGraphHorz x:Name="auClassGraph" HorizontalAlignment="Center" MinWidth="100"/>
<!--"<StackPanel Name="AU_classes_panel">
</StackPanel>-->
</GroupBox>
<GroupBox>
<GroupBox.Header>
Regression
</GroupBox.Header>
<OpenFaceOffline:MultiBarGraphHorz x:Name="auRegGraph" HorizontalAlignment="Center" MinWidth="100"/>
</GroupBox>
</StackPanel>
</GroupBox>
<StackPanel Grid.Row="2" Grid.Column="0" Orientation="Horizontal" HorizontalAlignment="Center">
<Button VerticalAlignment="Top" IsEnabled="False" Click="PauseButton_Click" Name="PauseButton">Pause</Button>
<Button VerticalAlignment="Top" IsEnabled="False" Click="StopButton_Click" Name="StopButton">Stop</Button>
<Button VerticalAlignment="Top" IsEnabled="False" Click="ResetButton_Click" Name="ResetButton">Reset</Button>
<Button VerticalAlignment="Top" IsEnabled="False" Click="SkipButton_Click" Name="NextFrameButton">>> 1</Button>
<Button VerticalAlignment="Top" IsEnabled="False" Click="SkipButton_Click" Name="NextFiveFramesButton">>> 5</Button>
</StackPanel>
</Grid>
</Window>

File diff suppressed because it is too large Load diff

View file

@ -1,178 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" 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>{9661BE5C-2EE5-495E-BA64-6588602F411B}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>OpenFaceOffline</RootNamespace>
<AssemblyName>OpenFaceOffline</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<WarningLevel>4</WarningLevel>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
</PropertyGroup>
<PropertyGroup>
<StartupObject>
</StartupObject>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>..\..\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>..\..\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>..\..\x64\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
<OutputPath>..\..\x64\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xaml">
<RequiredTargetFramework>4.0</RequiredTargetFramework>
</Reference>
<Reference Include="WindowsBase" />
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
</ItemGroup>
<ItemGroup>
<ApplicationDefinition Include="App.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</ApplicationDefinition>
<Compile Include="UI_items\BarGraph.xaml.cs">
<DependentUpon>BarGraph.xaml</DependentUpon>
</Compile>
<Compile Include="FpsTracker.cs" />
<Compile Include="UI_items\BarGraphHorizontal.xaml.cs">
<DependentUpon>BarGraphHorizontal.xaml</DependentUpon>
</Compile>
<Compile Include="UI_items\MultiBarGraph.xaml.cs">
<DependentUpon>MultiBarGraph.xaml</DependentUpon>
</Compile>
<Compile Include="UI_items\MultiBarGraphHorz.xaml.cs">
<DependentUpon>MultiBarGraphHorz.xaml</DependentUpon>
</Compile>
<Compile Include="UI_items\SimpleImage.xaml.cs">
<DependentUpon>SimpleImage.xaml</DependentUpon>
</Compile>
<Page Include="UI_items\BarGraph.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="UI_items\BarGraphHorizontal.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="UI_items\MultiBarGraph.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="MainWindow.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Compile Include="App.xaml.cs">
<DependentUpon>App.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Compile Include="MainWindow.xaml.cs">
<DependentUpon>MainWindow.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Page Include="UI_items\MultiBarGraphHorz.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="UI_items\OverlayImage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="UI_items\SimpleImage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<Compile Include="UI_items\OverlayImage.xaml.cs">
<DependentUpon>OverlayImage.xaml</DependentUpon>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<AppDesigner Include="Properties\" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\lib\local\CppInerop\CppInerop.vcxproj">
<Project>{78196985-ee54-411f-822b-5a23edf80642}</Project>
<Name>CppInerop</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View file

@ -1,55 +0,0 @@
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Windows;
// 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("OpenFaceOffline")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("OpenFaceOffline")]
[assembly: AssemblyCopyright("Copyright © Cambridge 2016")]
[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)]
//In order to begin building localizable applications, set
//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file
//inside a <PropertyGroup>. For example, if you are using US english
//in your source files, set the <UICulture> to en-US. Then uncomment
//the NeutralResourceLanguage attribute below. Update the "en-US" in
//the line below to match the UICulture setting in the project file.
//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
[assembly: ThemeInfo(
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
//(used if a resource is not found in the page,
// or application resource dictionaries)
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
//(used if a resource is not found in the page,
// app, or any theme specific resource dictionaries)
)]
// 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.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View file

@ -1,63 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace OpenFaceOffline.Properties {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("OpenFaceOffline.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
}
}

View file

@ -1,117 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View file

@ -1,26 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace OpenFaceOffline.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default {
get {
return defaultInstance;
}
}
}
}

View file

@ -1,7 +0,0 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="uri:settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>

View file

@ -1,17 +0,0 @@
<UserControl x:Class="OpenFaceOffline.BarGraph"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
d:DesignHeight="100" d:DesignWidth="100">
<StackPanel HorizontalAlignment="Center" >
<Border Name="barContainerPos" Background="PowderBlue" Width="32" DockPanel.Dock="Top" MinHeight="50">
<Rectangle Name="barPos" Fill="CadetBlue" Height="0" VerticalAlignment="Bottom"/>
</Border>
<Border Name="barContainerNeg" Background="PowderBlue" Width="32" MinHeight="50">
<Rectangle Name="barNeg" Fill="CadetBlue" Height="0" VerticalAlignment="Top"/>
</Border>
</StackPanel>
</UserControl>

View file

@ -1,39 +0,0 @@
using System.Windows.Controls;
namespace OpenFaceOffline
{
/// <summary>
/// Interaction logic for BarGraph.xaml
/// </summary>
public partial class BarGraph : UserControl
{
private double targetValue = 0;
public BarGraph()
{
InitializeComponent();
}
public void SetValue(double value)
{
targetValue = 1.5 * value;
if (targetValue > 0)
{
if (targetValue > barContainerPos.ActualHeight)
targetValue = barContainerPos.ActualHeight;
barPos.Height = targetValue;
barNeg.Height = 0;
}
if (targetValue < 0)
{
if (-targetValue > barContainerNeg.ActualHeight)
targetValue = -barContainerNeg.ActualHeight;
barPos.Height = 0;
barNeg.Height = -targetValue;
}
}
}
}

View file

@ -1,14 +0,0 @@
<UserControl x:Class="OpenFaceOffline.BarGraphHorizontal"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
d:DesignHeight="30" d:DesignWidth="200">
<StackPanel VerticalAlignment="Center" Orientation="Horizontal" HorizontalAlignment="Left" >
<Label Name="Label" FontSize="10" Width="120">AU name</Label>
<Border Name="barContainerPos" Background="PowderBlue" Height="12" DockPanel.Dock="Left" MinWidth="60">
<Rectangle Name="barPos" Fill="CadetBlue" Width="0" HorizontalAlignment="Left"/>
</Border>
</StackPanel>
</UserControl>

View file

@ -1,42 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace OpenFaceOffline
{
/// <summary>
/// Interaction logic for BarGraphHorizontal.xaml
/// </summary>
public partial class BarGraphHorizontal : UserControl
{
double targetValue = 0;
public BarGraphHorizontal(String label)
{
InitializeComponent();
Label.Content = label;
}
public void SetValue(double value)
{
targetValue = value;
barPos.Width = targetValue * barContainerPos.ActualWidth;
}
public double GetTarget()
{
return targetValue;
}
}
}

View file

@ -1,11 +0,0 @@
<UserControl x:Class="OpenFaceOffline.MultiBarGraph"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
d:DesignHeight="100" d:DesignWidth="300">
<Grid Name="barGrid">
</Grid>
</UserControl>

View file

@ -1,59 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace OpenFaceOffline
{
/// <summary>
/// Interaction logic for MultiBarGraph.xaml
/// </summary>
public partial class MultiBarGraph : UserControl
{
int num_bars = 0;
List<BarGraph> graphs;
public MultiBarGraph()
{
InitializeComponent();
graphs = new List<BarGraph>();
}
public void Update(List<double> data)
{
// Create new bars if necessary
if (num_bars != data.Count)
{
num_bars = data.Count;
barGrid.Children.Clear();
foreach (var value in data)
{
BarGraph newBar = new BarGraph();
graphs.Add(newBar);
barGrid.ColumnDefinitions.Add(new ColumnDefinition());
Grid.SetColumn(newBar, graphs.Count);
barGrid.Children.Add(newBar);
}
}
// Update the bars
for (int i = 0; i < data.Count; ++i)
{
graphs[i].SetValue(data[i]);
}
}
}
}

View file

@ -1,13 +0,0 @@
<UserControl x:Class="OpenFaceOffline.MultiBarGraphHorz"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300">
<Grid Name="barGrid">
</Grid>
</UserControl>

View file

@ -1,90 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace OpenFaceOffline
{
/// <summary>
/// Interaction logic for MultiBarGraphHorz.xaml
/// </summary>
public partial class MultiBarGraphHorz : UserControl
{
int num_bars = 0;
Dictionary<String, BarGraphHorizontal> graphs;
// Name mapping
Dictionary<String, String> mapping;
public MultiBarGraphHorz()
{
InitializeComponent();
graphs = new Dictionary<string, BarGraphHorizontal>();
mapping = new Dictionary<string, string>();
mapping["AU01"] = "Inner Brow raiser";
mapping["AU02"] = "Outer Brow raiser";
mapping["AU04"] = "Brow lowerer";
mapping["AU05"] = "Upper lid raiser";
mapping["AU06"] = "Cheek raiser";
mapping["AU07"] = "Lid tightener";
mapping["AU09"] = "Nose wrinkler";
mapping["AU10"] = "Upper lip raiser";
mapping["AU12"] = "Lip corner puller (smile)";
mapping["AU14"] = "Dimpler";
mapping["AU15"] = "Lip corner depressor";
mapping["AU17"] = "Chin Raiser";
mapping["AU20"] = "Lip Stretcher";
mapping["AU23"] = "Lip tightener";
mapping["AU25"] = "Lips part";
mapping["AU26"] = "Jaw drop";
mapping["AU28"] = "Lip suck";
mapping["AU45"] = "Blink";
}
public void Update(Dictionary<String, double> data)
{
// Create new bars if necessary
if (num_bars != data.Count)
{
num_bars = data.Count;
barGrid.Children.Clear();
// Make sure AUs are sorted
var data_labels = data.Keys.ToList();
data_labels.Sort();
foreach (var label in data_labels)
{
BarGraphHorizontal newBar = new BarGraphHorizontal(label + " - " + mapping[label]);
barGrid.RowDefinitions.Add(new RowDefinition());
Grid.SetRow(newBar, graphs.Count);
graphs.Add(label, newBar);
barGrid.Children.Add(newBar);
}
}
// Update the bars
foreach (var value in data)
{
double old_value = graphs[value.Key].GetTarget();
// some smoothing as well
graphs[value.Key].SetValue(old_value * 0.15 + 0.85 * value.Value);
}
}
}
}

View file

@ -1,8 +0,0 @@
<Image x:Class="OpenFaceOffline.OverlayImage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300" >
</Image>

View file

@ -1,110 +0,0 @@
using System;
using System.Collections.Generic;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using System.Windows.Media.Imaging;
namespace OpenFaceOffline
{
/// <summary>
/// Interaction logic for OverlayImage.xaml
/// </summary>
public partial class OverlayImage : Image
{
public OverlayImage()
{
InitializeComponent();
OverlayLines = new List<Tuple<Point, Point>>();
OverlayPoints = new List<Point>();
GazeLines = new List<Tuple<Point, Point>>();
Progress = -1;
}
protected override void OnRender(DrawingContext dc)
{
base.OnRender(dc);
if (OverlayLines == null)
OverlayLines = new List<Tuple<Point, Point>>();
if (OverlayPoints == null)
OverlayPoints = new List<Point>();
if (Source == null || !(Source is WriteableBitmap))
return;
var width = ((WriteableBitmap)Source).PixelWidth;
var height = ((WriteableBitmap)Source).PixelHeight;
foreach (var line in OverlayLines)
{
var p1 = new Point(ActualWidth * line.Item1.X / width, ActualHeight * line.Item1.Y / height);
var p2 = new Point(ActualWidth * line.Item2.X / width, ActualHeight * line.Item2.Y / height);
dc.DrawLine(new Pen(new SolidColorBrush(Color.FromArgb(200, (byte)(100 + (155 * (1 - Confidence))), (byte)(100 + (155 * Confidence)), 100)), 2), p1, p2);
}
foreach (var line in GazeLines)
{
var p1 = new Point(ActualWidth * line.Item1.X / width, ActualHeight * line.Item1.Y / height);
var p2 = new Point(ActualWidth * line.Item2.X / width, ActualHeight * line.Item2.Y / height);
dc.DrawLine(new Pen(new SolidColorBrush(Color.FromArgb(200, (byte)(240), (byte)(30), (byte)100)), 3), p1, p2);
}
foreach (var p in OverlayPoints)
{
var q = new Point(ActualWidth * p.X / width, ActualHeight * p.Y / height);
dc.DrawEllipse(new SolidColorBrush(Color.FromArgb((byte)(200 * Confidence), 255, 255, 100)), null, q, 2, 2);
}
double scaling = ActualWidth / 400.0;
int confidence_width = (int)(107.0 * scaling);
int confidence_height = (int)(18.0 * scaling);
Brush conf_brush = new SolidColorBrush(Color.FromRgb((byte)((1 - Confidence) * 255), (byte)(Confidence * 255), (byte)40));
dc.DrawRoundedRectangle(conf_brush, new Pen(Brushes.Black, 0.5 * scaling), new Rect(ActualWidth - confidence_width - 1, 0, confidence_width, confidence_height), 3.0 * scaling, 3.0 * scaling);
FormattedText txt = new FormattedText("Confidence: " + (int)(100 * Confidence) + "%", System.Globalization.CultureInfo.CurrentCulture, System.Windows.FlowDirection.LeftToRight, new Typeface("Verdana"), 12.0 * scaling, Brushes.Black);
dc.DrawText(txt, new Point(ActualWidth - confidence_width + 2, 2));
int fps_width = (int)(52.0 * scaling);
int fps_height = (int)(18.0 * scaling);
dc.DrawRoundedRectangle(Brushes.WhiteSmoke, new Pen(Brushes.Black, 0.5 * scaling), new Rect(0, 0, fps_width, fps_height), 3.0 * scaling, 3.0 * scaling);
FormattedText fps_txt = new FormattedText("FPS: " + (int)FPS, System.Globalization.CultureInfo.CurrentCulture, System.Windows.FlowDirection.LeftToRight, new Typeface("Verdana"), 12.0 * scaling, Brushes.Black);
dc.DrawText(fps_txt, new Point(2.0 * scaling, 0));
old_width = width;
old_height = height;
// Drawing a progress bar at the bottom of the image
if (Progress > 0)
{
int progress_bar_height = (int)(6.0 * scaling);
dc.DrawRectangle(Brushes.GreenYellow, new Pen(Brushes.Black, 0.5 * scaling), new Rect(0, ActualHeight - progress_bar_height, Progress * ActualWidth, progress_bar_height));
}
}
public List<Tuple<Point, Point>> OverlayLines { get; set; }
public List<Tuple<Point, Point>> GazeLines { get; set; }
public List<Point> OverlayPoints { get; set; }
public double Confidence { get; set; }
public double FPS { get; set; }
// 0 to 1 indicates how much video has been processed so far
public double Progress { get; set; }
int old_width;
int old_height;
}
}

View file

@ -1,8 +0,0 @@
<Image x:Class="OpenFaceOffline.SimpleImage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300" >
</Image>

View file

@ -1,36 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace OpenFaceOffline
{
/// <summary>
/// Interaction logic for OverlayImage.xaml
/// </summary>
public partial class SimpleImage : Image
{
public SimpleImage()
{
InitializeComponent();
}
protected override void OnRender(DrawingContext dc)
{
base.OnRender(dc);
if (Source == null || !(Source is WriteableBitmap))
return;
}
}
}

View file

@ -129,11 +129,18 @@ namespace OpenFaceOffline
FaceAnalyserManaged face_analyser; FaceAnalyserManaged face_analyser;
// Recording parameters (default values) // Recording parameters (default values)
// TODO these should only be initialized when starting the recording, might not need to have them as members (also all should be on by default)
bool record_HOG = false; // HOG features extracted from face images bool record_HOG = false; // HOG features extracted from face images
bool record_aligned = false; // aligned face images bool record_aligned = false; // aligned face images
bool record_tracked_vid = false; bool record_tracked_vid = false;
// Check wich things need to be recorded
bool record_2D_landmarks = false;
bool record_3D_landmarks = false;
bool record_model_params = false;
bool record_pose = false;
bool record_AUs = false;
bool record_gaze = false;
// Visualisation options // Visualisation options
bool show_tracked_video = true; bool show_tracked_video = true;
bool show_appearance = true; bool show_appearance = true;
@ -169,9 +176,15 @@ namespace OpenFaceOffline
Dispatcher.Invoke(DispatcherPriority.Render, new TimeSpan(0, 0, 0, 0, 2000), (Action)(() => Dispatcher.Invoke(DispatcherPriority.Render, new TimeSpan(0, 0, 0, 0, 2000), (Action)(() =>
{ {
RecordAUCheckBox.IsChecked = record_AUs;
RecordAlignedCheckBox.IsChecked = record_aligned; RecordAlignedCheckBox.IsChecked = record_aligned;
RecordTrackedVidCheckBox.IsChecked = record_tracked_vid; RecordTrackedVidCheckBox.IsChecked = record_tracked_vid;
RecordHOGCheckBox.IsChecked = record_HOG; RecordHOGCheckBox.IsChecked = record_HOG;
RecordGazeCheckBox.IsChecked = record_gaze;
RecordLandmarks2DCheckBox.IsChecked = record_2D_landmarks;
RecordLandmarks3DCheckBox.IsChecked = record_3D_landmarks;
RecordParamsCheckBox.IsChecked = record_model_params;
RecordPoseCheckBox.IsChecked = record_pose;
UseDynamicModelsCheckBox.IsChecked = use_dynamic_models; UseDynamicModelsCheckBox.IsChecked = use_dynamic_models;
UseDynamicScalingCheckBox.IsChecked = dynamic_AU_scale; UseDynamicScalingCheckBox.IsChecked = dynamic_AU_scale;
@ -220,7 +233,8 @@ namespace OpenFaceOffline
// Prepare recording if any based on the directory // Prepare recording if any based on the directory
String file_no_ext = System.IO.Path.GetDirectoryName(filenames[0]); String file_no_ext = System.IO.Path.GetDirectoryName(filenames[0]);
file_no_ext = System.IO.Path.GetFileName(file_no_ext); file_no_ext = System.IO.Path.GetFileName(file_no_ext);
SetupRecording(record_root, file_no_ext, capture.width, capture.height);
SetupRecording(record_root, file_no_ext, capture.width, capture.height, record_2D_landmarks, record_2D_landmarks, record_model_params, record_pose, record_AUs, record_gaze);
// Start the actual processing // Start the actual processing
VideoLoop(); VideoLoop();
@ -289,8 +303,8 @@ namespace OpenFaceOffline
{ {
// Prepare recording if any // Prepare recording if any
String file_no_ext = System.IO.Path.GetFileNameWithoutExtension(filename); String file_no_ext = System.IO.Path.GetFileNameWithoutExtension(filename);
SetupRecording(record_root, file_no_ext, capture.width, capture.height); SetupRecording(record_root, file_no_ext, capture.width, capture.height, record_2D_landmarks, record_3D_landmarks, record_model_params, record_pose, record_AUs, record_gaze);
// Start the actual processing // Start the actual processing
VideoLoop(); VideoLoop();
@ -423,14 +437,6 @@ namespace OpenFaceOffline
double fps = capture.GetFPS(); double fps = capture.GetFPS();
if (fps <= 0) fps = 30; if (fps <= 0) fps = 30;
// Check wich things need to be recorded
bool output_2D_landmarks = RecordLandmarks2DCheckBox.IsChecked;
bool output_3D_landmarks = RecordLandmarks3DCheckBox.IsChecked;
bool output_model_params = RecordParamsCheckBox.IsChecked;
bool output_pose = RecordPoseCheckBox.IsChecked;
bool output_AUs = RecordAUCheckBox.IsChecked;
bool output_gaze = RecordGazeCheckBox.IsChecked;
while (thread_running) while (thread_running)
{ {
////////////////////////////////////////////// //////////////////////////////////////////////
@ -487,7 +493,7 @@ namespace OpenFaceOffline
List<double> non_rigid_params = clnf_model.GetNonRigidParams(); List<double> non_rigid_params = clnf_model.GetNonRigidParams();
// The face analysis step (only done if recording AUs, HOGs or video) // The face analysis step (only done if recording AUs, HOGs or video)
if (output_AUs || record_HOG || record_aligned || show_aus || show_appearance || record_tracked_vid || output_gaze) if (record_AUs || record_HOG || record_aligned || show_aus || show_appearance || record_tracked_vid || record_gaze)
{ {
face_analyser.AddNextFrame(frame, clnf_model, fx, fy, cx, cy, false, show_appearance, record_tracked_vid); face_analyser.AddNextFrame(frame, clnf_model, fx, fy, cx, cy, false, show_appearance, record_tracked_vid);
} }
@ -624,7 +630,7 @@ namespace OpenFaceOffline
// Recording the tracked model // Recording the tracked model
RecordFrame(clnf_model, detectionSucceeding, frame_id, frame, grayFrame, (fps * (double)frame_id)/1000.0, RecordFrame(clnf_model, detectionSucceeding, frame_id, frame, grayFrame, (fps * (double)frame_id)/1000.0,
output_2D_landmarks, output_2D_landmarks, output_model_params, output_pose, output_AUs, output_gaze, fx, fy, cx, cy); record_2D_landmarks, record_2D_landmarks, record_model_params, record_pose, record_AUs, record_gaze, fx, fy, cx, cy);
if (reset) if (reset)
{ {
@ -925,9 +931,15 @@ namespace OpenFaceOffline
// Actually update the GUI accordingly // Actually update the GUI accordingly
Dispatcher.Invoke(DispatcherPriority.Render, new TimeSpan(0, 0, 0, 0, 2000), (Action)(() => Dispatcher.Invoke(DispatcherPriority.Render, new TimeSpan(0, 0, 0, 0, 2000), (Action)(() =>
{ {
RecordAUCheckBox.IsChecked = record_AUs;
RecordAlignedCheckBox.IsChecked = record_aligned; RecordAlignedCheckBox.IsChecked = record_aligned;
RecordTrackedVidCheckBox.IsChecked = record_tracked_vid; RecordTrackedVidCheckBox.IsChecked = record_tracked_vid;
RecordHOGCheckBox.IsChecked = record_HOG; RecordHOGCheckBox.IsChecked = record_HOG;
RecordGazeCheckBox.IsChecked = record_gaze;
RecordLandmarks2DCheckBox.IsChecked = record_2D_landmarks;
RecordLandmarks3DCheckBox.IsChecked = record_3D_landmarks;
RecordParamsCheckBox.IsChecked = record_model_params;
RecordPoseCheckBox.IsChecked = record_pose;
ShowVideoCheckBox.IsChecked = true; ShowVideoCheckBox.IsChecked = true;
ShowAppearanceFeaturesCheckBox.IsChecked = false; ShowAppearanceFeaturesCheckBox.IsChecked = false;
@ -1171,9 +1183,15 @@ namespace OpenFaceOffline
private void recordCheckBox_click(object sender, RoutedEventArgs e) private void recordCheckBox_click(object sender, RoutedEventArgs e)
{ {
record_AUs = RecordAUCheckBox.IsChecked;
record_aligned = RecordAlignedCheckBox.IsChecked; record_aligned = RecordAlignedCheckBox.IsChecked;
record_HOG = RecordHOGCheckBox.IsChecked; record_HOG = RecordHOGCheckBox.IsChecked;
record_gaze = RecordGazeCheckBox.IsChecked;
record_tracked_vid = RecordTrackedVidCheckBox.IsChecked; record_tracked_vid = RecordTrackedVidCheckBox.IsChecked;
record_2D_landmarks = RecordLandmarks2DCheckBox.IsChecked;
record_3D_landmarks = RecordLandmarks3DCheckBox.IsChecked;
record_model_params = RecordParamsCheckBox.IsChecked;
record_pose = RecordPoseCheckBox.IsChecked;
} }
private void UseDynamicModelsCheckBox_Click(object sender, RoutedEventArgs e) private void UseDynamicModelsCheckBox_Click(object sender, RoutedEventArgs e)