Sorry this is not issue, just some comment. It seems that anomaly_map.patchify() can be simplified as follows
def patchify_new(features):
"""Use AvgPool3d to patchify "features"
"""
patch_size = 3
padding = (patch_size - 1) //2
return torch.nn.AvgPool3d(
kernel_size=(1, patch_size, patch_size),
stride=1,
padding=(0, padding,padding))(features.unsqueeze(1)).squeeze(1)
Of course, this function can not return the spatial information.
Please feel free to check and use it or just ignore it.
Sorry this is not issue, just some comment. It seems that anomaly_map.patchify() can be simplified as follows
Of course, this function can not return the spatial information.
Please feel free to check and use it or just ignore it.