Skip to content

Commit acff502

Browse files
committed
Add Pose extractor demo
1 parent 5c8f596 commit acff502

20 files changed

+697
-1100
lines changed

Examples/TensorStack.Example.Extractors/App.xaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,25 @@
11
<Application x:Class="TensorStack.Example.App"
22
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
33
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4+
xmlns:System="clr-namespace:System;assembly=mscorlib"
45
xmlns:local="clr-namespace:TensorStack.Example"
56
xmlns:CommonControls="clr-namespace:TensorStack.WPF.Controls;assembly=TensorStack.WPF"
7+
xmlns:Extractors="clr-namespace:TensorStack.Extractors.Common;assembly=TensorStack.Extractors"
68
ShutdownMode="OnMainWindowClose">
79
<Application.Resources>
810

911

1012
<ResourceDictionary>
1113

1214
<!--TensorStack.Example-->
15+
16+
<ObjectDataProvider x:Key="BackgroundMode" MethodName="GetValues" ObjectType="{x:Type System:Enum}">
17+
<ObjectDataProvider.MethodParameters>
18+
<x:Type TypeName="Extractors:BackgroundMode"/>
19+
</ObjectDataProvider.MethodParameters>
20+
</ObjectDataProvider>
21+
22+
1323
<Style x:Key="ImageDropZoneStyle" TargetType="{x:Type Border}">
1424
<Setter Property="AllowDrop" Value="False"/>
1525
<Setter Property="BorderBrush" Value="Transparent"/>

Examples/TensorStack.Example.Extractors/App.xaml.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ public App()
3131

3232
builder.Services.AddSingleton<IMediaService, MediaService>();
3333
builder.Services.AddSingleton<IExtractorService, ExtractorService>();
34-
builder.Services.AddSingleton<IBackgroundService, BackgroundService>();
3534

3635
_appHost = builder.Build();
3736

Examples/TensorStack.Example.Extractors/Common/BackgroundModel.cs

Lines changed: 0 additions & 22 deletions
This file was deleted.

Examples/TensorStack.Example.Extractors/Common/ExtractorModel.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ public record ExtractorModel
77
public int Id { get; init; }
88
public string Name { get; init; }
99
public bool IsDefault { get; set; }
10-
10+
public ExtractorType Type { get; set; }
1111
public int Channels { get; set; }
1212
public int SampleSize { get; set; }
1313
public Normalization Normalization { get; set; }
@@ -17,4 +17,11 @@ public record ExtractorModel
1717
public string Path { get; set; }
1818
public string UrlPath { get; set; }
1919
}
20+
21+
public enum ExtractorType
22+
{
23+
Default = 0,
24+
Background = 1,
25+
Pose = 2
26+
}
2027
}

Examples/TensorStack.Example.Extractors/MainWindow.xaml

Lines changed: 32 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -15,40 +15,46 @@
1515

1616
<!--Main Menu-->
1717
<Grid DockPanel.Dock="Top" WindowChrome.IsHitTestVisibleInChrome="True">
18-
<UniformGrid Columns="6" Height="30" Margin="2">
1918

20-
<!--Logo-->
21-
<Grid IsHitTestVisible="False">
22-
<Image Source="{StaticResource ImageTensorstackText}" Height="32" HorizontalAlignment="Left" Margin="4,2,20,0" />
23-
</Grid>
19+
<Grid.ColumnDefinitions>
20+
<ColumnDefinition Width="200" />
21+
<ColumnDefinition Width="*" />
22+
<ColumnDefinition Width="200" />
23+
</Grid.ColumnDefinitions>
24+
25+
<!--Logo-->
26+
<Grid Grid.Column="0" IsHitTestVisible="False">
27+
<Image Source="{StaticResource ImageTensorstackText}" Height="32" HorizontalAlignment="Left" Margin="4,2,20,0" />
28+
</Grid>
29+
30+
31+
<UniformGrid Grid.Column="1" Columns="2" Height="30" Margin="2">
2432

2533
<!--Views-->
2634
<Button Command="{Binding NavigateCommand}" CommandParameter="{x:Static Views:View.ImageExtractor}" Content="Image Extractor" />
27-
<Button Command="{Binding NavigateCommand}" CommandParameter="{x:Static Views:View.ImageBackground}" Content="Image Background" />
2835
<Button Command="{Binding NavigateCommand}" CommandParameter="{x:Static Views:View.VideoExtractor}" Content="Video Extractor" />
29-
<Button Command="{Binding NavigateCommand}" CommandParameter="{x:Static Views:View.VideoBackground}" Content="Video Background" />
3036

31-
<!--Window Options-->
32-
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
33-
<UniformGrid Columns="3" >
34-
<Button Command="{Binding MinimizeCommand}" Padding="10,1" >
35-
<CommonControls:FontAwesome Icon="&#xf2d1;" />
37+
</UniformGrid>
38+
39+
<!--Window Options-->
40+
<StackPanel Grid.Column="2" Orientation="Horizontal" HorizontalAlignment="Right">
41+
<UniformGrid Columns="3" >
42+
<Button Command="{Binding MinimizeCommand}" Padding="10,1" >
43+
<CommonControls:FontAwesome Icon="&#xf2d1;" />
44+
</Button>
45+
<Grid>
46+
<Button Command="{Binding RestoreCommand}" Padding="10,1" Visibility="{Binding WindowState, Converter={StaticResource EnumToVisibilityConverter}, ConverterParameter=Maximized}">
47+
<CommonControls:FontAwesome Icon="&#xf2d2;" />
3648
</Button>
37-
<Grid>
38-
<Button Command="{Binding RestoreCommand}" Padding="10,1" Visibility="{Binding WindowState, Converter={StaticResource EnumToVisibilityConverter}, ConverterParameter=Maximized}">
39-
<CommonControls:FontAwesome Icon="&#xf2d2;" />
40-
</Button>
41-
<Button Command="{Binding MaximizeCommand}" Padding="10,1" Visibility="{Binding WindowState, Converter={StaticResource InverseEnumToVisibilityConverter}, ConverterParameter=Maximized}">
42-
<CommonControls:FontAwesome Icon="&#xf2d0;" />
43-
</Button>
44-
</Grid>
45-
<Button x:Name="CloseButton" Command="{Binding CloseCommand}" Padding="12,0" >
46-
<CommonControls:FontAwesome Icon="&#xf00d;" />
49+
<Button Command="{Binding MaximizeCommand}" Padding="10,1" Visibility="{Binding WindowState, Converter={StaticResource InverseEnumToVisibilityConverter}, ConverterParameter=Maximized}">
50+
<CommonControls:FontAwesome Icon="&#xf2d0;" />
4751
</Button>
48-
</UniformGrid>
49-
</StackPanel>
50-
51-
</UniformGrid>
52+
</Grid>
53+
<Button x:Name="CloseButton" Command="{Binding CloseCommand}" Padding="12,0" >
54+
<CommonControls:FontAwesome Icon="&#xf00d;" />
55+
</Button>
56+
</UniformGrid>
57+
</StackPanel>
5258
</Grid>
5359

5460
<!--View Container-->

Examples/TensorStack.Example.Extractors/Services/BackgroundService.cs

Lines changed: 0 additions & 247 deletions
This file was deleted.

0 commit comments

Comments
 (0)