modify the 1:1 contrast code

This commit is contained in:
王庆刚
2024-09-11 17:37:32 +08:00
parent 7309dec166
commit 09e92d63b3
33 changed files with 3559 additions and 313 deletions

View File

@ -118,7 +118,7 @@ def inference_image(images: list, transform, net, device, bs=16, embedding_size=
patches = torch.stack(patches, dim=0)
batch_patches.append(patches)
features = np.zeros((0, embedding_size))
features = np.zeros((0, embedding_size), dtype=np.float32)
for patches in batch_patches:
pred = net(patches)
pred[torch.isinf(pred)] = 1.0