forked from junsang7777/RZSR-Reference-based-Zero-Shot-Super-Resolution-with-Depth-Guided-Self-Exemplars
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
38 lines (29 loc) · 1.12 KB
/
main.py
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
30
31
32
33
34
35
36
37
38
import glob
import os
from utils import prepare_result_dir
import configs
from time import sleep
import sys
import ZSSR
import matplotlib as plt
import os.path
os.environ["CUDA_DEVICE_ORDER"]="PCI_BUS_ID"
os.environ["CUDA_VISIBLE_DEVICES"]="1"
conf = configs.Config()
res_dir = prepare_result_dir(conf)
files = [file_path for file_path in glob.glob('./set/img/*.png')]
depths = [depth_path for depth_path in glob.glob('./set/dep/*.png')]
files = sorted(files)
depths = sorted(depths)
kernels_ = [kernel_path for kernel_path in glob.glob('./set/ker/*.mat')] # if don't have kernel, annot.
kernels_ = sorted(kernels_) # if don't have kernel, annot.
for file_ind, input_file in enumerate(files):
conf.result_path = res_dir
input_depth = depths[file_ind]
kernels = kernels_[file_ind] # if don't have kernel, annot.
kernels = [kernels] # if don't have kernel, annot.
print('input file : ', input_file)
print('input depth : ', input_depth)
print('input kernel : ', kernels)
net = ZSSR.ZSSR(input_file,input_depth=input_depth,conf=conf,kernels=kernels) # if don't have kernel, 'change kerenls = None'
net.run()