Skip to content

How to assign each tile a class after tiling a big image and pass the tiles data directly into a trainer #1673

Answered by blaz-r
caitlin-cheng asked this question in Q&A
Discussion options

You must be logged in to vote

With the current tiler this would probably be a bit tricky. You could modify the tiler code here:

tiles = torch.zeros(
(self.num_patches_h, self.num_patches_w, batch, channels, self.tile_size_h, self.tile_size_w),
device=device,
)
# fill-in output tensor with spatial patches extracted from the image
for (tile_i, tile_j), (loc_i, loc_j) in zip(
product(range(self.num_patches_h), range(self.num_patches_w)),
product(
range(0, image_h - self.tile_size_h + 1, self.stride_h),
range(0, image_w - self.tile_size_w + 1, self.stride_w),
),
strict=True,
):

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@blaz-r
Comment options

Answer selected by caitlin-cheng
@caitlin-cheng
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants