'How does barracuda tensor convert an array of float into Tensor of shape (1, SIZE, SIZE, 3)
Im using Barracuda in Unity to do real-time inference on a neural network model by drawing webcam images. Currently I'm struggling to do image processing as efficiently as with Python. Output is a mess. I believe most of my tensor are upside down or not the exact values that I want to feed into model...
Does anyone know if, in the Unity barracuda framework:
Given:
float[] TransformedPixels = {1, 2, 3, 4, 5, 6, 7,8 ,9, 10, 11, 12};
return new Tensor(1, IMAGE_SIZE=2, IMAGE_SIZE=2, 3, transformedPixels);
What kind of Tensor will I receive as the numpy equivalent in Python?
1.
[[[1, 2, 3],
[4, 5, 6]],
[[7, 8, 9],
[10, 11, 12]]]
or
2.
[[[1,2],
[3,4]],
[[5,6],
[7,8]]],
[[9,10],
[11,12]]]
Type 1 is what i wish I would get because using np.reshape(TransformedPixels, (1,64,64,3)) would get me the same thing and it's more intuitive for us ML scientists. Anyway does Unity Barracuda has a way to print/debug logout a tensor with all the brackets so that we can check what values are we feeding into the model exactly?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
