Skip to content

Commit 0b9a1e3

Browse files
Merge branch 'user/t-limay/StyleTransfer-gpu' into user/t-limay/StyleTransfer
2 parents f0115ed + 6749819 commit 0b9a1e3

File tree

11 files changed

+751
-280
lines changed

11 files changed

+751
-280
lines changed

Samples/FNSCandyStyleTransfer/UWP/cs/MainPage.xaml

Lines changed: 201 additions & 166 deletions
Large diffs are not rendered by default.

Samples/FNSCandyStyleTransfer/UWP/cs/MainPage.xaml.cs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -584,22 +584,22 @@ private void UIStyleList_SelectionChanged(object sender, SelectionChangedEventAr
584584
_frameAquisitionLock.Release();
585585

586586
}).ContinueWith(async (antecedent) =>
587-
{
588-
if (antecedent.IsCompletedSuccessfully && _isReadyForEval)
589587
{
590-
await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
588+
if (antecedent.IsCompletedSuccessfully && _isReadyForEval)
591589
{
592-
NotifyUser($"Ready to stylize! ", NotifyType.StatusMessage);
593-
UIImageControls.IsEnabled = true;
594-
UIModelControls.IsEnabled = true;
595-
UIToggleInferenceDevice.IsEnabled = true;
596-
if (_isrocessingImages)
590+
await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
597591
{
598-
UIButtonFilePick_Click(null, null);
599-
}
600-
});
601-
}
602-
});
592+
NotifyUser($"Ready to stylize! ", NotifyType.StatusMessage);
593+
UIImageControls.IsEnabled = true;
594+
UIModelControls.IsEnabled = true;
595+
UIToggleInferenceDevice.IsEnabled = true;
596+
if (_isrocessingImages)
597+
{
598+
UIButtonFilePick_Click(null, null);
599+
}
600+
});
601+
}
602+
});
603603
}
604604

605605
/// <summary>

Samples/StyleTransfer/AppModel.cs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,29 @@ public bool UseGPU
5959
}
6060
}
6161

62+
// Input VideoFrame when processing images
63+
private VideoFrame _inputFrame;
64+
public VideoFrame InputFrame
65+
{
66+
get { return _inputFrame; }
67+
set
68+
{
69+
_inputFrame = value;
70+
OnPropertyChanged();
71+
}
72+
}
73+
74+
// Output VideoFrame when processing images
75+
private VideoFrame _outputFrame;
76+
public VideoFrame OutputFrame
77+
{
78+
get { return _outputFrame; }
79+
set
80+
{
81+
_outputFrame = value;
82+
OnPropertyChanged();
83+
}
84+
}
6285
// MediaSource for transformed media
6386
private MediaSource _outputMediaSource;
6487
public MediaSource OutputMediaSource

0 commit comments

Comments
 (0)