Instructions to use unity/inference-engine-blaze-face with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- unity-sentis
How to use unity/inference-engine-blaze-face with unity-sentis:
string modelName = "[Your model name here].sentis"; Model model = ModelLoader.Load(Application.streamingAssetsPath + "/" + modelName); IWorker engine = WorkerFactory.CreateWorker(BackendType.GPUCompute, model); // Please see provided C# file for more details
- Notebooks
- Google Colab
- Kaggle
Upload RunBlazeFace.cs
Browse files- RunBlazeFace.cs +4 -6
RunBlazeFace.cs
CHANGED
|
@@ -283,13 +283,11 @@ public class RunBlazeFace : MonoBehaviour
|
|
| 283 |
|
| 284 |
var NM1 = _worker.PeekOutput("NMS") as TensorInt;
|
| 285 |
|
| 286 |
-
using var boxCoords2 = boxCoords.ShallowReshape(
|
| 287 |
-
|
| 288 |
-
var output = ops.GatherND(boxCoords2, NM1, 0);
|
| 289 |
|
| 290 |
-
using var regressors2 = regressors.ShallowReshape(
|
| 291 |
-
|
| 292 |
-
var markersOutput = ops.GatherND(regressors2, NM1, 0);
|
| 293 |
|
| 294 |
output.MakeReadable();
|
| 295 |
markersOutput.MakeReadable();
|
|
|
|
| 283 |
|
| 284 |
var NM1 = _worker.PeekOutput("NMS") as TensorInt;
|
| 285 |
|
| 286 |
+
using var boxCoords2 = boxCoords.ShallowReshape(boxCoords.shape.Unsqueeze(0)) as TensorFloat;
|
| 287 |
+
using var output = ops.GatherND(boxCoords2, NM1, 0);
|
|
|
|
| 288 |
|
| 289 |
+
using var regressors2 = regressors.ShallowReshape(regressors.shape.Unsqueeze(0)) as TensorFloat;
|
| 290 |
+
using var markersOutput = ops.GatherND(regressors2, NM1, 0);
|
|
|
|
| 291 |
|
| 292 |
output.MakeReadable();
|
| 293 |
markersOutput.MakeReadable();
|