Created
October 21, 2020 15:46
-
-
Save meghbhalerao/4abe0b2fb93df8738ee7626b3e283670 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import numpy as np | |
folds = [5,5] | |
exp_path = "./outputs/resunet_e1_new/" | |
avg_dice = [] | |
for holdout in os.listdir(os.path.join(exp_path)): | |
for fold in os.listdir(os.path.join(exp_path,holdout)): | |
if not ".pkl" in fold: | |
for item in os.listdir(os.path.join(exp_path,holdout,fold)): | |
if "stdout" in item: | |
f = open(os.path.join(exp_path,holdout,fold,item)) | |
f_list = [] | |
dice = [] | |
for line in f: | |
if "w.r.t" in line: | |
dice.append(line.split()[-1]) | |
avg_dice.append(dice[-1]) | |
print(len(avg_dice)) | |
new_list = [] | |
for item in avg_dice: | |
new_list.append(float(item)) | |
dce = sum(new_list)/len(new_list) | |
print(dce) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment