We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent badf7b4 commit 0fa3ae5Copy full SHA for 0fa3ae5
micro_sam/object_classification.py
@@ -210,7 +210,10 @@ def project_prediction_to_segmentation(
210
"""
211
assert len(object_prediction) == len(seg_ids)
212
prediction = {seg_id: class_pred for seg_id, class_pred in zip(seg_ids, object_prediction)}
213
- prediction[0] = 0
+ # Find missing segmentation ids. This will include the background id, but may include other ids of small objects.
214
+ # Such objects may get removed in the resizing operations.
215
+ missing_ids = np.setdiff1d(np.unique(segmentation), seg_ids)
216
+ prediction.update({missing_id: 0 for missing_id in missing_ids})
217
return takeDict(prediction, segmentation)
218
219
0 commit comments