Skip to content

Commit

Permalink
threshold on gpu (#348)
Browse files Browse the repository at this point in the history
Co-authored-by: Benjamin Morris <[email protected]>
  • Loading branch information
benjijamorris and Benjamin Morris authored Mar 9, 2024
1 parent 7f08cd9 commit fc41eb4
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions cyto_dl/models/im2im/utils/instance_seg.py
Original file line number Diff line number Diff line change
Expand Up @@ -504,12 +504,11 @@ def cluster_object(self, semantic, skel, embedding):
return out

def __call__(self, image):
image = image.detach().cpu().half().numpy()
image = image.detach().half()
naive_labeling, _ = label((image[1] > self.semantic_threshold).cpu())
skel = image[0].cpu().numpy()
embedding = image[2 : 2 + self.dim].cpu().numpy()

skel = image[0]
naive_labeling, _ = label(image[1] > self.semantic_threshold)

embedding = image[2 : 2 + self.dim]
regions = enumerate(find_objects(naive_labeling), start=1)

highest_cell_idx = 0
Expand Down

0 comments on commit fc41eb4

Please sign in to comment.