-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
29 lines (20 loc) · 1.1 KB
/
Copy pathmain.py
File metadata and controls
29 lines (20 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import csv
from utils.utils import *
from algorithm.SRSC import SRSC
ksfull, ksdata, mask, save_path, sensitivity, Ker, Ker_Tra, Lip_C = None, None, None, None, None, None, None, None
sensitivityLi, t_sense, t_kernel, t_lip = None, None, None, None
os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID"
os.environ["CUDA_VISIBLE_DEVICES"] = "0"
def main(filename, maskfilename):
indexs = []
save_root = load_data_and_mask(filename, maskfilename)
index.append(SRSC(max_iter=50, SC=True, DP=True).process())
torch.cuda.empty_cache()
df = pd.DataFrame(indexs, columns=["Model Name", "PSNR", "SSIM", "HaarPSI", "DISTS", "time"])
df.to_csv(f'{save_root}/results_{filename}_{maskfilename}.csv', index=False)
df["PSNR"], df["SSIM"], df["HaarPSI"], df["DISTS"], df["time"] = df["PSNR"].round(4), df["SSIM"].round(4), df["HaarPSI"].round(4), df["DISTS"].round(4), df["time"].round(4)
print(df.to_string(index=False))
if __name__ == "__main__":
filename = '05_t2_tse_tra_512_s33_3mm_29'
maskfilename = 'mask_random_512_512_SR_30_AC_27'
main(filename, maskfilename)