Adding output folder selection (trickier that it sounds due to lack of native WPF support)
This commit is contained in:
parent
0befd5f756
commit
6499412259
15 changed files with 28478 additions and 12 deletions
|
@ -30,7 +30,6 @@
|
|||
</MenuItem>
|
||||
</MenuItem>
|
||||
<MenuItem Name="RecordingMenu" Header="Record">
|
||||
<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>
|
||||
|
@ -42,7 +41,7 @@
|
|||
<MenuItem Name="RecordTrackedVidCheckBox" IsCheckable="True" Header="Record tracked video" Click="recordCheckBox_click"></MenuItem>
|
||||
</MenuItem>
|
||||
<MenuItem Name="SettingsMenu" Header="Recording settings">
|
||||
<MenuItem Header="Set output location..."></MenuItem>
|
||||
<MenuItem Name="OutputLocationItem" Header="Set output location..." Click="OutputLocationItem_Click" ></MenuItem>
|
||||
<MenuItem Header="Set output image size..." Click="setOutputImageSize_Click"></MenuItem>
|
||||
</MenuItem>
|
||||
<MenuItem Header="AU settings">
|
||||
|
|
|
@ -73,6 +73,7 @@ using CppInterop.LandmarkDetector;
|
|||
using CameraInterop;
|
||||
using FaceAnalyser_Interop;
|
||||
using System.Globalization;
|
||||
using Microsoft.WindowsAPICodePack.Dialogs;
|
||||
|
||||
namespace OpenFaceOffline
|
||||
{
|
||||
|
@ -1229,5 +1230,25 @@ namespace OpenFaceOffline
|
|||
|
||||
}
|
||||
}
|
||||
|
||||
private void OutputLocationItem_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var dlg = new CommonOpenFileDialog();
|
||||
dlg.Title = "Select output directory";
|
||||
dlg.IsFolderPicker = true;
|
||||
dlg.AllowNonFileSystemItems = false;
|
||||
dlg.EnsureFileExists = true;
|
||||
dlg.EnsurePathExists = true;
|
||||
dlg.EnsureReadOnly = false;
|
||||
dlg.EnsureValidNames = true;
|
||||
dlg.Multiselect = false;
|
||||
dlg.ShowPlacesList = true;
|
||||
|
||||
if (dlg.ShowDialog() == CommonFileDialogResult.Ok)
|
||||
{
|
||||
var folder = dlg.FileName;
|
||||
record_root = folder;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -58,6 +58,14 @@
|
|||
<ApplicationIcon>logo1.ico</ApplicationIcon>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Microsoft.WindowsAPICodePack, Version=1.1.2.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\WindowsAPICodePack-Core.1.1.2\lib\Microsoft.WindowsAPICodePack.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.WindowsAPICodePack.Shell, Version=1.1.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\WindowsAPICodePack-Shell.1.1.1\lib\Microsoft.WindowsAPICodePack.Shell.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
|
@ -159,6 +167,9 @@
|
|||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
</EmbeddedResource>
|
||||
<None Include="packages.config">
|
||||
<SubType>Designer</SubType>
|
||||
</None>
|
||||
<None Include="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
|
|
5
gui/OpenFaceOffline/packages.config
Normal file
5
gui/OpenFaceOffline/packages.config
Normal file
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="WindowsAPICodePack-Core" version="1.1.2" targetFramework="net452" />
|
||||
<package id="WindowsAPICodePack-Shell" version="1.1.1" targetFramework="net452" />
|
||||
</packages>
|
|
@ -22,32 +22,32 @@ new_bp4d_dirs = {};
|
|||
% This might take some time
|
||||
for i = 1:numel(bp4d_dirs)
|
||||
dirs = dir([bp4d_loc, '/', bp4d_dirs{i}, '/T*']);
|
||||
|
||||
|
||||
tmp_dir = [bp4d_loc, '/../tmp/', bp4d_dirs{i}, '/'];
|
||||
new_bp4d_dirs = cat(1, new_bp4d_dirs, tmp_dir);
|
||||
|
||||
|
||||
if(~exist(tmp_dir, 'file'))
|
||||
mkdir(tmp_dir);
|
||||
|
||||
|
||||
% Move all images and resize them
|
||||
for d=1:numel(dirs)
|
||||
|
||||
|
||||
in_files = dir([bp4d_loc, '/', bp4d_dirs{i}, '/', dirs(d).name, '/*.jpg']);
|
||||
|
||||
|
||||
for img_ind=1:numel(in_files)
|
||||
|
||||
|
||||
img_file = [bp4d_loc, '/', bp4d_dirs{i}, '/', dirs(d).name, '/', in_files(img_ind).name];
|
||||
img = imread(img_file);
|
||||
img = imresize(img, 0.5);
|
||||
img_out = [tmp_dir, dirs(d).name, '_', in_files(img_ind).name];
|
||||
imwrite(img, img_out);
|
||||
|
||||
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
%%
|
||||
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
packages/WindowsAPICodePack-Core.1.1.2/WindowsAPICodePack-Core.1.1.2.nupkg
vendored
Normal file
BIN
packages/WindowsAPICodePack-Core.1.1.2/WindowsAPICodePack-Core.1.1.2.nupkg
vendored
Normal file
Binary file not shown.
BIN
packages/WindowsAPICodePack-Core.1.1.2/lib/Microsoft.WindowsAPICodePack.dll
vendored
Normal file
BIN
packages/WindowsAPICodePack-Core.1.1.2/lib/Microsoft.WindowsAPICodePack.dll
vendored
Normal file
Binary file not shown.
2934
packages/WindowsAPICodePack-Core.1.1.2/lib/Microsoft.WindowsAPICodePack.xml
vendored
Normal file
2934
packages/WindowsAPICodePack-Core.1.1.2/lib/Microsoft.WindowsAPICodePack.xml
vendored
Normal file
File diff suppressed because it is too large
Load diff
BIN
packages/WindowsAPICodePack-Shell.1.1.1/WindowsAPICodePack-Shell.1.1.1.nupkg
vendored
Normal file
BIN
packages/WindowsAPICodePack-Shell.1.1.1/WindowsAPICodePack-Shell.1.1.1.nupkg
vendored
Normal file
Binary file not shown.
BIN
packages/WindowsAPICodePack-Shell.1.1.1/lib/Microsoft.WindowsAPICodePack.Shell.dll
vendored
Normal file
BIN
packages/WindowsAPICodePack-Shell.1.1.1/lib/Microsoft.WindowsAPICodePack.Shell.dll
vendored
Normal file
Binary file not shown.
25496
packages/WindowsAPICodePack-Shell.1.1.1/lib/Microsoft.WindowsAPICodePack.Shell.xml
vendored
Normal file
25496
packages/WindowsAPICodePack-Shell.1.1.1/lib/Microsoft.WindowsAPICodePack.Shell.xml
vendored
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue