Exemple #1
0
        private Tensor ReadTensorFromFile(string filePath)
        {
            var texture = ImageUtil.TextureFromFile(filePath);

            return(ImageUtil.TensorFromTexture(texture, this.ImageDims));
        }
Exemple #2
0
        private Tensor ReadTensorFromBytes(byte[] image)
        {
            var texture = ImageUtil.TextureFromBytes(image);

            return(ImageUtil.TensorFromTexture(texture, this.ImageDims));
        }
Exemple #3
0
 public IEnumerator ExecuteAsync(Texture2D texture)
 {
     this.Texture = texture;
     this.Tensor  = ImageUtil.TensorFromTexture(texture, Model.ImageDims);
     return(this.Worker.ExecuteAsync(this.Tensor));
 }
Exemple #4
0
 public void Execute(Texture2D texture)
 {
     this.Texture = texture;
     this.Tensor  = ImageUtil.TensorFromTexture(texture, Model.ImageDims);
     this.Worker.Execute(this.Tensor);
 }
Exemple #5
0
        private TFTensor ReadTensorFromFile(string filePath)
        {
            var bmp = ImageUtil.BitmapFromFile(filePath);

            return(ImageUtil.TensorFromBitmap(bmp, this.ImageDims));
        }
Exemple #6
0
        private TFTensor ReadTensorFromBytes(byte[] image)
        {
            var bmp = ImageUtil.BitmapFromBytes(image);

            return(ImageUtil.TensorFromBitmap(bmp, this.ImageDims));
        }