1

I have a UWP application that streams tweets and saves them to database. Now i have a Keras LSTM model that predicts the sentiments. One way of calling the model in UWP Application and display results would be through python script but since UWP does not allow any sort of interaction with any process. This is a dead end and i have looked everywhere for a solution.

Is there any way i can call my Keras model saved as .h5 file inside my UWP application directly?

Or if there is a way to bypass the Access Denied error when calling processes from UWP.

P.S Any kind help would be appreciated , I am new to these domains.

  • Is there a particular reason you chose UWP? Is this cross-platform? Otherwise, I would suggest WPF you will not have the same restrictions. – Dan Barrett Mar 19 '20 at 12:14
  • @DanBarrett Its for Windows only. I chose UWP because its UI was easy to implement and has better look overall. WPF looks old fashioned despite using Modern Themes. Lack of fluidity. My Main question is how to use the Keras model in C# – WillowShadow Mar 19 '20 at 14:43
  • 1
    Maybe ML.NET ? https://learn.microsoft.com/en-us/dotnet/machine-learning/tutorials/image-classification (its for tensorflow). Or converting to onnx and then run under ml.net.. – Alamakanambra Mar 20 '20 at 23:17

1 Answers1

0

The problem you are dealing with is that UWP applications are sandboxed. This is causing your access denied problems. If your app is intended to run the Python script only on PC. you can use the FullTrustProcessLauncher API. Note, this will prevent your application from being deployed via the app store.

https://learn.microsoft.com/en-us/uwp/api/Windows.ApplicationModel.FullTrustProcessLauncher

UWP with Desktop Extension Part 1, Stefan Wick:

https://stefanwick.com/2018/04/06/uwp-with-desktop-extension-part-1/

Relevant Stack Overflow link:

Run python script from UWP

Dan Barrett
  • 225
  • 1
  • 6