Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions cellpose/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,9 +247,9 @@ def run_net(net, imgi, batch_size=8, augment=False, tile_overlap=0.1, bsize=224,
y = np.reshape(y, (-1, 3, ly, lx))
yfi = transforms.average_tiles(y, ysub, xsub, Lyt, Lxt)
yf[b] = yfi[:, :imgb.shape[-2], :imgb.shape[-1]]
stylei = stylea[i * ntiles:(i + 1) * ntiles].sum(axis=0)
stylei /= (stylei**2).sum()**0.5
styles[b] = stylei
# stylei = stylea[i * ntiles:(i + 1) * ntiles].sum(axis=0)
# stylei /= (stylei**2).sum()**0.5
# styles[b] = stylei
# slices from padding
yf = yf[:, :, ypad1 : Ly-ypad2, xpad1 : Lx-xpad2]
yf = yf.transpose(0,2,3,1)
Expand Down
2 changes: 2 additions & 0 deletions cellpose/vit_sam.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ def __init__(self, backbone="vit_l", ps=8, nout=3, bsize=256, rdrop=0.4,
blk.window_size = 0

self.dtype = dtype
if self.dtype != torch.float32:
self = self.to(self.dtype)

def forward(self, x):
# same progression as SAM until readout
Expand Down
Loading