Commit a1fc86c3 authored by Andrei-Claudiu Roibu's avatar Andrei-Claudiu Roibu 🖥
Browse files

added the evaluation function

parent 550dc688
......@@ -8,6 +8,8 @@ The network can be ran in one of these modes:
- evaluate path
- evaluate whole
TODO: Might be worth adding some information on uncertaintiy estimation, later down the line
Usage
-------------
......@@ -277,19 +279,90 @@ def evaluate_score(data_parameters, training_parameters, network_parameters, mis
logWriter.close()
def evaluate_mapping():
"""
Function which maps an entire volume
"""
def evaluate_mapping(mapping_evaluation_parameters):
"""Mapping Evaluator
# Need to load all the relevant parameters
This function passes through the network an input and generates the rsfMRI outputs.
This function allows the user to either use one or two or three paths.
# Assuming I perform the split on multiple axes, I need to load the different paths
The convention for the different model paths is as follows:
- model1: coronal
- model2: axial
- model3: saggital
# After loading the different paths, evaluate:
# 1) either on one path
# 2) on two+ paths
pass
However, this convention can be changed either bellow or the settings file.
Args:
mapping_evaluation_parameters (dict): Dictionary of parameters useful during mapping evaluation.
mapping_evaluation_parameters = {
'trained_model1_path': 'path/to/model1'
'trained_model2_path': 'path/to/model2'
'trained_model3_path': 'path/to/model3'
'data_directory': 'path/to/data'
'data_list': 'path/to/datalist.txt/
'orientation1': 'coronal'
'orientation2': 'axial'
'orientation3': 'sagittal'
'prediction_output_path': 'directory-of-saved-predictions'
'batch_size': 2
'device': 0
'exit_on_error': True
'number_of_paths': 3
}
Returns:
None
Raises:
None
"""
trained_model1_path = mapping_evaluation_parameters['trained_model1_path']
trained_model2_path = mapping_evaluation_parameters['trained_model2_path']
trained_model3_path = mapping_evaluation_parameters['trained_model3_path']
data_directory = mapping_evaluation_parameters['data_directory']
data_list = mapping_evaluation_parameters['data_list']
orientation1 = mapping_evaluation_parameters['orientation1']
orientation2 = mapping_evaluation_parameters['orientation2']
orientation3 =mapping_evaluation_parameters['orientation3']
prediction_output_path = mapping_evaluation_parameters['prediction_output_path']
batch_size = mapping_evaluation_parameters['batch_size']
device= mapping_evaluation_parameters['device']
exit_on_error = mapping_evaluation_parameters['exit_on_error']
if mapping_evaluation_parameters['number_of_paths'] == 1:
evaluations.evaluate_single_path(trained_model_path= trained_model1_path,
data_directory,
data_list,
orientation= orientation1,
prediction_output_path,
batch_size,
device= device,
exit_on_error= exit_on_error):
elif mapping_evaluation_parameters['number_of_paths'] == 2:
evaluations.evaluate_two_paths(trained_model1_path,
trained_model2_path,
data_directory,
data_list,
orientation1,
orientation2,
prediction_output_path,
batch_size,
device= device,
exit_on_error= exit_on_error)
elif mapping_evaluation_parameters['number_of_paths'] == 3:
evaluations.evaluate_all_paths(trained_model1_path,
trained_model2_path,
trained_model3_path,
data_directory,
data_list,
orientation1,
orientation2,
orientation3,
prediction_output_path,
batch_size,
device= device
exit_on_error= exit_on_error)
def delete_files():
""" Function which clears contents (like experiments or logs)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment