Skip to content
Open
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: 5 additions & 1 deletion cellSAM/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
import os
from pathlib import Path
import yaml
import pkgutil
import importlib.resources as resources


import importlib

from skimage.morphology import (
Expand Down Expand Up @@ -163,7 +167,7 @@ def segment_cellular_image(
model, img = model.to(device), img.to(device)

preds = model.predict(img, boxes_per_heatmap=bounding_boxes)
if preds is None:
if preds is None or preds[0] is None:
warn("No cells detected in the image.")
return np.zeros(img.shape[1:], dtype=np.int32), None, None

Expand Down