169 |
Abstract
170 |
171 |
172 |
173 |
The paper presents a novel method, Zero-Reference Deep Curve Estimation (Zero-DCE) , which formulates light enhancement as a task of image-specific curve estimation with a deep network. Our method trains a lightweight deep network, DCE-Net, to estimate pixel-wise and high-order curves for dynamic range adjustment of a given image. The curve estimation is specially designed, considering pixel value range, monotonicity, and differentiability. Zero-DCE is appealing in its relaxed assumption on reference images, i.e., it does not require any paired or unpaired data during training. This is achieved through a set of carefully formulated non-reference loss functions, which implicitly measure the enhancement quality and drive the learning of the network. Our method is efficient as image enhancement can be achieved by an intuitive and simple nonlinear curve mapping. Despite its simplicity, we show that it generalizes well to diverse lighting conditions. Extensive experiments on various benchmarks demonstrate the advantages of our method over state-of-the-art methods qualitatively and quantitatively. Furthermore, the potential benefits of our Zero-DCE to face detection in the dark are discussed.
174 |
175 |
176 |
177 |
178 |
179 |
180 | Pipeline
181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
193 | The pipeline of our method . (a) The framework of Zero-DCE. A DCE-Net is devised to estimate a set of best-fitting Light-Enhancement curves (LE-curves: LE(I(x);α)=I(x)+αI(x)(1-I(x))) to iteratively enhance a given input image. (b, c) LE-curves with different adjustment parameters α and numbers of iteration n . In (c), α1 , α2 , and α3 are equal to -1 while n is equal to 4. In each subfigure, the horizontal axis represents the input pixel values while the vertical axis represents the output pixel values.
194 |
195 |
196 |
197 |
198 |
Highlights
199 |
200 | We propose the first low-light enhancement network that is independent of paired and unpaired training data , thus avoiding the risk of overfitting. As a result, our method generalizes well to various lighting conditions.
201 | We design a simple and lightweight deep network that is able to approximate pixel-wise and higher-order curves by iteratively applying itself . Such image-specific curves can effectively perform mapping within a wide dynamic range.
202 | We show the potential of training a deep image enhancement model in the absence of reference images through task-specific non-reference loss functions that indirectly evaluate enhancement quality. It is capable of processing images in real-time (about 500 FPS for images of size 640*480*3 on GPU) and takes only 30 minutes for training .
203 |
204 |
205 |
206 |
207 |
Results
208 |
209 |
1. Visual Comparisons on Typical Low-light Images
210 |
211 |
212 |
213 |
214 |
215 |
216 |
217 |
218 |
219 |
220 |
2. Visual Face Detection Results Before and After Enanced by Zero-DCE
221 |
222 |
223 |
224 |
225 |
226 |
227 |
228 |
229 |
230 |
231 |
3. Real Low-light Video with Variational Illumination Enanced by Zero-DCE
232 |
233 |
234 | VIDEO
235 |
236 |
237 |
4. Self-training (taking first 100 frames as training data) for Low-light Video Enhancement
238 |
239 |
240 | VIDEO
241 |
242 |
243 |
244 |
Ablation Studies
245 |
1. Contribution of Each Loss
246 |
247 |
248 |
249 |
250 |
251 |
252 |
253 |
254 |
255 |
256 | Ablation study of the contribution of each loss (spatial consistency loss Lspa , exposure control loss Lexp , color constancy loss Lcol , illumination smoothness loss LtvA ).
257 |
258 |
259 |
2. Effect of Parameter Settings
260 |
261 |
262 |
263 |
264 |
265 |
266 |
267 |
268 |
269 |
270 | Ablation study of the effect of parameter settings. l-f-n represents the proposed Zero-DCE with l convolutional layers, f feature maps of each layer (except the last layer), and n iterations.
271 |
272 |
273 |
3. Impact of Training Data
274 |
275 |
276 |
277 |
278 |
279 |
280 |
281 |
282 |
283 |
284 | To test the impact of training data, we retrain the Zero-DCE on different datasets: 1) only 900 low-light images out of 2,422 images in the original training set (Zero-DCELow ), 2) 9,000 unlabeled low-light images provided in the DARK FACE dataset (Zero-DCELargeL ), and 3) 4800 multi-exposure images from the data augmented combination of Part1 and Part2 subsets in the SICE dataset (Zero-DCELargeLH ).
285 |
286 |
287 |
4. Advantage of Three-channel Adjustment
288 |
289 |
290 |
291 |
292 |
293 |
294 |
295 |
296 |
297 |
298 | Ablation study of the advantage of three-channel adjustment (RGB, CIE Lab, YCbCr color spaces).
299 |
300 |
301 |
302 |
303 |
Materials
304 |
326 |
327 |
328 |
329 |
Citation
330 |
331 |
@Article{Zero-DCE,
332 | author = {Guo, Chunle and Li, Chongyi and Guo, Jichang and Loy, Chen Change and Hou, Junhui and Kwong, Sam and Cong Runmin},
333 | title = {Zero-reference deep curve estimation for low-light image enhancement},
334 | journal = {arXiv preprint arXiv:2001.06826},
335 | year = {2020}
336 | }
337 |
338 |
339 |
340 |
341 |
345 |
346 |
347 |
--------------------------------------------------------------------------------
/Zero-DCE_code/.gitignore:
--------------------------------------------------------------------------------
1 | __pycache__/
2 | data/
3 |
--------------------------------------------------------------------------------
/Zero-DCE_code/Myloss.py:
--------------------------------------------------------------------------------
1 | import torch
2 | import torch.nn as nn
3 | import torch.nn.functional as F
4 | import math
5 | from torchvision.models.vgg import vgg16
6 | import pytorch_colors as colors
7 | import numpy as np
8 |
9 |
10 | class L_color(nn.Module):
11 |
12 | def __init__(self):
13 | super(L_color, self).__init__()
14 |
15 | def forward(self, x ):
16 |
17 | b,c,h,w = x.shape
18 |
19 | mean_rgb = torch.mean(x,[2,3],keepdim=True)
20 | mr,mg, mb = torch.split(mean_rgb, 1, dim=1)
21 | Drg = torch.pow(mr-mg,2)
22 | Drb = torch.pow(mr-mb,2)
23 | Dgb = torch.pow(mb-mg,2)
24 | k = torch.pow(torch.pow(Drg,2) + torch.pow(Drb,2) + torch.pow(Dgb,2),0.5)
25 |
26 |
27 | return k
28 |
29 |
30 | class L_spa(nn.Module):
31 |
32 | def __init__(self):
33 | super(L_spa, self).__init__()
34 | # print(1)kernel = torch.FloatTensor(kernel).unsqueeze(0).unsqueeze(0)
35 | kernel_left = torch.FloatTensor( [[0,0,0],[-1,1,0],[0,0,0]]).cuda().unsqueeze(0).unsqueeze(0)
36 | kernel_right = torch.FloatTensor( [[0,0,0],[0,1,-1],[0,0,0]]).cuda().unsqueeze(0).unsqueeze(0)
37 | kernel_up = torch.FloatTensor( [[0,-1,0],[0,1, 0 ],[0,0,0]]).cuda().unsqueeze(0).unsqueeze(0)
38 | kernel_down = torch.FloatTensor( [[0,0,0],[0,1, 0],[0,-1,0]]).cuda().unsqueeze(0).unsqueeze(0)
39 | self.weight_left = nn.Parameter(data=kernel_left, requires_grad=False)
40 | self.weight_right = nn.Parameter(data=kernel_right, requires_grad=False)
41 | self.weight_up = nn.Parameter(data=kernel_up, requires_grad=False)
42 | self.weight_down = nn.Parameter(data=kernel_down, requires_grad=False)
43 | self.pool = nn.AvgPool2d(4)
44 | def forward(self, org , enhance ):
45 | b,c,h,w = org.shape
46 |
47 | org_mean = torch.mean(org,1,keepdim=True)
48 | enhance_mean = torch.mean(enhance,1,keepdim=True)
49 |
50 | org_pool = self.pool(org_mean)
51 | enhance_pool = self.pool(enhance_mean)
52 |
53 | weight_diff =torch.max(torch.FloatTensor([1]).cuda() + 10000*torch.min(org_pool - torch.FloatTensor([0.3]).cuda(),torch.FloatTensor([0]).cuda()),torch.FloatTensor([0.5]).cuda())
54 | E_1 = torch.mul(torch.sign(enhance_pool - torch.FloatTensor([0.5]).cuda()) ,enhance_pool-org_pool)
55 |
56 |
57 | D_org_letf = F.conv2d(org_pool , self.weight_left, padding=1)
58 | D_org_right = F.conv2d(org_pool , self.weight_right, padding=1)
59 | D_org_up = F.conv2d(org_pool , self.weight_up, padding=1)
60 | D_org_down = F.conv2d(org_pool , self.weight_down, padding=1)
61 |
62 | D_enhance_letf = F.conv2d(enhance_pool , self.weight_left, padding=1)
63 | D_enhance_right = F.conv2d(enhance_pool , self.weight_right, padding=1)
64 | D_enhance_up = F.conv2d(enhance_pool , self.weight_up, padding=1)
65 | D_enhance_down = F.conv2d(enhance_pool , self.weight_down, padding=1)
66 |
67 | D_left = torch.pow(D_org_letf - D_enhance_letf,2)
68 | D_right = torch.pow(D_org_right - D_enhance_right,2)
69 | D_up = torch.pow(D_org_up - D_enhance_up,2)
70 | D_down = torch.pow(D_org_down - D_enhance_down,2)
71 | E = (D_left + D_right + D_up +D_down)
72 | # E = 25*(D_left + D_right + D_up +D_down)
73 |
74 | return E
75 | class L_exp(nn.Module):
76 |
77 | def __init__(self,patch_size,mean_val):
78 | super(L_exp, self).__init__()
79 | # print(1)
80 | self.pool = nn.AvgPool2d(patch_size)
81 | self.mean_val = mean_val
82 | def forward(self, x ):
83 |
84 | b,c,h,w = x.shape
85 | x = torch.mean(x,1,keepdim=True)
86 | mean = self.pool(x)
87 |
88 | d = torch.mean(torch.pow(mean- torch.FloatTensor([self.mean_val] ).cuda(),2))
89 | return d
90 |
91 | class L_TV(nn.Module):
92 | def __init__(self,TVLoss_weight=1):
93 | super(L_TV,self).__init__()
94 | self.TVLoss_weight = TVLoss_weight
95 |
96 | def forward(self,x):
97 | batch_size = x.size()[0]
98 | h_x = x.size()[2]
99 | w_x = x.size()[3]
100 | count_h = (x.size()[2]-1) * x.size()[3]
101 | count_w = x.size()[2] * (x.size()[3] - 1)
102 | h_tv = torch.pow((x[:,:,1:,:]-x[:,:,:h_x-1,:]),2).sum()
103 | w_tv = torch.pow((x[:,:,:,1:]-x[:,:,:,:w_x-1]),2).sum()
104 | return self.TVLoss_weight*2*(h_tv/count_h+w_tv/count_w)/batch_size
105 | class Sa_Loss(nn.Module):
106 | def __init__(self):
107 | super(Sa_Loss, self).__init__()
108 | # print(1)
109 | def forward(self, x ):
110 | # self.grad = np.ones(x.shape,dtype=np.float32)
111 | b,c,h,w = x.shape
112 | # x_de = x.cpu().detach().numpy()
113 | r,g,b = torch.split(x , 1, dim=1)
114 | mean_rgb = torch.mean(x,[2,3],keepdim=True)
115 | mr,mg, mb = torch.split(mean_rgb, 1, dim=1)
116 | Dr = r-mr
117 | Dg = g-mg
118 | Db = b-mb
119 | k =torch.pow( torch.pow(Dr,2) + torch.pow(Db,2) + torch.pow(Dg,2),0.5)
120 | # print(k)
121 |
122 |
123 | k = torch.mean(k)
124 | return k
125 |
126 | class perception_loss(nn.Module):
127 | def __init__(self):
128 | super(perception_loss, self).__init__()
129 | features = vgg16(pretrained=True).features
130 | self.to_relu_1_2 = nn.Sequential()
131 | self.to_relu_2_2 = nn.Sequential()
132 | self.to_relu_3_3 = nn.Sequential()
133 | self.to_relu_4_3 = nn.Sequential()
134 |
135 | for x in range(4):
136 | self.to_relu_1_2.add_module(str(x), features[x])
137 | for x in range(4, 9):
138 | self.to_relu_2_2.add_module(str(x), features[x])
139 | for x in range(9, 16):
140 | self.to_relu_3_3.add_module(str(x), features[x])
141 | for x in range(16, 23):
142 | self.to_relu_4_3.add_module(str(x), features[x])
143 |
144 | # don't need the gradients, just want the features
145 | for param in self.parameters():
146 | param.requires_grad = False
147 |
148 | def forward(self, x):
149 | h = self.to_relu_1_2(x)
150 | h_relu_1_2 = h
151 | h = self.to_relu_2_2(h)
152 | h_relu_2_2 = h
153 | h = self.to_relu_3_3(h)
154 | h_relu_3_3 = h
155 | h = self.to_relu_4_3(h)
156 | h_relu_4_3 = h
157 | # out = (h_relu_1_2, h_relu_2_2, h_relu_3_3, h_relu_4_3)
158 | return h_relu_4_3
--------------------------------------------------------------------------------
/Zero-DCE_code/data/test_data/DICM/01.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangyin0810/Zero-DCE/cb3399bbf66f17391f208c08815e73f76fbc6f00/Zero-DCE_code/data/test_data/DICM/01.jpg
--------------------------------------------------------------------------------
/Zero-DCE_code/data/test_data/DICM/02.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangyin0810/Zero-DCE/cb3399bbf66f17391f208c08815e73f76fbc6f00/Zero-DCE_code/data/test_data/DICM/02.jpg
--------------------------------------------------------------------------------
/Zero-DCE_code/data/test_data/DICM/03.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangyin0810/Zero-DCE/cb3399bbf66f17391f208c08815e73f76fbc6f00/Zero-DCE_code/data/test_data/DICM/03.jpg
--------------------------------------------------------------------------------
/Zero-DCE_code/data/test_data/DICM/04.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangyin0810/Zero-DCE/cb3399bbf66f17391f208c08815e73f76fbc6f00/Zero-DCE_code/data/test_data/DICM/04.jpg
--------------------------------------------------------------------------------
/Zero-DCE_code/data/test_data/DICM/05.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangyin0810/Zero-DCE/cb3399bbf66f17391f208c08815e73f76fbc6f00/Zero-DCE_code/data/test_data/DICM/05.jpg
--------------------------------------------------------------------------------
/Zero-DCE_code/data/test_data/DICM/06.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangyin0810/Zero-DCE/cb3399bbf66f17391f208c08815e73f76fbc6f00/Zero-DCE_code/data/test_data/DICM/06.jpg
--------------------------------------------------------------------------------
/Zero-DCE_code/data/test_data/DICM/07.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangyin0810/Zero-DCE/cb3399bbf66f17391f208c08815e73f76fbc6f00/Zero-DCE_code/data/test_data/DICM/07.jpg
--------------------------------------------------------------------------------
/Zero-DCE_code/data/test_data/DICM/08.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangyin0810/Zero-DCE/cb3399bbf66f17391f208c08815e73f76fbc6f00/Zero-DCE_code/data/test_data/DICM/08.jpg
--------------------------------------------------------------------------------
/Zero-DCE_code/data/test_data/DICM/09.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangyin0810/Zero-DCE/cb3399bbf66f17391f208c08815e73f76fbc6f00/Zero-DCE_code/data/test_data/DICM/09.jpg
--------------------------------------------------------------------------------
/Zero-DCE_code/data/test_data/DICM/10.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangyin0810/Zero-DCE/cb3399bbf66f17391f208c08815e73f76fbc6f00/Zero-DCE_code/data/test_data/DICM/10.jpg
--------------------------------------------------------------------------------
/Zero-DCE_code/data/test_data/DICM/11.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangyin0810/Zero-DCE/cb3399bbf66f17391f208c08815e73f76fbc6f00/Zero-DCE_code/data/test_data/DICM/11.jpg
--------------------------------------------------------------------------------
/Zero-DCE_code/data/test_data/DICM/12.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangyin0810/Zero-DCE/cb3399bbf66f17391f208c08815e73f76fbc6f00/Zero-DCE_code/data/test_data/DICM/12.jpg
--------------------------------------------------------------------------------
/Zero-DCE_code/data/test_data/DICM/13.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangyin0810/Zero-DCE/cb3399bbf66f17391f208c08815e73f76fbc6f00/Zero-DCE_code/data/test_data/DICM/13.jpg
--------------------------------------------------------------------------------
/Zero-DCE_code/data/test_data/DICM/14.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangyin0810/Zero-DCE/cb3399bbf66f17391f208c08815e73f76fbc6f00/Zero-DCE_code/data/test_data/DICM/14.jpg
--------------------------------------------------------------------------------
/Zero-DCE_code/data/test_data/DICM/15.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangyin0810/Zero-DCE/cb3399bbf66f17391f208c08815e73f76fbc6f00/Zero-DCE_code/data/test_data/DICM/15.jpg
--------------------------------------------------------------------------------
/Zero-DCE_code/data/test_data/DICM/16.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangyin0810/Zero-DCE/cb3399bbf66f17391f208c08815e73f76fbc6f00/Zero-DCE_code/data/test_data/DICM/16.jpg
--------------------------------------------------------------------------------
/Zero-DCE_code/data/test_data/DICM/17.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangyin0810/Zero-DCE/cb3399bbf66f17391f208c08815e73f76fbc6f00/Zero-DCE_code/data/test_data/DICM/17.jpg
--------------------------------------------------------------------------------
/Zero-DCE_code/data/test_data/DICM/18.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangyin0810/Zero-DCE/cb3399bbf66f17391f208c08815e73f76fbc6f00/Zero-DCE_code/data/test_data/DICM/18.jpg
--------------------------------------------------------------------------------
/Zero-DCE_code/data/test_data/DICM/19.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangyin0810/Zero-DCE/cb3399bbf66f17391f208c08815e73f76fbc6f00/Zero-DCE_code/data/test_data/DICM/19.jpg
--------------------------------------------------------------------------------
/Zero-DCE_code/data/test_data/DICM/20.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangyin0810/Zero-DCE/cb3399bbf66f17391f208c08815e73f76fbc6f00/Zero-DCE_code/data/test_data/DICM/20.jpg
--------------------------------------------------------------------------------
/Zero-DCE_code/data/test_data/DICM/21.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangyin0810/Zero-DCE/cb3399bbf66f17391f208c08815e73f76fbc6f00/Zero-DCE_code/data/test_data/DICM/21.jpg
--------------------------------------------------------------------------------
/Zero-DCE_code/data/test_data/DICM/22.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangyin0810/Zero-DCE/cb3399bbf66f17391f208c08815e73f76fbc6f00/Zero-DCE_code/data/test_data/DICM/22.jpg
--------------------------------------------------------------------------------
/Zero-DCE_code/data/test_data/DICM/25.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangyin0810/Zero-DCE/cb3399bbf66f17391f208c08815e73f76fbc6f00/Zero-DCE_code/data/test_data/DICM/25.jpg
--------------------------------------------------------------------------------
/Zero-DCE_code/data/test_data/DICM/26.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangyin0810/Zero-DCE/cb3399bbf66f17391f208c08815e73f76fbc6f00/Zero-DCE_code/data/test_data/DICM/26.jpg
--------------------------------------------------------------------------------
/Zero-DCE_code/data/test_data/DICM/27.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangyin0810/Zero-DCE/cb3399bbf66f17391f208c08815e73f76fbc6f00/Zero-DCE_code/data/test_data/DICM/27.jpg
--------------------------------------------------------------------------------
/Zero-DCE_code/data/test_data/DICM/28.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangyin0810/Zero-DCE/cb3399bbf66f17391f208c08815e73f76fbc6f00/Zero-DCE_code/data/test_data/DICM/28.jpg
--------------------------------------------------------------------------------
/Zero-DCE_code/data/test_data/DICM/29.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangyin0810/Zero-DCE/cb3399bbf66f17391f208c08815e73f76fbc6f00/Zero-DCE_code/data/test_data/DICM/29.jpg
--------------------------------------------------------------------------------
/Zero-DCE_code/data/test_data/DICM/30.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangyin0810/Zero-DCE/cb3399bbf66f17391f208c08815e73f76fbc6f00/Zero-DCE_code/data/test_data/DICM/30.jpg
--------------------------------------------------------------------------------
/Zero-DCE_code/data/test_data/DICM/31.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangyin0810/Zero-DCE/cb3399bbf66f17391f208c08815e73f76fbc6f00/Zero-DCE_code/data/test_data/DICM/31.jpg
--------------------------------------------------------------------------------
/Zero-DCE_code/data/test_data/DICM/32.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangyin0810/Zero-DCE/cb3399bbf66f17391f208c08815e73f76fbc6f00/Zero-DCE_code/data/test_data/DICM/32.jpg
--------------------------------------------------------------------------------
/Zero-DCE_code/data/test_data/DICM/33.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangyin0810/Zero-DCE/cb3399bbf66f17391f208c08815e73f76fbc6f00/Zero-DCE_code/data/test_data/DICM/33.jpg
--------------------------------------------------------------------------------
/Zero-DCE_code/data/test_data/DICM/34.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangyin0810/Zero-DCE/cb3399bbf66f17391f208c08815e73f76fbc6f00/Zero-DCE_code/data/test_data/DICM/34.jpg
--------------------------------------------------------------------------------
/Zero-DCE_code/data/test_data/DICM/35.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangyin0810/Zero-DCE/cb3399bbf66f17391f208c08815e73f76fbc6f00/Zero-DCE_code/data/test_data/DICM/35.jpg
--------------------------------------------------------------------------------
/Zero-DCE_code/data/test_data/DICM/36.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangyin0810/Zero-DCE/cb3399bbf66f17391f208c08815e73f76fbc6f00/Zero-DCE_code/data/test_data/DICM/36.jpg
--------------------------------------------------------------------------------
/Zero-DCE_code/data/test_data/DICM/37.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangyin0810/Zero-DCE/cb3399bbf66f17391f208c08815e73f76fbc6f00/Zero-DCE_code/data/test_data/DICM/37.jpg
--------------------------------------------------------------------------------
/Zero-DCE_code/data/test_data/DICM/38.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangyin0810/Zero-DCE/cb3399bbf66f17391f208c08815e73f76fbc6f00/Zero-DCE_code/data/test_data/DICM/38.jpg
--------------------------------------------------------------------------------
/Zero-DCE_code/data/test_data/DICM/39.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangyin0810/Zero-DCE/cb3399bbf66f17391f208c08815e73f76fbc6f00/Zero-DCE_code/data/test_data/DICM/39.jpg
--------------------------------------------------------------------------------
/Zero-DCE_code/data/test_data/DICM/40.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangyin0810/Zero-DCE/cb3399bbf66f17391f208c08815e73f76fbc6f00/Zero-DCE_code/data/test_data/DICM/40.jpg
--------------------------------------------------------------------------------
/Zero-DCE_code/data/test_data/DICM/41.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangyin0810/Zero-DCE/cb3399bbf66f17391f208c08815e73f76fbc6f00/Zero-DCE_code/data/test_data/DICM/41.jpg
--------------------------------------------------------------------------------
/Zero-DCE_code/data/test_data/DICM/42.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangyin0810/Zero-DCE/cb3399bbf66f17391f208c08815e73f76fbc6f00/Zero-DCE_code/data/test_data/DICM/42.jpg
--------------------------------------------------------------------------------
/Zero-DCE_code/data/test_data/DICM/43.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangyin0810/Zero-DCE/cb3399bbf66f17391f208c08815e73f76fbc6f00/Zero-DCE_code/data/test_data/DICM/43.jpg
--------------------------------------------------------------------------------
/Zero-DCE_code/data/test_data/DICM/44.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangyin0810/Zero-DCE/cb3399bbf66f17391f208c08815e73f76fbc6f00/Zero-DCE_code/data/test_data/DICM/44.jpg
--------------------------------------------------------------------------------
/Zero-DCE_code/data/test_data/DICM/45.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangyin0810/Zero-DCE/cb3399bbf66f17391f208c08815e73f76fbc6f00/Zero-DCE_code/data/test_data/DICM/45.jpg
--------------------------------------------------------------------------------
/Zero-DCE_code/data/test_data/DICM/46.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangyin0810/Zero-DCE/cb3399bbf66f17391f208c08815e73f76fbc6f00/Zero-DCE_code/data/test_data/DICM/46.jpg
--------------------------------------------------------------------------------
/Zero-DCE_code/data/test_data/DICM/47.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangyin0810/Zero-DCE/cb3399bbf66f17391f208c08815e73f76fbc6f00/Zero-DCE_code/data/test_data/DICM/47.jpg
--------------------------------------------------------------------------------
/Zero-DCE_code/data/test_data/DICM/48.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangyin0810/Zero-DCE/cb3399bbf66f17391f208c08815e73f76fbc6f00/Zero-DCE_code/data/test_data/DICM/48.jpg
--------------------------------------------------------------------------------
/Zero-DCE_code/data/test_data/DICM/49.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangyin0810/Zero-DCE/cb3399bbf66f17391f208c08815e73f76fbc6f00/Zero-DCE_code/data/test_data/DICM/49.jpg
--------------------------------------------------------------------------------
/Zero-DCE_code/data/test_data/DICM/50.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangyin0810/Zero-DCE/cb3399bbf66f17391f208c08815e73f76fbc6f00/Zero-DCE_code/data/test_data/DICM/50.jpg
--------------------------------------------------------------------------------
/Zero-DCE_code/data/test_data/DICM/52.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangyin0810/Zero-DCE/cb3399bbf66f17391f208c08815e73f76fbc6f00/Zero-DCE_code/data/test_data/DICM/52.jpg
--------------------------------------------------------------------------------
/Zero-DCE_code/data/test_data/DICM/53.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangyin0810/Zero-DCE/cb3399bbf66f17391f208c08815e73f76fbc6f00/Zero-DCE_code/data/test_data/DICM/53.jpg
--------------------------------------------------------------------------------
/Zero-DCE_code/data/test_data/DICM/54.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangyin0810/Zero-DCE/cb3399bbf66f17391f208c08815e73f76fbc6f00/Zero-DCE_code/data/test_data/DICM/54.jpg
--------------------------------------------------------------------------------
/Zero-DCE_code/data/test_data/DICM/55.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangyin0810/Zero-DCE/cb3399bbf66f17391f208c08815e73f76fbc6f00/Zero-DCE_code/data/test_data/DICM/55.jpg
--------------------------------------------------------------------------------
/Zero-DCE_code/data/test_data/DICM/56.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangyin0810/Zero-DCE/cb3399bbf66f17391f208c08815e73f76fbc6f00/Zero-DCE_code/data/test_data/DICM/56.jpg
--------------------------------------------------------------------------------
/Zero-DCE_code/data/test_data/DICM/57.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangyin0810/Zero-DCE/cb3399bbf66f17391f208c08815e73f76fbc6f00/Zero-DCE_code/data/test_data/DICM/57.jpg
--------------------------------------------------------------------------------
/Zero-DCE_code/data/test_data/DICM/58.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangyin0810/Zero-DCE/cb3399bbf66f17391f208c08815e73f76fbc6f00/Zero-DCE_code/data/test_data/DICM/58.jpg
--------------------------------------------------------------------------------
/Zero-DCE_code/data/test_data/DICM/60.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangyin0810/Zero-DCE/cb3399bbf66f17391f208c08815e73f76fbc6f00/Zero-DCE_code/data/test_data/DICM/60.jpg
--------------------------------------------------------------------------------
/Zero-DCE_code/data/test_data/DICM/61.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangyin0810/Zero-DCE/cb3399bbf66f17391f208c08815e73f76fbc6f00/Zero-DCE_code/data/test_data/DICM/61.jpg
--------------------------------------------------------------------------------
/Zero-DCE_code/data/test_data/DICM/62.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangyin0810/Zero-DCE/cb3399bbf66f17391f208c08815e73f76fbc6f00/Zero-DCE_code/data/test_data/DICM/62.jpg
--------------------------------------------------------------------------------
/Zero-DCE_code/data/test_data/DICM/63.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangyin0810/Zero-DCE/cb3399bbf66f17391f208c08815e73f76fbc6f00/Zero-DCE_code/data/test_data/DICM/63.jpg
--------------------------------------------------------------------------------
/Zero-DCE_code/data/test_data/DICM/64.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangyin0810/Zero-DCE/cb3399bbf66f17391f208c08815e73f76fbc6f00/Zero-DCE_code/data/test_data/DICM/64.jpg
--------------------------------------------------------------------------------
/Zero-DCE_code/data/test_data/DICM/65.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangyin0810/Zero-DCE/cb3399bbf66f17391f208c08815e73f76fbc6f00/Zero-DCE_code/data/test_data/DICM/65.jpg
--------------------------------------------------------------------------------
/Zero-DCE_code/data/test_data/DICM/66.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangyin0810/Zero-DCE/cb3399bbf66f17391f208c08815e73f76fbc6f00/Zero-DCE_code/data/test_data/DICM/66.jpg
--------------------------------------------------------------------------------
/Zero-DCE_code/data/test_data/DICM/67.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangyin0810/Zero-DCE/cb3399bbf66f17391f208c08815e73f76fbc6f00/Zero-DCE_code/data/test_data/DICM/67.jpg
--------------------------------------------------------------------------------
/Zero-DCE_code/data/test_data/DICM/69.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangyin0810/Zero-DCE/cb3399bbf66f17391f208c08815e73f76fbc6f00/Zero-DCE_code/data/test_data/DICM/69.jpg
--------------------------------------------------------------------------------
/Zero-DCE_code/data/test_data/LIME/1.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangyin0810/Zero-DCE/cb3399bbf66f17391f208c08815e73f76fbc6f00/Zero-DCE_code/data/test_data/LIME/1.bmp
--------------------------------------------------------------------------------
/Zero-DCE_code/data/test_data/LIME/10.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangyin0810/Zero-DCE/cb3399bbf66f17391f208c08815e73f76fbc6f00/Zero-DCE_code/data/test_data/LIME/10.bmp
--------------------------------------------------------------------------------
/Zero-DCE_code/data/test_data/LIME/2.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangyin0810/Zero-DCE/cb3399bbf66f17391f208c08815e73f76fbc6f00/Zero-DCE_code/data/test_data/LIME/2.bmp
--------------------------------------------------------------------------------
/Zero-DCE_code/data/test_data/LIME/3.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangyin0810/Zero-DCE/cb3399bbf66f17391f208c08815e73f76fbc6f00/Zero-DCE_code/data/test_data/LIME/3.bmp
--------------------------------------------------------------------------------
/Zero-DCE_code/data/test_data/LIME/4.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangyin0810/Zero-DCE/cb3399bbf66f17391f208c08815e73f76fbc6f00/Zero-DCE_code/data/test_data/LIME/4.bmp
--------------------------------------------------------------------------------
/Zero-DCE_code/data/test_data/LIME/5.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangyin0810/Zero-DCE/cb3399bbf66f17391f208c08815e73f76fbc6f00/Zero-DCE_code/data/test_data/LIME/5.bmp
--------------------------------------------------------------------------------
/Zero-DCE_code/data/test_data/LIME/6.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangyin0810/Zero-DCE/cb3399bbf66f17391f208c08815e73f76fbc6f00/Zero-DCE_code/data/test_data/LIME/6.bmp
--------------------------------------------------------------------------------
/Zero-DCE_code/data/test_data/LIME/7.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangyin0810/Zero-DCE/cb3399bbf66f17391f208c08815e73f76fbc6f00/Zero-DCE_code/data/test_data/LIME/7.bmp
--------------------------------------------------------------------------------
/Zero-DCE_code/data/test_data/LIME/8.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangyin0810/Zero-DCE/cb3399bbf66f17391f208c08815e73f76fbc6f00/Zero-DCE_code/data/test_data/LIME/8.bmp
--------------------------------------------------------------------------------
/Zero-DCE_code/data/test_data/LIME/9.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangyin0810/Zero-DCE/cb3399bbf66f17391f208c08815e73f76fbc6f00/Zero-DCE_code/data/test_data/LIME/9.bmp
--------------------------------------------------------------------------------
/Zero-DCE_code/dataloader.py:
--------------------------------------------------------------------------------
1 | import os
2 | import sys
3 |
4 | import torch
5 | import torch.utils.data as data
6 |
7 | import numpy as np
8 | from PIL import Image
9 | import glob
10 | import random
11 | import cv2
12 |
13 | random.seed(1143)
14 |
15 |
16 | def populate_train_list(lowlight_images_path):
17 |
18 |
19 |
20 |
21 | image_list_lowlight = glob.glob(lowlight_images_path + "*.jpg")
22 |
23 | train_list = image_list_lowlight
24 |
25 | random.shuffle(train_list)
26 |
27 | return train_list
28 |
29 |
30 |
31 | class lowlight_loader(data.Dataset):
32 |
33 | def __init__(self, lowlight_images_path):
34 |
35 | self.train_list = populate_train_list(lowlight_images_path)
36 | self.size = 256
37 |
38 | self.data_list = self.train_list
39 | print("Total training examples:", len(self.train_list))
40 |
41 |
42 |
43 |
44 | def __getitem__(self, index):
45 |
46 | data_lowlight_path = self.data_list[index]
47 |
48 | data_lowlight = Image.open(data_lowlight_path)
49 |
50 | data_lowlight = data_lowlight.resize((self.size,self.size), Image.ANTIALIAS)
51 |
52 | data_lowlight = (np.asarray(data_lowlight)/255.0)
53 | data_lowlight = torch.from_numpy(data_lowlight).float()
54 |
55 | return data_lowlight.permute(2,0,1)
56 |
57 | def __len__(self):
58 | return len(self.data_list)
59 |
60 |
--------------------------------------------------------------------------------
/Zero-DCE_code/lowlight_test.py:
--------------------------------------------------------------------------------
1 | import torch
2 | import torch.nn as nn
3 | import torchvision
4 | import torch.backends.cudnn as cudnn
5 | import torch.optim
6 | import os
7 | import sys
8 | import argparse
9 | import time
10 | import dataloader
11 | import model
12 | import numpy as np
13 | from torchvision import transforms
14 | from PIL import Image
15 | import glob
16 | import time
17 |
18 |
19 |
20 | def lowlight(image_path):
21 | os.environ['CUDA_VISIBLE_DEVICES']='0'
22 | data_lowlight = Image.open(image_path)
23 |
24 |
25 |
26 | data_lowlight = (np.asarray(data_lowlight)/255.0)
27 |
28 |
29 | data_lowlight = torch.from_numpy(data_lowlight).float()
30 | data_lowlight = data_lowlight.permute(2,0,1)
31 | data_lowlight = data_lowlight.cuda().unsqueeze(0)
32 |
33 | DCE_net = model.enhance_net_nopool().cuda()
34 | DCE_net.load_state_dict(torch.load('snapshots/Epoch99.pth'))
35 | start = time.time()
36 | _,enhanced_image,_ = DCE_net(data_lowlight)
37 |
38 | end_time = (time.time() - start)
39 | print(end_time)
40 | image_path = image_path.replace('test_data','result')
41 | result_path = image_path
42 | if not os.path.exists(image_path.replace('/'+image_path.split("/")[-1],'')):
43 | os.makedirs(image_path.replace('/'+image_path.split("/")[-1],''))
44 |
45 | torchvision.utils.save_image(enhanced_image, result_path)
46 |
47 | if __name__ == '__main__':
48 | # test_images
49 | with torch.no_grad():
50 | filePath = 'data/test_data/'
51 |
52 | file_list = os.listdir(filePath)
53 |
54 | for file_name in file_list:
55 | test_list = glob.glob(filePath+file_name+"/*")
56 | for image in test_list:
57 | # image = image
58 | print(image)
59 | lowlight(image)
60 |
61 |
62 |
63 |
--------------------------------------------------------------------------------
/Zero-DCE_code/lowlight_train.py:
--------------------------------------------------------------------------------
1 | import torch
2 | import torch.nn as nn
3 | import torchvision
4 | import torch.backends.cudnn as cudnn
5 | import torch.optim
6 | import os
7 | import sys
8 | import argparse
9 | import time
10 | import dataloader
11 | import model
12 | import Myloss
13 | import numpy as np
14 | from torchvision import transforms
15 |
16 |
17 | def weights_init(m):
18 | classname = m.__class__.__name__
19 | if classname.find('Conv') != -1:
20 | m.weight.data.normal_(0.0, 0.02)
21 | elif classname.find('BatchNorm') != -1:
22 | m.weight.data.normal_(1.0, 0.02)
23 | m.bias.data.fill_(0)
24 |
25 |
26 |
27 |
28 |
29 | def train(config):
30 |
31 | os.environ['CUDA_VISIBLE_DEVICES']='0'
32 |
33 | DCE_net = model.enhance_net_nopool().cuda()
34 |
35 | DCE_net.apply(weights_init)
36 | if config.load_pretrain == True:
37 | DCE_net.load_state_dict(torch.load(config.pretrain_dir))
38 | train_dataset = dataloader.lowlight_loader(config.lowlight_images_path)
39 |
40 | train_loader = torch.utils.data.DataLoader(train_dataset, batch_size=config.train_batch_size, shuffle=True, num_workers=config.num_workers, pin_memory=True)
41 |
42 |
43 |
44 | L_color = Myloss.L_color()
45 | L_spa = Myloss.L_spa()
46 |
47 | L_exp = Myloss.L_exp(16,0.6)
48 | L_TV = Myloss.L_TV()
49 |
50 |
51 | optimizer = torch.optim.Adam(DCE_net.parameters(), lr=config.lr, weight_decay=config.weight_decay)
52 |
53 | DCE_net.train()
54 |
55 | for epoch in range(config.num_epochs):
56 | for iteration, img_lowlight in enumerate(train_loader):
57 |
58 | img_lowlight = img_lowlight.cuda()
59 |
60 | enhanced_image_1,enhanced_image,A = DCE_net(img_lowlight)
61 |
62 | Loss_TV = 200*L_TV(A)
63 |
64 | loss_spa = torch.mean(L_spa(enhanced_image, img_lowlight))
65 |
66 | loss_col = 5*torch.mean(L_color(enhanced_image))
67 |
68 | loss_exp = 10*torch.mean(L_exp(enhanced_image))
69 |
70 |
71 | # best_loss
72 | loss = Loss_TV + loss_spa + loss_col + loss_exp
73 | #
74 |
75 |
76 | optimizer.zero_grad()
77 | loss.backward()
78 | torch.nn.utils.clip_grad_norm(DCE_net.parameters(),config.grad_clip_norm)
79 | optimizer.step()
80 |
81 | if ((iteration+1) % config.display_iter) == 0:
82 | print("Loss at iteration", iteration+1, ":", loss.item())
83 | if ((iteration+1) % config.snapshot_iter) == 0:
84 |
85 | torch.save(DCE_net.state_dict(), config.snapshots_folder + "Epoch" + str(epoch) + '.pth')
86 |
87 |
88 |
89 |
90 | if __name__ == "__main__":
91 |
92 | parser = argparse.ArgumentParser()
93 |
94 | # Input Parameters
95 | parser.add_argument('--lowlight_images_path', type=str, default="data/train_data/")
96 | parser.add_argument('--lr', type=float, default=0.0001)
97 | parser.add_argument('--weight_decay', type=float, default=0.0001)
98 | parser.add_argument('--grad_clip_norm', type=float, default=0.1)
99 | parser.add_argument('--num_epochs', type=int, default=200)
100 | parser.add_argument('--train_batch_size', type=int, default=8)
101 | parser.add_argument('--val_batch_size', type=int, default=4)
102 | parser.add_argument('--num_workers', type=int, default=4)
103 | parser.add_argument('--display_iter', type=int, default=10)
104 | parser.add_argument('--snapshot_iter', type=int, default=10)
105 | parser.add_argument('--snapshots_folder', type=str, default="snapshots/")
106 | parser.add_argument('--load_pretrain', type=bool, default= False)
107 | parser.add_argument('--pretrain_dir', type=str, default= "snapshots/Epoch99.pth")
108 |
109 | config = parser.parse_args()
110 |
111 | if not os.path.exists(config.snapshots_folder):
112 | os.mkdir(config.snapshots_folder)
113 |
114 |
115 | train(config)
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
--------------------------------------------------------------------------------
/Zero-DCE_code/model.py:
--------------------------------------------------------------------------------
1 | import torch
2 | import torch.nn as nn
3 | import torch.nn.functional as F
4 | import math
5 | #import pytorch_colors as colors
6 | import numpy as np
7 |
8 | class enhance_net_nopool(nn.Module):
9 |
10 | def __init__(self):
11 | super(enhance_net_nopool, self).__init__()
12 |
13 | self.relu = nn.ReLU(inplace=True)
14 |
15 | number_f = 32
16 | self.e_conv1 = nn.Conv2d(3,number_f,3,1,1,bias=True)
17 | self.e_conv2 = nn.Conv2d(number_f,number_f,3,1,1,bias=True)
18 | self.e_conv3 = nn.Conv2d(number_f,number_f,3,1,1,bias=True)
19 | self.e_conv4 = nn.Conv2d(number_f,number_f,3,1,1,bias=True)
20 | self.e_conv5 = nn.Conv2d(number_f*2,number_f,3,1,1,bias=True)
21 | self.e_conv6 = nn.Conv2d(number_f*2,number_f,3,1,1,bias=True)
22 | self.e_conv7 = nn.Conv2d(number_f*2,24,3,1,1,bias=True)
23 |
24 | self.maxpool = nn.MaxPool2d(2, stride=2, return_indices=False, ceil_mode=False)
25 | self.upsample = nn.UpsamplingBilinear2d(scale_factor=2)
26 |
27 |
28 |
29 | def forward(self, x):
30 |
31 | x1 = self.relu(self.e_conv1(x))
32 | # p1 = self.maxpool(x1)
33 | x2 = self.relu(self.e_conv2(x1))
34 | # p2 = self.maxpool(x2)
35 | x3 = self.relu(self.e_conv3(x2))
36 | # p3 = self.maxpool(x3)
37 | x4 = self.relu(self.e_conv4(x3))
38 |
39 | x5 = self.relu(self.e_conv5(torch.cat([x3,x4],1)))
40 | # x5 = self.upsample(x5)
41 | x6 = self.relu(self.e_conv6(torch.cat([x2,x5],1)))
42 |
43 | x_r = F.tanh(self.e_conv7(torch.cat([x1,x6],1)))
44 | r1,r2,r3,r4,r5,r6,r7,r8 = torch.split(x_r, 3, dim=1)
45 |
46 |
47 | x = x + r1*(torch.pow(x,2)-x)
48 | x = x + r2*(torch.pow(x,2)-x)
49 | x = x + r3*(torch.pow(x,2)-x)
50 | enhance_image_1 = x + r4*(torch.pow(x,2)-x)
51 | x = enhance_image_1 + r5*(torch.pow(enhance_image_1,2)-enhance_image_1)
52 | x = x + r6*(torch.pow(x,2)-x)
53 | x = x + r7*(torch.pow(x,2)-x)
54 | enhance_image = x + r8*(torch.pow(x,2)-x)
55 | r = torch.cat([r1,r2,r3,r4,r5,r6,r7,r8],1)
56 | return enhance_image_1,enhance_image,r
57 |
58 |
59 |
60 |
--------------------------------------------------------------------------------
/Zero-DCE_code/snapshots/Epoch99.pth:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangyin0810/Zero-DCE/cb3399bbf66f17391f208c08815e73f76fbc6f00/Zero-DCE_code/snapshots/Epoch99.pth
--------------------------------------------------------------------------------
/Zero-DCE_files/MathJax.js.download:
--------------------------------------------------------------------------------
1 | /*
2 | * /MathJax.js
3 | *
4 | * Copyright (c) 2009-2018 The MathJax Consortium
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | if(document.getElementById&&document.childNodes&&document.createElement){if(!(window.MathJax&&MathJax.Hub)){if(window.MathJax){window.MathJax={AuthorConfig:window.MathJax}}else{window.MathJax={}}MathJax.isPacked=true;MathJax.version="2.7.7";MathJax.fileversion="2.7.7";MathJax.cdnVersion="2.7.7";MathJax.cdnFileVersions={};(function(d){var b=window[d];if(!b){b=window[d]={}}var e=[];var c=function(f){var g=f.constructor;if(!g){g=function(){}}for(var h in f){if(h!=="constructor"&&f.hasOwnProperty(h)){g[h]=f[h]}}return g};var a=function(){return function(){return arguments.callee.Init.call(this,arguments)}};b.Object=c({constructor:a(),Subclass:function(f,h){var g=a();g.SUPER=this;g.Init=this.Init;g.Subclass=this.Subclass;g.Augment=this.Augment;g.protoFunction=this.protoFunction;g.can=this.can;g.has=this.has;g.isa=this.isa;g.prototype=new this(e);g.prototype.constructor=g;g.Augment(f,h);return g},Init:function(f){var g=this;if(f.length===1&&f[0]===e){return g}if(!(g instanceof f.callee)){g=new f.callee(e)}return g.Init.apply(g,f)||g},Augment:function(f,g){var h;if(f!=null){for(h in f){if(f.hasOwnProperty(h)){this.protoFunction(h,f[h])}}if(f.toString!==this.prototype.toString&&f.toString!=={}.toString){this.protoFunction("toString",f.toString)}}if(g!=null){for(h in g){if(g.hasOwnProperty(h)){this[h]=g[h]}}}return this},protoFunction:function(g,f){this.prototype[g]=f;if(typeof f==="function"){f.SUPER=this.SUPER.prototype}},prototype:{Init:function(){},SUPER:function(f){return f.callee.SUPER},can:function(f){return typeof(this[f])==="function"},has:function(f){return typeof(this[f])!=="undefined"},isa:function(f){return(f instanceof Object)&&(this instanceof f)}},can:function(f){return this.prototype.can.call(this,f)},has:function(f){return this.prototype.has.call(this,f)},isa:function(g){var f=this;while(f){if(f===g){return true}else{f=f.SUPER}}return false},SimpleSUPER:c({constructor:function(f){return this.SimpleSUPER.define(f)},define:function(f){var h={};if(f!=null){for(var g in f){if(f.hasOwnProperty(g)){h[g]=this.wrap(g,f[g])}}if(f.toString!==this.prototype.toString&&f.toString!=={}.toString){h.toString=this.wrap("toString",f.toString)}}return h},wrap:function(i,h){if(typeof(h)!=="function"||!h.toString().match(/\.\s*SUPER\s*\(/)){return h}var g=function(){this.SUPER=g.SUPER[i];try{var f=h.apply(this,arguments)}catch(j){delete this.SUPER;throw j}delete this.SUPER;return f};g.toString=function(){return h.toString.apply(h,arguments)};return g}})});b.Object.isArray=Array.isArray||function(f){return Object.prototype.toString.call(f)==="[object Array]"};b.Object.Array=Array})("MathJax");(function(BASENAME){var BASE=window[BASENAME];if(!BASE){BASE=window[BASENAME]={}}var isArray=BASE.Object.isArray;var CALLBACK=function(data){var cb=function(){return arguments.callee.execute.apply(arguments.callee,arguments)};for(var id in CALLBACK.prototype){if(CALLBACK.prototype.hasOwnProperty(id)){if(typeof(data[id])!=="undefined"){cb[id]=data[id]}else{cb[id]=CALLBACK.prototype[id]}}}cb.toString=CALLBACK.prototype.toString;return cb};CALLBACK.prototype={isCallback:true,hook:function(){},data:[],object:window,execute:function(){if(!this.called||this.autoReset){this.called=!this.autoReset;return this.hook.apply(this.object,this.data.concat([].slice.call(arguments,0)))}},reset:function(){delete this.called},toString:function(){return this.hook.toString.apply(this.hook,arguments)}};var ISCALLBACK=function(f){return(typeof(f)==="function"&&f.isCallback)};var EVAL=function(code){return eval.call(window,code)};var TESTEVAL=function(){EVAL("var __TeSt_VaR__ = 1");if(window.__TeSt_VaR__){try{delete window.__TeSt_VaR__}catch(error){window.__TeSt_VaR__=null}}else{if(window.execScript){EVAL=function(code){BASE.__code=code;code="try {"+BASENAME+".__result = eval("+BASENAME+".__code)} catch(err) {"+BASENAME+".__result = err}";window.execScript(code);var result=BASE.__result;delete BASE.__result;delete BASE.__code;if(result instanceof Error){throw result}return result}}else{EVAL=function(code){BASE.__code=code;code="try {"+BASENAME+".__result = eval("+BASENAME+".__code)} catch(err) {"+BASENAME+".__result = err}";var head=(document.getElementsByTagName("head"))[0];if(!head){head=document.body}var script=document.createElement("script");script.appendChild(document.createTextNode(code));head.appendChild(script);head.removeChild(script);var result=BASE.__result;delete BASE.__result;delete BASE.__code;if(result instanceof Error){throw result}return result}}}TESTEVAL=null};var USING=function(args,i){if(arguments.length>1){if(arguments.length===2&&!(typeof arguments[0]==="function")&&arguments[0] instanceof Object&&typeof arguments[1]==="number"){args=[].slice.call(args,i)}else{args=[].slice.call(arguments,0)}}if(isArray(args)&&args.length===1&&typeof(args[0])==="function"){args=args[0]}if(typeof args==="function"){if(args.execute===CALLBACK.prototype.execute){return args}return CALLBACK({hook:args})}else{if(isArray(args)){if(typeof(args[0])==="string"&&args[1] instanceof Object&&typeof args[1][args[0]]==="function"){return CALLBACK({hook:args[1][args[0]],object:args[1],data:args.slice(2)})}else{if(typeof args[0]==="function"){return CALLBACK({hook:args[0],data:args.slice(1)})}else{if(typeof args[1]==="function"){return CALLBACK({hook:args[1],object:args[0],data:args.slice(2)})}}}}else{if(typeof(args)==="string"){if(TESTEVAL){TESTEVAL()}return CALLBACK({hook:EVAL,data:[args]})}else{if(args instanceof Object){return CALLBACK(args)}else{if(typeof(args)==="undefined"){return CALLBACK({})}}}}}throw Error("Can't make callback from given data")};var DELAY=function(time,callback){callback=USING(callback);callback.timeout=setTimeout(callback,time);return callback};var WAITFOR=function(callback,signal){callback=USING(callback);if(!callback.called){WAITSIGNAL(callback,signal);signal.pending++}};var WAITEXECUTE=function(){var signals=this.signal;delete this.signal;this.execute=this.oldExecute;delete this.oldExecute;var result=this.execute.apply(this,arguments);if(ISCALLBACK(result)&&!result.called){WAITSIGNAL(result,signals)}else{for(var i=0,m=signals.length;i
0&&priority=0;i--){this.hooks.splice(i,1)}this.remove=[]}});var EXECUTEHOOKS=function(hooks,data,reset){if(!hooks){return null}if(!isArray(hooks)){hooks=[hooks]}if(!isArray(data)){data=(data==null?[]:[data])}var handler=HOOKS(reset);for(var i=0,m=hooks.length;ig){g=document.styleSheets.length}if(!i){i=document.head||((document.getElementsByTagName("head"))[0]);if(!i){i=document.body}}return i};var f=[];var c=function(){for(var k=0,j=f.length;k=this.timeout){i(this.STATUS.ERROR);return 1}return 0},file:function(j,i){if(i<0){a.Ajax.loadTimeout(j)}else{a.Ajax.loadComplete(j)}},execute:function(){this.hook.call(this.object,this,this.data[0],this.data[1])},checkSafari2:function(i,j,k){if(i.time(k)){return}if(document.styleSheets.length>j&&document.styleSheets[j].cssRules&&document.styleSheets[j].cssRules.length){k(i.STATUS.OK)}else{setTimeout(i,i.delay)}},checkLength:function(i,l,n){if(i.time(n)){return}var m=0;var j=(l.sheet||l.styleSheet);try{if((j.cssRules||j.rules||[]).length>0){m=1}}catch(k){if(k.message.match(/protected variable|restricted URI/)){m=1}else{if(k.message.match(/Security error/)){m=1}}}if(m){setTimeout(a.Callback([n,i.STATUS.OK]),0)}else{setTimeout(i,i.delay)}}},loadComplete:function(i){i=this.fileURL(i);var j=this.loading[i];if(j&&!j.preloaded){a.Message.Clear(j.message);clearTimeout(j.timeout);if(j.script){if(f.length===0){setTimeout(c,0)}f.push(j.script)}this.loaded[i]=j.status;delete this.loading[i];this.addHook(i,j.callback)}else{if(j){delete this.loading[i]}this.loaded[i]=this.STATUS.OK;j={status:this.STATUS.OK}}if(!this.loadHooks[i]){return null}return this.loadHooks[i].Execute(j.status)},loadTimeout:function(i){if(this.loading[i].timeout){clearTimeout(this.loading[i].timeout)}this.loading[i].status=this.STATUS.ERROR;this.loadError(i);this.loadComplete(i)},loadError:function(i){a.Message.Set(["LoadFailed","File failed to load: %1",i],null,2000);a.Hub.signal.Post(["file load error",i])},Styles:function(k,l){var i=this.StyleString(k);if(i===""){l=a.Callback(l);l()}else{var j=document.createElement("style");j.type="text/css";this.head=h(this.head);this.head.appendChild(j);if(j.styleSheet&&typeof(j.styleSheet.cssText)!=="undefined"){j.styleSheet.cssText=i}else{j.appendChild(document.createTextNode(i))}l=this.timer.create.call(this,l,j)}return l},StyleString:function(n){if(typeof(n)==="string"){return n}var k="",o,m;for(o in n){if(n.hasOwnProperty(o)){if(typeof n[o]==="string"){k+=o+" {"+n[o]+"}\n"}else{if(a.Object.isArray(n[o])){for(var l=0;l="0"&&q<="9"){f[j]=p[f[j]-1];if(typeof f[j]==="number"){f[j]=this.number(f[j])}}else{if(q==="{"){q=f[j].substr(1);if(q>="0"&&q<="9"){f[j]=p[f[j].substr(1,f[j].length-2)-1];if(typeof f[j]==="number"){f[j]=this.number(f[j])}}else{var k=f[j].match(/^\{([a-z]+):%(\d+)\|(.*)\}$/);if(k){if(k[1]==="plural"){var d=p[k[2]-1];if(typeof d==="undefined"){f[j]="???"}else{d=this.plural(d)-1;var h=k[3].replace(/(^|[^%])(%%)*%\|/g,"$1$2%\uEFEF").split(/\|/);if(d>=0&&d=3){c.push([f[0],f[1],this.processSnippet(g,f[2])])}else{c.push(e[d])}}}}else{c.push(e[d])}}return c},markdownPattern:/(%.)|(\*{1,3})((?:%.|.)+?)\2|(`+)((?:%.|.)+?)\4|\[((?:%.|.)+?)\]\(([^\s\)]+)\)/,processMarkdown:function(b,h,d){var j=[],e;var c=b.split(this.markdownPattern);var g=c[0];for(var f=1,a=c.length;f1?d[1]:""));f=null}if(e&&(!b.preJax||d)){c.nodeValue=c.nodeValue.replace(b.postJax,(e.length>1?e[1]:""))}if(f&&!f.nodeValue.match(/\S/)){f=f.previousSibling}}if(b.preRemoveClass&&f&&f.className===b.preRemoveClass){a.MathJax.preview=f}a.MathJax.checked=1},processInput:function(a){var b,i=MathJax.ElementJax.STATE;var h,e,d=a.scripts.length;try{while(a.ithis.processUpdateTime&&a.i1){d.jax[a.outputJax].push(b)}b.MathJax.state=c.OUTPUT},prepareOutput:function(c,f){while(c.jthis.processUpdateTime&&h.i=0;q--){if((b[q].src||"").match(f)){s.script=b[q].innerHTML;if(RegExp.$2){var t=RegExp.$2.substr(1).split(/\&/);for(var p=0,l=t.length;p=parseInt(y[z])}}return true},Select:function(j){var i=j[d.Browser];if(i){return i(d.Browser)}return null}};var e=k.replace(/^Mozilla\/(\d+\.)+\d+ /,"").replace(/[a-z][-a-z0-9._: ]+\/\d+[^ ]*-[^ ]*\.([a-z][a-z])?\d+ /i,"").replace(/Gentoo |Ubuntu\/(\d+\.)*\d+ (\([^)]*\) )?/,"");d.Browser=d.Insert(d.Insert(new String("Unknown"),{version:"0.0"}),a);for(var v in a){if(a.hasOwnProperty(v)){if(a[v]&&v.substr(0,2)==="is"){v=v.slice(2);if(v==="Mac"||v==="PC"){continue}d.Browser=d.Insert(new String(v),a);var r=new RegExp(".*(Version/| Trident/.*; rv:)((?:\\d+\\.)+\\d+)|.*("+v+")"+(v=="MSIE"?" ":"/")+"((?:\\d+\\.)*\\d+)|(?:^|\\(| )([a-z][-a-z0-9._: ]+|(?:Apple)?WebKit)/((?:\\d+\\.)+\\d+)");var u=r.exec(e)||["","","","unknown","0.0"];d.Browser.name=(u[1]!=""?v:(u[3]||u[5]));d.Browser.version=u[2]||u[4]||u[6];break}}}try{d.Browser.Select({Safari:function(j){var i=parseInt((String(j.version).split("."))[0]);if(i>85){j.webkit=j.version}if(i>=538){j.version="8.0"}else{if(i>=537){j.version="7.0"}else{if(i>=536){j.version="6.0"}else{if(i>=534){j.version="5.1"}else{if(i>=533){j.version="5.0"}else{if(i>=526){j.version="4.0"}else{if(i>=525){j.version="3.1"}else{if(i>500){j.version="3.0"}else{if(i>400){j.version="2.0"}else{if(i>85){j.version="1.0"}}}}}}}}}}j.webkit=(navigator.appVersion.match(/WebKit\/(\d+)\./))[1];j.isMobile=(navigator.appVersion.match(/Mobile/i)!=null);j.noContextMenu=j.isMobile},Firefox:function(j){if((j.version==="0.0"||k.match(/Firefox/)==null)&&navigator.product==="Gecko"){var m=k.match(/[\/ ]rv:(\d+\.\d.*?)[\) ]/);if(m){j.version=m[1]}else{var i=(navigator.buildID||navigator.productSub||"0").substr(0,8);if(i>="20111220"){j.version="9.0"}else{if(i>="20111120"){j.version="8.0"}else{if(i>="20110927"){j.version="7.0"}else{if(i>="20110816"){j.version="6.0"}else{if(i>="20110621"){j.version="5.0"}else{if(i>="20110320"){j.version="4.0"}else{if(i>="20100121"){j.version="3.6"}else{if(i>="20090630"){j.version="3.5"}else{if(i>="20080617"){j.version="3.0"}else{if(i>="20061024"){j.version="2.0"}}}}}}}}}}}}j.isMobile=(navigator.appVersion.match(/Android/i)!=null||k.match(/ Fennec\//)!=null||k.match(/Mobile/)!=null)},Chrome:function(i){i.noContextMenu=i.isMobile=!!navigator.userAgent.match(/ Mobile[ \/]/)},Opera:function(i){i.version=opera.version()},Edge:function(i){i.isMobile=!!navigator.userAgent.match(/ Phone/)},MSIE:function(j){j.isMobile=!!navigator.userAgent.match(/ Phone/);j.isIE9=!!(document.documentMode&&(window.performance||window.msPerformance));MathJax.HTML.setScriptBug=!j.isIE9||document.documentMode<9;MathJax.Hub.msieHTMLCollectionBug=(document.documentMode<9);if(document.documentMode<10&&!s.params.NoMathPlayer){try{new ActiveXObject("MathPlayer.Factory.1");j.hasMathPlayer=true}catch(m){}try{if(j.hasMathPlayer){var i=document.createElement("object");i.id="mathplayer";i.classid="clsid:32F66A20-7614-11D4-BD11-00104BD3F987";g.appendChild(i);document.namespaces.add("m","http://www.w3.org/1998/Math/MathML");j.mpNamespace=true;if(document.readyState&&(document.readyState==="loading"||document.readyState==="interactive")){document.write('');j.mpImported=true}}else{document.namespaces.add("mjx_IE_fix","http://www.w3.org/1999/xlink")}}catch(m){}}}})}catch(c){console.error(c.message)}d.Browser.Select(MathJax.Message.browsers);if(h.AuthorConfig&&typeof h.AuthorConfig.AuthorInit==="function"){h.AuthorConfig.AuthorInit()}d.queue=h.Callback.Queue();d.queue.Push(["Post",s.signal,"Begin"],["Config",s],["Cookie",s],["Styles",s],["Message",s],function(){var i=h.Callback.Queue(s.Jax(),s.Extensions());return i.Push({})},["Menu",s],s.onLoad(),function(){MathJax.isReady=true},["Typeset",s],["Hash",s],["MenuZoom",s],["Post",s.signal,"End"])})("MathJax")}};
20 |
--------------------------------------------------------------------------------
/Zero-DCE_files/analytics.js.download:
--------------------------------------------------------------------------------
1 | (function(){var k=this||self,l=function(a,b){a=a.split(".");var c=k;a[0]in c||"undefined"==typeof c.execScript||c.execScript("var "+a[0]);for(var d;a.length&&(d=a.shift());)a.length||void 0===b?c=c[d]&&c[d]!==Object.prototype[d]?c[d]:c[d]={}:c[d]=b};var n=function(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c])},p=function(a){for(var b in a)if(a.hasOwnProperty(b))return!0;return!1};var q=/^(?:(?:https?|mailto|ftp):|[^:/?#]*(?:[/?#]|$))/i;var r=window,u=document,v=function(a,b){u.addEventListener?u.addEventListener(a,b,!1):u.attachEvent&&u.attachEvent("on"+a,b)};var w={},x=function(){w.TAGGING=w.TAGGING||[];w.TAGGING[1]=!0};var y=/:[0-9]+$/,A=function(a,b){b&&(b=String(b).toLowerCase());if("protocol"===b||"port"===b)a.protocol=z(a.protocol)||z(r.location.protocol);"port"===b?a.port=String(Number(a.hostname?a.port:r.location.port)||("http"==a.protocol?80:"https"==a.protocol?443:"")):"host"===b&&(a.hostname=(a.hostname||r.location.hostname).replace(y,"").toLowerCase());var c=z(a.protocol);b&&(b=String(b).toLowerCase());switch(b){case "url_no_fragment":b="";a&&a.href&&(b=a.href.indexOf("#"),b=0>b?a.href:a.href.substr(0,
2 | b));a=b;break;case "protocol":a=c;break;case "host":a=a.hostname.replace(y,"").toLowerCase();break;case "port":a=String(Number(a.port)||("http"==c?80:"https"==c?443:""));break;case "path":a.pathname||a.hostname||x();a="/"==a.pathname.substr(0,1)?a.pathname:"/"+a.pathname;a=a.split("/");a:if(b=a[a.length-1],c=[],Array.prototype.indexOf)b=c.indexOf(b),b="number"==typeof b?b:-1;else{for(var d=0;d>2;g=(g&3)<<4|f>>4;f=(f&15)<<2|h>>6;h&=63;e||(h=64,d||(f=64));b.push(D[m],D[g],D[f],D[h])}return b.join("")},H=function(a){function b(m){for(;d>4);64!=f&&(c+=String.fromCharCode(g<<4&240|f>>2),64!=h&&(c+=String.fromCharCode(f<<6&192|h)))}};var I;function J(a,b){if(!a||b===u.location.hostname)return!1;for(var c=0;cc;c++){for(var d=c,e=0;8>e;e++)d=d&1?d>>>1^3988292384:d>>>1;b[c]=d}}I=b;b=4294967295;for(c=0;c>>8^I[(b^a.charCodeAt(c))&255];return((b^-1)>>>0).toString(36)},ba=function(a){return function(b){var c=B(r.location.href),d=c.search.replace("?","");a:{var e=d.split("&");for(var g=0;gc;++c){var d=P.exec(a);if(d){var e=d;break a}a=decodeURIComponent(a)}e=void 0}if(e&&"1"===e[1]){var g=e[2],f=e[3];a:{for(e=0;e>21:b}return b};var $c=function(a){this.w=a||[]};$c.prototype.set=function(a){this.w[a]=!0};$c.prototype.encode=function(){for(var a=[],b=0;b=b.length)wc(a,b,c);else if(8192>=b.length)x(a,b,c)||wd(a,b,c)||wc(a,b,c);else throw ge("len",b.length),new Da(b.length);},pe=function(a,b,c,d){d=d||ua;wd(a+"?"+b,"",d,c)},wc=function(a,b,c){var d=ta(a+"?"+b);d.onload=d.onerror=function(){d.onload=null;d.onerror=null;c()}},wd=function(a,b,c,
26 | d){var e=O.XMLHttpRequest;if(!e)return!1;var g=new e;if(!("withCredentials"in g))return!1;a=a.replace(/^http:/,"https:");g.open("POST",a,!0);g.withCredentials=!0;g.setRequestHeader("Content-Type","text/plain");g.onreadystatechange=function(){if(4==g.readyState){if(d)try{var ca=g.responseText;if(1>ca.length)ge("xhr","ver","0"),c();else if("1"!=ca.charAt(0))ge("xhr","ver",String(ca.length)),c();else if(3=100*R(a,Ka))throw"abort";}function Ma(a){if(G(P(a,Na)))throw"abort";}function Oa(){var a=M.location.protocol;if("http:"!=a&&"https:"!=a)throw"abort";}
29 | function Pa(a){try{O.navigator.sendBeacon?J(42):O.XMLHttpRequest&&"withCredentials"in new O.XMLHttpRequest&&J(40)}catch(c){}a.set(ld,Td(a),!0);a.set(Ac,R(a,Ac)+1);var b=[];ue.map(function(c,d){d.F&&(c=a.get(c),void 0!=c&&c!=d.defaultValue&&("boolean"==typeof c&&(c*=1),b.push(d.F+"="+K(""+c))))});b.push("z="+Bd());a.set(Ra,b.join("&"),!0)}
30 | function Sa(a){var b=P(a,fa);!b&&a.get(Vd)&&(b="beacon");var c=P(a,gd),d=P(a,oe),e=c||(d?d+"/3":bd(!1)+"/collect");switch(P(a,ad)){case "d":e=c||(d?d+"/32":bd(!1)+"/j/collect");b=a.get(qe)||void 0;pe(e,P(a,Ra),b,a.Z(Ia));break;case "b":e=c||(d?d+"/31":bd(!1)+"/r/collect");default:b?(c=P(a,Ra),d=(d=a.Z(Ia))||ua,"image"==b?wc(e,c,d):"xhr"==b&&wd(e,c,d)||"beacon"==b&&x(e,c,d)||ba(e,c,d)):ba(e,P(a,Ra),a.Z(Ia))}e=P(a,Na);e=h(e);b=e.hitcount;e.hitcount=b?b+1:1;e=P(a,Na);delete h(e).pending_experiments;
31 | a.set(Ia,ua,!0)}function Hc(a){qc().expId&&a.set(Nc,qc().expId);qc().expVar&&a.set(Oc,qc().expVar);var b=P(a,Na);if(b=h(b).pending_experiments){var c=[];for(d in b)b.hasOwnProperty(d)&&b[d]&&c.push(encodeURIComponent(d)+"."+encodeURIComponent(b[d]));var d=c.join("!")}else d=void 0;d&&a.set(m,d,!0)}function cd(){if(O.navigator&&"preview"==O.navigator.loadPurpose)throw"abort";}function yd(a){var b=O.gaDevIds;ka(b)&&0!=b.length&&a.set("&did",b.join(","),!0)}
32 | function vb(a){if(!a.get(Na))throw"abort";};var hd=function(){return Math.round(2147483647*Math.random())},Bd=function(){try{var a=new Uint32Array(1);O.crypto.getRandomValues(a);return a[0]&2147483647}catch(b){return hd()}};function Ta(a){var b=R(a,Ua);500<=b&&J(15);var c=P(a,Va);if("transaction"!=c&&"item"!=c){c=R(a,Wa);var d=(new Date).getTime(),e=R(a,Xa);0==e&&a.set(Xa,d);e=Math.round(2*(d-e)/1E3);0=c)throw"abort";a.set(Wa,--c)}a.set(Ua,++b)};var Ya=function(){this.data=new ee};Ya.prototype.get=function(a){var b=$a(a),c=this.data.get(a);b&&void 0==c&&(c=ea(b.defaultValue)?b.defaultValue():b.defaultValue);return b&&b.Z?b.Z(this,a,c):c};var P=function(a,b){a=a.get(b);return void 0==a?"":""+a},R=function(a,b){a=a.get(b);return void 0==a||""===a?0:Number(a)};Ya.prototype.Z=function(a){return(a=this.get(a))&&ea(a)?a:ua};
33 | Ya.prototype.set=function(a,b,c){if(a)if("object"==typeof a)for(var d in a)a.hasOwnProperty(d)&&ab(this,d,a[d],c);else ab(this,a,b,c)};var ab=function(a,b,c,d){if(void 0!=c)switch(b){case Na:wb.test(c)}var e=$a(b);e&&e.o?e.o(a,b,c,d):a.data.set(b,c,d)};var ue=new ee,ve=[],bb=function(a,b,c,d,e){this.name=a;this.F=b;this.Z=d;this.o=e;this.defaultValue=c},$a=function(a){var b=ue.get(a);if(!b)for(var c=0;c=b?!1:!0},gc=function(a){var b={};if(Ec(b)||Fc(b)){var c=b[Eb];void 0==c||Infinity==c||isNaN(c)||(0c)a[b]=void 0},Fd=function(a){return function(b){if("pageview"==b.get(Va)&&!a.I){a.I=!0;var c=aa(b),d=0a.length)J(12);else{for(var d=[],e=0;e=a&&d.push({hash:ca[0],R:e[g],O:ca})}if(0!=d.length)return 1==d.length?d[0]:Zc(b,d)||Zc(c,d)||Zc(null,d)||d[0]}function Zc(a,b){if(null==a)var c=a=1;else c=La(a),a=La(D(a,".")?a.substring(1):"."+a);for(var d=0;d=ca[0]||0>=ca[1]?"":ca.join("x");a.set(rb,c);a.set(tb,fc());a.set(ob,M.characterSet||M.charset);a.set(sb,b&&"function"===typeof b.javaEnabled&&b.javaEnabled()||!1);a.set(nb,(b&&(b.language||b.browserLanguage)||"").toLowerCase());a.data.set(ce,be("gclid",!0));a.data.set(ie,be("gclsrc",!0));a.data.set(fe,
63 | Math.round((new Date).getTime()/1E3));if(d&&a.get(cc)&&(b=M.location.hash)){b=b.split(/[?]+/);d=[];for(c=0;carguments.length)){if("string"===typeof arguments[0]){var b=arguments[0];var c=[].slice.call(arguments,1)}else b=arguments[0]&&arguments[0][Va],c=arguments;b&&(c=za(me[b]||[],c),c[Va]=b,this.b.set(c,void 0,!0),this.filters.D(this.b),this.b.data.m={})}};pc.prototype.ma=function(a,b){var c=this;u(a,c,b)||(v(a,function(){u(a,c,b)}),y(String(c.get(V)),a,void 0,b,!0))};var rc=function(a){if("prerender"==M.visibilityState)return!1;a();return!0},z=function(a){if(!rc(a)){J(16);var b=!1,c=function(){if(!b&&rc(a)){b=!0;var d=c,e=M;e.removeEventListener?e.removeEventListener("visibilitychange",d,!1):e.detachEvent&&e.detachEvent("onvisibilitychange",d)}};L(M,"visibilitychange",c)}};var te=/^(?:(\w+)\.)?(?:(\w+):)?(\w+)$/,sc=function(a){if(ea(a[0]))this.u=a[0];else{var b=te.exec(a[0]);null!=b&&4==b.length&&(this.c=b[1]||"t0",this.K=b[2]||"",this.C=b[3],this.a=[].slice.call(a,1),this.K||(this.A="create"==this.C,this.i="require"==this.C,this.g="provide"==this.C,this.ba="remove"==this.C),this.i&&(3<=this.a.length?(this.X=this.a[1],this.W=this.a[2]):this.a[1]&&(qa(this.a[1])?this.X=this.a[1]:this.W=this.a[1])));b=a[1];a=a[2];if(!this.C)throw"abort";if(this.i&&(!qa(b)||""==b))throw"abort";
65 | if(this.g&&(!qa(b)||""==b||!ea(a)))throw"abort";if(ud(this.c)||ud(this.K))throw"abort";if(this.g&&"t0"!=this.c)throw"abort";}};function ud(a){return 0<=a.indexOf(".")||0<=a.indexOf(":")};var Yd,Zd,$d,A;Yd=new ee;$d=new ee;A=new ee;Zd={ec:45,ecommerce:46,linkid:47};
66 | var u=function(a,b,c){b==N||b.get(V);var d=Yd.get(a);if(!ea(d))return!1;b.plugins_=b.plugins_||new ee;if(b.plugins_.get(a))return!0;b.plugins_.set(a,new d(b,c||{}));return!0},y=function(a,b,c,d,e){if(!ea(Yd.get(b))&&!$d.get(b)){Zd.hasOwnProperty(b)&&J(Zd[b]);a=N.j(a);if(p.test(b)){J(52);if(!a)return!0;c=d||{};d={id:b,B:c.dataLayer||"dataLayer",ia:!!a.get("anonymizeIp"),sync:e,G:!1};a.get(">m")==b&&(d.G=!0);var g=String(a.get("name"));"t0"!=g&&(d.target=g);G(String(a.get("trackingId")))||(d.clientId=
67 | String(a.get(Q)),d.ka=Number(a.get(n)),c=c.palindrome?r:q,c=(c=M.cookie.replace(/^|(; +)/g,";").match(c))?c.sort().join("").substring(1):void 0,d.la=c,d.qa=E(a.b.get(kb)||"","gclid"));c=d.B;g=(new Date).getTime();O[c]=O[c]||[];g={"gtm.start":g};e||(g.event="gtm.js");O[c].push(g);c=t(d)}!c&&Zd.hasOwnProperty(b)?(J(39),c=b+".js"):J(43);if(c){if(a){var ca=a.get(oe);qa(ca)||(ca=void 0)}c&&0<=c.indexOf("/")||(c=(ca?ca+"/34":bd(!1)+"/plugins/ua/")+c);ca=ae(c);a=ca.protocol;d=M.location.protocol;if(("https:"==
68 | a||a==d||("http:"!=a?0:"http:"==d))&&B(ca)){if(ca=ca.url)a=(a=M.querySelector&&M.querySelector("script[nonce]")||null)?a.nonce||a.getAttribute&&a.getAttribute("nonce")||"":"",e?(e="",a&&Nd.test(a)&&(e=' nonce="'+a+'"'),f.test(ca)&&M.write("