Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running results #40

Open
Biyb opened this issue Jan 19, 2025 · 3 comments
Open

Running results #40

Biyb opened this issue Jan 19, 2025 · 3 comments

Comments

@Biyb
Copy link

Biyb commented Jan 19, 2025

I have two questions for the author:

First, where are the results such as mIOU and mDice calculated? In Issue #16, you also provided the code. However, due to my limited coding ability, I'm not sure which part of the existing codebase the code you provided should be inserted into.

Second, in the text.py file, what paths should be stored in the two parameters --checkpoint and --test_gt_path?

I would greatly appreciate it if you could help me out. Thank you!

@xiongxyowo
Copy link
Collaborator

Hi, in general, the calculation of Dice and IoU can be divided into the following situations:

  1. The IoU of foreground lesions/organs and the ground truth are calculated after binarizing the prediction results with a confidence of 0.5. The result is usually denoted as "IoU", which corresponds to the code in calculate evaluation metrics such as Dice, IOU, and HD #16 .
  2. Binarize the prediction results with different confidence levels, and then calculate the average under different confidence levels. The result is usually denoted as "mIoU", which corresponds to the code in eval.py.
  3. For multi-class segmentation tasks, calculate the average IoU of different classes. In this case, the result is also denoted as "mIoU", but our code does not yet support this calculation, you can modify it yourself.

同学你好,一般来说,dice与iou的计算分为如下几种情况:

  1. 将预测结果使用0.5的置信度二值化后计算前景病灶/器官与真值的iou。此时结果一般记为IoU,对应着#16中的代码
  2. 将预测结果使用不同的置信度进行二值化,然后计算不同置信度下的平均。此时结果一般记为mIoU,对应eval.py中的代码
  3. 对于多类分割任务,计算不同前景类别iou的平均。此时结果也一般记为mIoU,不过我们的SAM2-UNet代码尚未支持这种计算方式,你可以自行进行修改。

@Biyb
Copy link
Author

Biyb commented Jan 20, 2025 via email

@xiongxyowo
Copy link
Collaborator

checkpoint: pth file obtained after training,such as /your_dir/SAM2-UNet-20.pth
test_gt_path: the directory of the ground truth of testset,such as /your_dir/masks/


checkpoint: 训练完毕后得到的pth文件,例如/your_dir/SAM2-UNet-20.pth
test_gt_path: 测试集真值的文件夹目录,例如/your_dir/masks/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants