Giter Site home page Giter Site logo

onnxruntime-unrealengine's Introduction

image

This code sample is to show you how to use the new Neural Network Inference (NNI) Plugin in Unreal Engine 5 which implements ONNX Runtime to allow you to add Machine Learning (ML) Models in your projects. ONNX Runtime is a library to optimize and accelerate machine learning inferencing.

image

We are using open source models from the ONNX model zoo to apply a style transform to the scene during game play. Check out the before and after pictures below to see how one of the models is able to stylize the scene.

Before: image

After: image

Statement of Purpose

This repository aims to grow the understanding of using ML models through the NNI Plugin in Unreal Engine 5 by providing an example of implementation and references to support the Microsoft Build conference in 2022. It is not intended to be a released product. Therefore, this repository is not for discussing ONNX Runtime, the NNI plugin or requesting new features.

Prerequisites

How to run this project

Options 1: Run with Epic Games Launcher

  • Open the Epic Game Launcher and launch Unreal 5

image

  • Browse to the location that you cloned the project.
  • Select the FPStyleTransfer.uproject file and click open. This will load the same project.

image

NOTE: If you receieve the below message click Fix Now and it will recompile the project.

image

  • Once the project is loaded click play to see the project work!

image

image

Option 2: Open and run in Visual Studio.

  • Browse to the location that you cloned the project.
  • Open the FPStyleTransfer.sln file.

image

  • Hit F5 to run the project.
  • Click play to see the project work!

image

image

How to select a different model

There are 5 differnet models included from the ONNX Model Zoo. You can find them under the Content > Models folder in the UE Content Browser. To add your own models, drag and drop them into the Models folder in the Content Browser.

image

To select one of the other preloaded models or one that you added yourself.

  • Select the StyleTransferConfig blueprint from the Outliner
  • In the Details under the Default section find the Neural Network property and select the dropdown. You will see a list of models available.

image

  • Select the model you would like to apply from the dropdown, and then click play to see the new style applied.

image

Resources

Grab open source models to add to your project:

Connect with ONNX Runtime (ORT) on Social!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.