onnxruntime/csharp/tools/MauiModelTester/MainPage.xaml
Scott McKay ad90352a68
Add MAUI test app that can be used to test model loading and performance (#16658)
### Description
<!-- Describe your changes. -->
MAUI test app with tooling to add model and generated or provided input
test data.

The app will load the model and validate the output. It can also run a
specified number of iterations to provide basic performance information.

<img width="401" alt="image"
src="https://github.com/microsoft/onnxruntime/assets/979079/daf3af13-fb22-4cbb-9159-486b483a7485">

### Motivation and Context
<!-- - Why is this change required? What problem does it solve?
- If it fixes an open issue, please link to the issue here. -->
Primarily to make it easier to test an arbitrary model on iOS. A MAUI
app allows testing on all platforms.

---------

Co-authored-by: Edward Chen <18449977+edgchen1@users.noreply.github.com>
2023-07-18 08:21:18 +10:00

65 lines
2.8 KiB
XML

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="MauiModelTester.MainPage" BackgroundColor="Black">
<ScrollView x:Name="MainScrollView" Margin="10">
<Grid RowSpacing="10" ColumnSpacing="0">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Label Grid.Row="0"
Text="ONNX Runtime Mobile Model Tester"
FontSize="Header"
TextColor="DeepSkyBlue"
HorizontalOptions="Center" />
<Grid Grid.Row="1" ColumnSpacing="10">
<!-- Run params. EP and iterations currently-->
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Label Grid.Row="0" Grid.Column="0" Text="Execution Provider"
TextColor="White" VerticalOptions="Center"/>
<Picker Grid.Row="0" Grid.Column="1" x:Name="ExecutionProviderOptions"
TextColor="White" Margin="5,5,5,5"/>
<Label Grid.Row="1" Grid.Column="0" Text="Iterations" TextColor="White" VerticalOptions="Center"/>
<Entry Grid.Row="1" Grid.Column="1" x:Name="Iterations" Text="10" TextColor="White"/>
</Grid>
<Button Grid.Row="2"
x:Name="RunButton" Text="Run"
FontSize="Large"
TextColor="White"
BackgroundColor="DeepSkyBlue"
SemanticProperties.Hint="Runs the model the requested number of times."
Clicked="OnRunClicked"
HorizontalOptions="Center" />
<Label Grid.Row="3" Text="Performance test results" TextColor="White" FontAttributes="Bold" />
<ActivityIndicator Grid.Row="4" x:Name="BusyIndicator" IsRunning="False" Color="Orange" />
<ScrollView Grid.Row="4" x:Name="TestResultsView" Margin="10">
<StackLayout x:Name="TestResults">
<Label Text="Results will be displayed after the model is run." TextColor="GhostWhite" />
</StackLayout>
</ScrollView>
</Grid>
</ScrollView>
</ContentPage>