concepts.vision.fm_match.diff3f.extractor_diff3f.arange_pixels#
- arange_pixels(resolution=(128, 128), batch_size=1, subsample_to=None, invert_y_axis=False, margin=0, align_corners=True, jitter=None)[source]#
Generate a grid of pixel coordinates.
- Parameters:
resolution (Tuple[int, int]) – the resolution of the grid, in (height, width).
batch_size (int) – the batch size of the output.
subsample_to (int | None) – if set, the number of subsampled points in the output.
invert_y_axis (bool) – whether to invert the y-axis.
margin (float) – the margin around the grid.
corner_aligned – whether to align the corners of the grid. If False, the value range will be generated with range. If True, the value range will be generated with linspace.
jitter (float | None) – add additional jitter to the grid values.
align_corners (bool)
- Returns:
a tensor of shape (batch_size, n_points, 2) containing the pixel coordinates.
- Return type: