image_tensors_to_tbl: Images Tensor to Coordinate data.frame

Description Usage Arguments Value Examples

View source: R/utils.R

Description

Converts a batch of (image) torch tensors (B x C x H x W) into a data.frame with xy coordinates along with channels (x, y, c1, ..., cn). Useful along with ggplot2 plotting.

Usage

1
image_tensors_to_tbl(image_tensors)

Arguments

image_tensors

tensor with dimension (B x C x H x W).

Value

data.frame with B*H*W rows and 3 + C columns.

Examples

1
2
imgs <- torch::torch_tensor(1:prod(2*3*3*4))$reshape(c(2,3,3,4))
image_tensors_to_tbl(imgs)

Athospd/mestrado documentation built on Jan. 2, 2021, 3:59 a.m.