PB Unity commited on
Commit
0a118d9
·
verified ·
1 Parent(s): 2e79ccf

Upload RunBlazePalm.cs

Browse files
Files changed (1) hide show
  1. RunBlazePalm.cs +12 -13
RunBlazePalm.cs CHANGED
@@ -207,24 +207,23 @@ public class RunBlazePalm : MonoBehaviour
207
  //We need to add extra layers to the model in order to aggregate the box predicions:
208
  size = model.inputs[0].shape.ToTensorShape()[2]; // Input tensor width (192)
209
 
210
- model.AddConstant(new Lays.Constant("zero", new int[] { 0 }));
211
- model.AddConstant(new Lays.Constant("two", new int[] { 2 }));
212
- model.AddConstant(new Lays.Constant("four", new int[] { 4 }));
213
-
214
- model.AddLayer(new Lays.Slice("boxes", regressorsOutput, "zero", "four", "two"));
215
-
216
- model.AddLayer(new Lays.Transpose("scores", classificatorsOutput, new int[] { 0, 2, 1 }));
217
-
218
  model.AddConstant(new Lays.Constant("offsets",
219
- new TensorFloat(new TensorShape(1, offsets.Length/4, 4), offsets)
220
  ));
 
 
 
 
221
  model.AddLayer(new Lays.Add("boxCoords", "boxes", "offsets"));
222
  model.AddOutput("boxCoords");
223
 
224
- model.AddConstant(new Lays.Constant("maxOutputBoxes", new int[] { maxOutputBoxes }));
225
- model.AddConstant(new Lays.Constant("iouThreshold", new float[] { iouThreshold }));
226
- model.AddConstant(new Lays.Constant("scoreThreshold", new float[] { scoreThreshold }));
227
-
228
  model.AddLayer(new Lays.NonMaxSuppression("NMS", "boxCoords", "scores",
229
  "maxOutputBoxes", "iouThreshold", "scoreThreshold",
230
  centerPointBox: Lays.CenterPointBox.Center
 
207
  //We need to add extra layers to the model in order to aggregate the box predicions:
208
  size = model.inputs[0].shape.ToTensorShape()[2]; // Input tensor width (192)
209
 
210
+ //set constants
211
+ model.AddConstant(new Lays.Constant("0", new int[] { 0 }));
212
+ model.AddConstant(new Lays.Constant("2", new int[] { 2 }));
213
+ model.AddConstant(new Lays.Constant("4", new int[] { 4 }));
214
+ model.AddConstant(new Lays.Constant("maxOutputBoxes", new int[] { maxOutputBoxes }));
215
+ model.AddConstant(new Lays.Constant("iouThreshold", new float[] { iouThreshold }));
216
+ model.AddConstant(new Lays.Constant("scoreThreshold", new float[] { scoreThreshold }));
 
217
  model.AddConstant(new Lays.Constant("offsets",
218
+ new TensorFloat(new TensorShape(1, offsets.Length / 4, 4), offsets)
219
  ));
220
+
221
+ //add layers
222
+ model.AddLayer(new Lays.Slice("boxes", regressorsOutput, "0", "4", "2"));
223
+ model.AddLayer(new Lays.Transpose("scores", classificatorsOutput, new int[] { 0, 2, 1 }));
224
  model.AddLayer(new Lays.Add("boxCoords", "boxes", "offsets"));
225
  model.AddOutput("boxCoords");
226
 
 
 
 
 
227
  model.AddLayer(new Lays.NonMaxSuppression("NMS", "boxCoords", "scores",
228
  "maxOutputBoxes", "iouThreshold", "scoreThreshold",
229
  centerPointBox: Lays.CenterPointBox.Center