tfmri.image.extract_glimpses

extract_glimpses(images, sizes, offsets)[source]

Extract glimpses (patches) from a tensor at the given offsets.

Parameters
  • images – A Tensor. Must have shape [batch_size, ..., channels], where ... are the N spatial dimensions.

  • sizes – A list of ints of length N.

  • offsets – A Tensor of shape [M, N] containing indices into the upper-left corners of the patches to be extracted.

Returns

A Tensor with shape [batch_size, M, prod(sizes) * channels], where the last dimension are the flattened glimpses.