forked from Jamy-L/Handheld-Multi-Frame-Super-Resolution
-
Notifications
You must be signed in to change notification settings - Fork 0
/
example.py
51 lines (36 loc) · 1.17 KB
/
example.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
39
40
41
42
43
44
45
46
47
48
49
50
# -*- coding: utf-8 -*-
"""
Created on Thu Jan 5 18:10:18 2023
This is an example script showing how to call the pipeline and specify
the parameters.
Make sure that the example bursts have been downloaded from the release version!!
@author: jamyl
"""
import os
import matplotlib.pyplot as plt
from handheld_super_resolution import process
from skimage import img_as_ubyte
# Specify verbose options
options = {'verbose' : 1}
# Specify the scale as follows. All the parameters are automatically
# choosen but can be overwritten : check params.py to see the entire list
# of configurable parameters.
params={
"scale":2,
"merging" : {
'kernel': 'handheld'},
'post processing' : {'on':True}
# Post processing is enabled by default,
# but it can be turned off here
}
# calling the pipeline
burst_path = './test_burst/Samsung/'
output_img = process(burst_path, options, params)
# saving the result
os.makedirs('./results', exist_ok=True)
plt.imsave('./results/output_img.png', img_as_ubyte(output_img))
# plotting the result
plt.figure("output")
plt.imshow(output_img, interpolation = 'none')
plt.xticks([])
plt.yticks([])