Global Journal of Computer Science and Technology, D: Neural & Artificial Intelligence, Volume 22 Issue 1
Global Journal of Computer Science and Technology Volume XXII Issue I Version I 43 ( )D Year 2022 © 2022 Global Journals Neural Network Design using a Virtual Reality Platform b) Environment • Add the onnx file to the project. It behaves like a normal resource; • Load the model from the asset; • Create the inference engine (the worker).; • Run the model and get the results. ONNX, which stands for Open Neural Network Exchange, is an open standard that allows you to transfer machine learning models from different frameworks to ONNX. This interoperability enables you to move between various machine learning frameworks quickly. In addition, ONNX supports all popular machine learning frameworks, including Keras, TensorFlow, PyTorch, and XGBoost. ONNX allows you to have a standard graphical representation for various frameworks. The ONNX graph represents the model through different computational nodes and can be visualized using appropriate representation tools. # network net = # convert model to ONNX onnx_model = keras2onnx.convert_keras(net, # keras model name="example", # the converted ONNX model internal name target_opset=9, # the ONNX version to export the model to channel_first_ inputs=None) onnx.save_model(onnx_model, "example.onnx") The network model in ONNX format is imported into Unity as a temp file (Fig.4), whose structure will appear in the following graph (Fig.5). Fig. 4 To perform the conversion, we used a script. An extract of which is represented by the following code: Within Unity, we used the Barracuda package developed by Unity Labs to develop our application. It is a cross-platform neural network inference engine. Pre- trained neural networks can be imported and run in Unity. In addition, it supports neural networks trained with PyTorch, TensorFlow, Keras, and Caffe. We executed the following steps: To transfer the network, it is necessary to transform its format, as Barracuda is based on the open-source data exchange format ONNX.
RkJQdWJsaXNoZXIy NTg4NDg=