Paul Bird
commited on
Commit
·
a92657c
1
Parent(s):
c0392be
Upload RunMobileNet.cs
Browse files- RunMobileNet.cs +14 -3
RunMobileNet.cs
CHANGED
|
@@ -2,6 +2,20 @@
|
|
| 2 |
using Unity.Sentis;
|
| 3 |
using UnityEngine;
|
| 4 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
public class RunMobileNet : MonoBehaviour
|
| 6 |
{
|
| 7 |
const string modelName = "mobilenet_v2.sentis";
|
|
@@ -30,9 +44,6 @@ public class RunMobileNet : MonoBehaviour
|
|
| 30 |
allocator = new TensorCachingAllocator();
|
| 31 |
ops = WorkerFactory.CreateOps(backend, allocator);
|
| 32 |
|
| 33 |
-
Application.targetFrameRate = 60;
|
| 34 |
-
Screen.orientation = ScreenOrientation.LandscapeLeft;
|
| 35 |
-
|
| 36 |
//Parse neural net labels
|
| 37 |
labels = labelsAsset.text.Split('\n');
|
| 38 |
|
|
|
|
| 2 |
using Unity.Sentis;
|
| 3 |
using UnityEngine;
|
| 4 |
|
| 5 |
+
/*
|
| 6 |
+
* MovileNetV2 Inference Script
|
| 7 |
+
* ============================
|
| 8 |
+
*
|
| 9 |
+
* Place this script on the Main Camera
|
| 10 |
+
*
|
| 11 |
+
* Drag an image to the inputImage field
|
| 12 |
+
*
|
| 13 |
+
* When run the prediction of what the image is will output to the console window.
|
| 14 |
+
* You can modify the script to make it do something more interesting.
|
| 15 |
+
*
|
| 16 |
+
*/
|
| 17 |
+
|
| 18 |
+
|
| 19 |
public class RunMobileNet : MonoBehaviour
|
| 20 |
{
|
| 21 |
const string modelName = "mobilenet_v2.sentis";
|
|
|
|
| 44 |
allocator = new TensorCachingAllocator();
|
| 45 |
ops = WorkerFactory.CreateOps(backend, allocator);
|
| 46 |
|
|
|
|
|
|
|
|
|
|
| 47 |
//Parse neural net labels
|
| 48 |
labels = labelsAsset.text.Split('\n');
|
| 49 |
|