-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathtemporal_Consistency.py
93 lines (85 loc) · 3.59 KB
/
temporal_Consistency.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
import os
import cv2 as cv
import numpy as np
import scipy.misc
w_point = 600 # Choose weight-coordinate to be transferred to profile
img_height = 720
# #----------------------------------------------------------------------------
# img_root = '/media/xbm/data/xbm/BasicSR/BasicSR_wave/experiments/baseline/Large/DVD/IMG_0030'
# #----------------------------------------------------------------------------
# sequence = sorted(os.listdir(img_root))
# p_length = 21
# profile = np.zeros(shape = (p_length, img_height, 3))
# print("Temporal Profile Shape:", profile.shape)
# print("No. of frames:", p_length)
# #----------------------------------------------------------------------------
# i = 0
# for image in sequence:
# if i >= 70 and i <= 90:
# frame = cv.imread(os.path.join(img_root, image))
# line = frame[:,w_point,:]
# profile[i-70,:,:] = line
# i += 1
# #----------------------------------------------------------------------------
# cv.imwrite('temporalProfile_ours.png', profile)
# print("Profile saved to disk")
#----------------------------------------------------------------------------
img_root = '/media/xbm/data/xbm/cvpr2023/DVD/EDVR/IMG_0030'
#----------------------------------------------------------------------------
sequence = sorted(os.listdir(img_root))
p_length = 21
profile = np.zeros(shape = (p_length, img_height, 3))
print("Temporal Profile Shape:", profile.shape)
print("No. of frames:", p_length)
#----------------------------------------------------------------------------
i = 0
for image in sequence:
if i >= 70 and i <= 90:
frame = cv.imread(os.path.join(img_root, image))
line = frame[:,w_point,:]
profile[i-70,:,:] = line
i += 1
#----------------------------------------------------------------------------
cv.imwrite('temporalProfile_edvr.png', profile)
print("Profile saved to disk")
# #----------------------------------------------------------------------------
# img_root = '/media/xbm/data/VideoDeblur_Dataset/DVD/DVD/test/blur/IMG_0030'
# #----------------------------------------------------------------------------
# sequence = sorted(os.listdir(img_root))
# p_length = 21
# profile = np.zeros(shape = (p_length, img_height, 3))
# print("Temporal Profile Shape:", profile.shape)
# print("No. of frames:", p_length)
# #----------------------------------------------------------------------------
# i = 0
# for image in sequence:
# if i >= 70 and i <= 90:
# frame = cv.imread(os.path.join(img_root, image))
# line = frame[:,w_point,:]
# profile[i-70,:,:] = line
# i += 1
# #----------------------------------------------------------------------------
# cv.imwrite('temporalProfile_blur.png', profile)
# print("Profile saved to disk")
#
#
#
# #----------------------------------------------------------------------------
# img_root = '/media/xbm/data/VideoDeblur_Dataset/DVD/DVD/test/gt/IMG_0030'
# #----------------------------------------------------------------------------
# sequence = sorted(os.listdir(img_root))
# p_length = 21
# profile = np.zeros(shape = (p_length, img_height, 3))
# print("Temporal Profile Shape:", profile.shape)
# print("No. of frames:", p_length)
# #----------------------------------------------------------------------------
# i = 0
# for image in sequence:
# if i >= 70 and i <= 90:
# frame = cv.imread(os.path.join(img_root, image))
# line = frame[:,w_point,:]
# profile[i-70,:,:] = line
# i += 1
# #----------------------------------------------------------------------------
# cv.imwrite('temporalProfile_gt.png', profile)
# print("Profile saved to disk")