Skip to content

Commit a9310a3

Browse files
committed
fix: fix post-proc bug for binary maps
1 parent ce093f7 commit a9310a3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cellseg_models_pytorch/inference/post_processor.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -370,10 +370,10 @@ def _prepare_inst_maps(
370370
prob_maps = soft_masks.binary_map
371371
else:
372372
prob_maps = soft_masks.type_map
373-
374373
prob_maps = prob_maps.squeeze(1)
375374

376-
inst_maps = list(self._to_ndarray(prob_maps, dtype="i4"))
375+
inst_dtype = "i4" if soft_masks.binary_map is None else "f4"
376+
inst_maps = list(self._to_ndarray(prob_maps, dtype=inst_dtype))
377377
aux_maps = list(self._to_ndarray(soft_masks.aux_map, dtype="f4"))
378378
type_maps = list(self._to_ndarray(soft_masks.type_map, dtype="i4"))
379379

0 commit comments

Comments
 (0)