vigsivan / RWCNet

Official implementation of Recurrence with Correlation Network for Medical Image Registration
MIT License
8 stars 4 forks source link

How to calculate avg value of the metrics #4

Closed animesh-007 closed 1 year ago

animesh-007 commented 1 year ago

I have tried to follow the readme available at train_oasis and ran the eval.py. But it doesn't give the avg values of the metrics scores. @vigsivan, Can you let me know how you calculate the avg values of the metric scores as you have reported in the readme?

I have tried to use L2R official repo too as mentioned in #2 but I am getting avg value of 0.72.

vigsivan commented 1 year ago

Hi aimesh, Here's a quick script to get the average:

import json
import numpy as np
with open("metrics.json", 'r') as f:
    metrics = json.load(f)

dice_scores = [1-v["metrics"]["dice"] for v in  metrics.values()]
print(np.mean(dice_scores)) # 0.8048

I'll modify the evaluation script to produce an average probably later this week. Closing, but feel free to follow up.

vigsivan commented 1 year ago

Re-opening, so that I actually remember to get to this :)

animesh-007 commented 1 year ago

Re-opening, so that I actually remember to get to this :)

Will it be helpful to you if I raise a PR implementing this?😇

vigsivan commented 1 year ago

Thanks for offering, but I'll address it.

vigsivan commented 1 year ago

Closing, as I think I prefer having a separate script to analyze the results.