diff --git a/utils/model_training.py b/utils/model_training.py index 4119722..04b64ba 100644 --- a/utils/model_training.py +++ b/utils/model_training.py @@ -379,16 +379,16 @@ def run_prediction_on_unseen(self, test_main, data_loader, name): if test_main.params.threshold > 0: print('I am using threshold value as : {}'.format(test_main.params.threshold)) - To_write = [i + '------------------' + j + '\n' for i, j in zip(im_names[0], output_label)] + To_write = [i + '------------------ ' + j + '\n' for i, j in zip(im_names[0], output_label)] np.savetxt(test_main.params.test_outpath + '/Single_model_Plankiformer_predictions.txt', To_write, fmt='%s') - To_write = [i + '------------------' + j + '\n' for i, j in zip(im_names[0], output_corrected_label)] + To_write = [i + '------------------ ' + j + '\n' for i, j in zip(im_names[0], output_corrected_label)] np.savetxt(test_main.params.test_outpath + '/Single_model_Plankiformer_predictions_thresholded.txt', To_write, fmt='%s') else: print('I am using default value as threshold i.e. 0') - To_write = [i + '------------------' + j + '\n' for i, j in zip(im_names[0], output_label)] + To_write = [i + '------------------ ' + j + '\n' for i, j in zip(im_names[0], output_label)] np.savetxt(test_main.params.test_outpath + '/Single_model_Plankiformer_predictions.txt', To_write, fmt='%s') @@ -453,16 +453,16 @@ def run_ensemble_prediction_on_unseen(self, test_main, data_loader, name): if test_main.params.threshold > 0: print('I am using threshold value as : {}'.format(test_main.params.threshold)) - To_write = [i + '------------------' + j + '\n' for i, j in zip(im_names[0], Ens_DEIT_label)] + To_write = [i + '------------------ ' + j + '\n' for i, j in zip(im_names[0], Ens_DEIT_label)] np.savetxt(test_main.params.test_outpath + '/Ensemble_models_Plankiformer_predictions_' + name2 + name + '.txt', To_write, fmt='%s') - To_write = [i + '------------------' + j + '\n' for i, j in zip(im_names[0], Ens_DEIT_corrected_label)] + To_write = [i + '------------------ ' + j + '\n' for i, j in zip(im_names[0], Ens_DEIT_corrected_label)] np.savetxt(test_main.params.test_outpath + '/Ensemble_models_Plankiformer_predictions_' + name2 + name + '_thresholded.txt', To_write, fmt='%s') else: print('I am using default value as threshold i.e. 0') - To_write = [i + '------------------' + j + '\n' for i, j in zip(im_names[0], Ens_DEIT_label)] + To_write = [i + '------------------ ' + j + '\n' for i, j in zip(im_names[0], Ens_DEIT_label)] np.savetxt(test_main.params.test_outpath + '/Ensemble_models_Plankiformer_predictions_' + name2 + name + '.txt', To_write, fmt='%s') @@ -520,17 +520,17 @@ def run_prediction_on_unseen_with_y(self, test_main, data_loader, name): if test_main.params.threshold > 0: print('I am using threshold value as : {}'.format(test_main.params.threshold)) - To_write = [i + '------------------' + j + '\n' for i, j in zip(im_names[0], output_label)] + To_write = [i + '------------------ ' + j + '\n' for i, j in zip(im_names[0], output_label)] np.savetxt(test_main.params.test_outpath + '/Single_model_Plankiformer_predictions.txt', To_write, fmt='%s') - To_write = [i + '------------------' + j + '\n' for i, j in zip(im_names[0], output_corrected_label)] + To_write = [i + '------------------ ' + j + '\n' for i, j in zip(im_names[0], output_corrected_label)] np.savetxt(test_main.params.test_outpath + '/Single_model_Plankiformer_predictions_thresholded.txt', To_write, fmt='%s') else: print('I am using default value as threshold i.e. 0') - To_write = [i + '------------------' + j + '\n' for i, j in zip(im_names[0], output_label)] + To_write = [i + '------------------ ' + j + '\n' for i, j in zip(im_names[0], output_label)] np.savetxt(test_main.params.test_outpath + '/Single_model_Plankiformer_predictions.txt', To_write, fmt='%s') @@ -618,7 +618,7 @@ def run_ensemble_prediction_on_unseen_with_y(self, test_main, data_loader, name) print('I am using threshold value as : {}'.format(test_main.params.threshold)) ## Original - To_write = [i + '------------------' + j + '\n' for i, j in zip(im_names[0], Ens_DEIT_label)] + To_write = [i + '------------------ ' + j + '\n' for i, j in zip(im_names[0], Ens_DEIT_label)] np.savetxt(test_main.params.test_outpath + '/Ensemble_models_predictions_' + name2 + name + '.txt', To_write, fmt='%s') @@ -645,7 +645,7 @@ def run_ensemble_prediction_on_unseen_with_y(self, test_main, data_loader, name) ## Thresholded - To_write = [i + '------------------' + j + '\n' for i, j in zip(im_names[0], Ens_DEIT_corrected_label)] + To_write = [i + '------------------ ' + j + '\n' for i, j in zip(im_names[0], Ens_DEIT_corrected_label)] np.savetxt(test_main.params.test_outpath + '/Ensemble_models_predictions_' + name2 + name + '_thresholded_' + str(test_main.params.threshold) + '.txt', To_write, fmt='%s') @@ -675,7 +675,7 @@ def run_ensemble_prediction_on_unseen_with_y(self, test_main, data_loader, name) else: print('I am using default value as threshold i.e. 0') - To_write = [i + '------------------' + j + '\n' for i, j in zip(im_names[0], Ens_DEIT_label)] + To_write = [i + '------------------ ' + j + '\n' for i, j in zip(im_names[0], Ens_DEIT_label)] np.savetxt(test_main.params.test_outpath + '/Ensemble_models_predictions_' + name2 + name + '.txt', To_write, fmt='%s')