Open DongFangShenQiG opened 1 year ago
I recommend to manually check if the model output the correct prediction, e.g., visualization. If there is no problem, maybe you should check if there is any modification-caused BUG.
same problem, have you solved it?
I found the same error,IndexError: list index out of range
.
After checking, I found that in the mask.npy
generated by the infer_pannuke.py
process, the same nucleus can have two cell nucleus types. This resulted in one of the nuclei being removed by eval_pannuke.py
, resulting in discontinuous labels. I added remap_label to /PanNuKe-metrics/run.py
to make it run normally, but I only got an mPQ of 0.4891 and a bPQ of 0.6752, which is quite different from the paper.
for i in trange(true.shape[0]):
pq = []
pred_bin = binarize(pred[i,:,:,:5])
true_bin = binarize(true[i,:,:,:5])
if len(np.unique(true_bin)) == 1:
pq_bin = np.nan # if ground truth is empty for that class, skip from calculation
else:
pred_bin = remap_label(pred_bin) # newly added
[_, _, pq_bin], _ = get_fast_pq(true_bin, pred_bin)
Obviously my modification did not solve the fundamental problem. I think infer_pannuke.py
should be modified to prevent a cell from being predicted as multiple types.
@Kaiseem Have you encountered this BUG before? need help
Traceback (most recent call last): File "/usr/local/data/guopeng/PointNu-Net-main/eval_pannuke_gai.py", line 156, in
main()
File "/usr/local/data/guopeng/PointNu-Net-main/eval_pannukegai.py", line 82, in main
[, _, pqbin], = get_fast_pq(true_bin, pred_bin) # compute PQ
File "/usr/local/data/guopeng/PointNu-Net-main/utils_eval.py", line 63, in get_fast_pq
p_mask = pred_masks[pred_id]
IndexError: list index out of range