├── README.md ├── Zero-DCE.html ├── Zero-DCE_code ├── .gitignore ├── Myloss.py ├── data │ └── test_data │ │ ├── DICM │ │ ├── 01.jpg │ │ ├── 02.jpg │ │ ├── 03.jpg │ │ ├── 04.jpg │ │ ├── 05.jpg │ │ ├── 06.jpg │ │ ├── 07.jpg │ │ ├── 08.jpg │ │ ├── 09.jpg │ │ ├── 10.jpg │ │ ├── 11.jpg │ │ ├── 12.jpg │ │ ├── 13.jpg │ │ ├── 14.jpg │ │ ├── 15.jpg │ │ ├── 16.jpg │ │ ├── 17.jpg │ │ ├── 18.jpg │ │ ├── 19.jpg │ │ ├── 20.jpg │ │ ├── 21.jpg │ │ ├── 22.jpg │ │ ├── 25.jpg │ │ ├── 26.jpg │ │ ├── 27.jpg │ │ ├── 28.jpg │ │ ├── 29.jpg │ │ ├── 30.jpg │ │ ├── 31.jpg │ │ ├── 32.jpg │ │ ├── 33.jpg │ │ ├── 34.jpg │ │ ├── 35.jpg │ │ ├── 36.jpg │ │ ├── 37.jpg │ │ ├── 38.jpg │ │ ├── 39.jpg │ │ ├── 40.jpg │ │ ├── 41.jpg │ │ ├── 42.jpg │ │ ├── 43.jpg │ │ ├── 44.jpg │ │ ├── 45.jpg │ │ ├── 46.jpg │ │ ├── 47.jpg │ │ ├── 48.jpg │ │ ├── 49.jpg │ │ ├── 50.jpg │ │ ├── 52.jpg │ │ ├── 53.jpg │ │ ├── 54.jpg │ │ ├── 55.jpg │ │ ├── 56.jpg │ │ ├── 57.jpg │ │ ├── 58.jpg │ │ ├── 60.jpg │ │ ├── 61.jpg │ │ ├── 62.jpg │ │ ├── 63.jpg │ │ ├── 64.jpg │ │ ├── 65.jpg │ │ ├── 66.jpg │ │ ├── 67.jpg │ │ └── 69.jpg │ │ └── LIME │ │ ├── 1.bmp │ │ ├── 10.bmp │ │ ├── 2.bmp │ │ ├── 3.bmp │ │ ├── 4.bmp │ │ ├── 5.bmp │ │ ├── 6.bmp │ │ ├── 7.bmp │ │ ├── 8.bmp │ │ └── 9.bmp ├── dataloader.py ├── lowlight_test.py ├── lowlight_train.py ├── model.py └── snapshots │ └── Epoch99.pth └── Zero-DCE_files ├── MathJax.js.download ├── analytics.js.download ├── channel.png ├── css.css ├── effect.js.download ├── face.png ├── framework.png ├── icon_github.png ├── js ├── latest.js.download ├── loss.png ├── paper.png ├── paper_thumbnail.jpg ├── parameter.png ├── project.css ├── results.png └── training.png /README.md: -------------------------------------------------------------------------------- 1 | # Zero-Reference Deep Curve Estimation for Low-Light Image Enhancement 2 | 3 | You can find more details here: https://li-chongyi.github.io/Proj_Zero-DCE.html. Have fun! 4 | 5 | The implementation of Zero-DCE is for non-commercial use only. 6 | 7 | # Pytorch 8 | Pytorch implementation of Zero-DCE 9 | 10 | ## Requirements 11 | 1. Python 3 12 | 2. Pytorch 1.0 13 | 14 | Zero-DCE does not need special configurations. Just basic environment. 15 | 16 | ### Folder structure 17 | Download the Zero-DCE_code first. 18 | The following shows the basic folder structure. 19 | ``` 20 | 21 | ├── data 22 | │ ├── test_data # testing data. You can make a new folder for your testing data, like LIME, MEF, and NPE. 23 | │ │ ├── LIME 24 | │ │ └── MEF 25 | │ │ └── NPE 26 | │ └── train_data 27 | ├── lowlight_test.py # testing code 28 | ├── lowlight_train.py # training code 29 | ├── model.py # Zero-DEC network 30 | ├── dataloader.py 31 | ├── snapshots 32 | │ ├── Epoch99.pth # A pre-trained snapshot (Epoch99.pth) 33 | ``` 34 | ### Test: 35 | 36 | cd Zero-DCE_code 37 | ``` 38 | python lowlight_test.py 39 | ``` 40 | The script will process the images in the sub-folders of "test_data" folder and make a new folder "result" in the "data". You can find the enhanced images in the "result" folder. 41 | 42 | ### Train: 43 | 1) cd Zero-DCE_code 44 | 45 | 2) download the training data google drive or baidu cloud [password: 1234] 46 | 47 | 3) unzip and put the downloaded "train_data" folder to "data" folder 48 | ``` 49 | python lowlight_train.py 50 | ``` 51 | 52 | ## Bibtex 53 | 54 | ``` 55 | @inproceedings{Zero-DCE, 56 | author = {Guo, Chunle Guo and Li, Chongyi and Guo, Jichang and Loy, Chen Change and Hou, Junhui and Kwong, Sam and Cong, Runmin}, 57 | title = {Zero-reference deep curve estimation for low-light image enhancement}, 58 | booktitle = {Proceedings of the IEEE conference on computer vision and pattern recognition (CVPR)}, 59 | pages = {1780-1789}, 60 | month = {June}, 61 | year = {2020} 62 | } 63 | ``` 64 | 65 | (Full paper: http://openaccess.thecvf.com/content_CVPR_2020/papers/Guo_Zero-Reference_Deep_Curve_Estimation_for_Low-Light_Image_Enhancement_CVPR_2020_paper.pdf) 66 | 67 | ## Contact 68 | If you have any questions, please contact Chongyi Li at lichongyi25@gmail.com or Chunle Guo at guochunle@tju.edu.cn. 69 | 70 | ## TensorFlow Version 71 | Thanks tuvovan (vovantu.hust@gmail.com) who re-produces our code by TF. The results of TF version look similar with our Pytorch version. But I do not have enough time to check the details. 72 | https://github.com/tuvovan/Zero_DCE_TF 73 | -------------------------------------------------------------------------------- /Zero-DCE.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Zero-Reference Deep Curve Estimation for Low-Light Image Enhancement 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 22 | 24 | 25 | 26 | 36 | 132 | 133 | 134 |
135 |
136 |
137 |

138 | Zero-Reference Deep Curve Estimation (Zero-DCE) 139 |

140 |

for Low-Light Image Enhancement

141 | 142 |
143 | Chunle Guo 1   144 | Chongyi Li 2   145 | Jichang Guo 1   146 | Chen Change Loy 3  147 | Junhui Hou 2  148 | Sam Kwong 2  149 | Runmin Cong 4 150 |
151 | 152 |
153 | 1 Tianjin University, Tianjin, China
154 | 2 City University of Hong Kong, Hong Kong
155 | 3 Nanyang Technological University, Singapore
156 | 4 Beijing Jiaotong University, Beijing, China 157 |
158 | 166 |
167 |
168 |
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 |
  1. 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.

  2. 201 |
  3. 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.

  4. 202 |
  5. 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.

  6. 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 |

235 |
236 | 237 |

4. Self-training (taking first 100 frames as training data) for Low-light Video Enhancement

238 |
239 |
240 |

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 | 305 | 306 | 312 | 318 | 324 | 325 |
307 |
308 |

309 | Paper 310 |
311 |
313 |
314 |

315 | Supplementary Material 316 |
317 |
319 |
320 |

321 | Code and Model 322 |
323 |
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 |
342 |

Contact

343 |

If you have any questions, please contact Chongyi Li at lichongyi25@gmail.com or Chunle Guo at guochunle@tju.edu.cn.

344 |
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;i0&&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("\x3c/script>')):(e=M.createElement("script"),e.type="text/javascript",e.async=!0,e.src=ca,a&&e.setAttribute("nonce",a),ca=M.getElementsByTagName("script")[0],ca.parentNode.insertBefore(e,ca));$d.set(b,!0)}}}},v=function(a,b){var c=A.get(a)|| 69 | [];c.push(b);A.set(a,c)},C=function(a,b){Yd.set(a,b);b=A.get(a)||[];for(var c=0;ca.split("/")[0].indexOf(":")&&(a=ca+e[2].substring(0,e[2].lastIndexOf("/"))+"/"+a);c.href=a; 71 | d=b(c);return{protocol:(c.protocol||"").toLowerCase(),host:d[0],port:d[1],path:d[2],query:c.search||"",url:a||""}};var Z={ga:function(){Z.f=[]}};Z.ga();Z.D=function(a){var b=Z.J.apply(Z,arguments);b=Z.f.concat(b);for(Z.f=[];0c;c++){var d=b[c].src;if(d&&0==d.indexOf(bd(!0)+ 74 | "/analytics")){b=!0;break a}}b=!1}b&&(Ba=!0)}(O.gaplugins=O.gaplugins||{}).Linker=Dc;b=Dc.prototype;C("linker",Dc);X("decorate",b,b.ca,20);X("autoLink",b,b.S,25);C("displayfeatures",fd);C("adfeatures",fd);a=a&&a.q;ka(a)?Z.D.apply(N,a):J(50)}};N.da=function(){for(var a=N.getAll(),b=0;b= maxScopeX) { 35 | zoomMaskX = maxScopeX 36 | } 37 | let maxkScopeY = leftView.offsetHeight - maskHeight / 2 38 | if (zoomMaskY >= maxkScopeY) { 39 | zoomMaskY = maxkScopeY 40 | } 41 | mask.style.left = zoomMaskX + leftView.offsetLeft + 'px' 42 | mask.style.top = zoomMaskY + leftView.offsetTop + 'px' 43 | // rightView position 44 | if (fix > 0) { 45 | rightView.style.left = container.offsetWidth - 400 * 1.1 + 'px' 46 | rightView.style.top = container.offsetHeight + 10 + 'px' 47 | } else { 48 | rightView.style.left = currentMouseX + 30 + 'px' 49 | rightView.style.top = currentMouseY + 30 + 'px' 50 | } 51 | let zommProportion = bigImg.offsetWidth / leftView.offsetWidth 52 | bigImg.style.left = -zommProportion * (zoomMaskX + maskWidth / 2) + rightView.offsetWidth / 2 + 'px' 53 | bigImg.style.top = -zommProportion * (zoomMaskY + maskHeight / 2) + rightView.offsetHeight / 2 + 'px' 54 | 55 | }, false) 56 | } 57 | // light-box 58 | function openModal() { 59 | document.getElementById('myModal').style.display = "block"; 60 | } 61 | 62 | function closeModal() { 63 | document.getElementById('myModal').style.display = "none"; 64 | } 65 | 66 | function plusSlides(n) { 67 | showSlides(slideIndex += n); 68 | } 69 | 70 | function currentSlide(n) { 71 | showSlides(slideIndex = n); 72 | } 73 | 74 | function showSlides(n) { 75 | var i; 76 | var slides = document.getElementsByClassName("mySlides"); 77 | var dots = document.getElementsByClassName("dot"); 78 | 79 | if (n > slides.length) { 80 | slideIndex = 1 81 | } 82 | if (n < 1) { 83 | slideIndex = slides.length 84 | } 85 | for (i = 0; i < slides.length; i++) { 86 | slides[i].style.display = "none"; 87 | } 88 | for (i = 0; i < dots.length; i++) { 89 | dots[i].className = dots[i].className.replace(" active", ""); 90 | } 91 | slides[slideIndex - 1].style.display = "block"; 92 | dots[slideIndex - 1].className += " active"; 93 | } -------------------------------------------------------------------------------- /Zero-DCE_files/face.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangyin0810/Zero-DCE/cb3399bbf66f17391f208c08815e73f76fbc6f00/Zero-DCE_files/face.png -------------------------------------------------------------------------------- /Zero-DCE_files/framework.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangyin0810/Zero-DCE/cb3399bbf66f17391f208c08815e73f76fbc6f00/Zero-DCE_files/framework.png -------------------------------------------------------------------------------- /Zero-DCE_files/icon_github.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangyin0810/Zero-DCE/cb3399bbf66f17391f208c08815e73f76fbc6f00/Zero-DCE_files/icon_github.png -------------------------------------------------------------------------------- /Zero-DCE_files/latest.js.download: -------------------------------------------------------------------------------- 1 | /* 2 | * /MathJax/latest.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 | (function(){var h={"cdnjs.cloudflare.com":{api:"https://api.cdnjs.com/libraries/mathjax?fields=version",version:"version",mathjax:"https://cdnjs.cloudflare.com/ajax/libs/mathjax/"},"cdn.rawgit.com":{api:"https://api.github.com/repos/mathjax/mathjax/releases/latest",version:"tag_name",mathjax:"https://cdn.rawgit.com/mathjax/MathJax/"},"cdn.jsdelivr.net":{api:"https://api.jsdelivr.com/v1/jsdelivr/libraries?name=mathjax&lastversion=*",version:"lastversion",mathjax:"https://cdn.jsdelivr.net/mathjax/"}};function g(q){if(console&&console.log){console.log(q)}}function e(){if(document.currentScript){return document.currentScript}var r=document.getElementsByTagName("script");for(var v=0,q=r.length;v element")}}function i(){var q=e();if(q){o(q.src.replace(/\/latest\.js/,"/MathJax.js"))}else{g("Can't determine the URL for loading MathJax")}}function m(q,r,s){var t=j();if(t){t.onreadystatechange=function(){if(t.readyState===4){if(t.status===200){var v=JSON.parse(t.responseText);if(v instanceof Array){v=v[0]}var u=v[q.version];if(u.substr(0,2)==="2."){c(u);o(q.mathjax+v[q.version]+s+"/MathJax.js"+r);return}}else{g("Problem acquiring MathJax version: status = "+t.status)}i()}};t.open("GET",q.api,true);t.send(null)}else{g("Can't create XMLHttpRequest object");i()}}var n=e();var p=a(n);if(p){var b=n.src.replace(/.*?(\?|$)/,"$1");b+=(b?"&":"?")+"latest";var f=(n.src.match(/\/unpacked\/latest\.js/)?"/unpacked":"");var k=d();if(k){o(p.mathjax+k+f+"/MathJax.js"+b)}else{m(p,b,f)}}else{i()}})(); 20 | -------------------------------------------------------------------------------- /Zero-DCE_files/loss.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangyin0810/Zero-DCE/cb3399bbf66f17391f208c08815e73f76fbc6f00/Zero-DCE_files/loss.png -------------------------------------------------------------------------------- /Zero-DCE_files/paper.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangyin0810/Zero-DCE/cb3399bbf66f17391f208c08815e73f76fbc6f00/Zero-DCE_files/paper.png -------------------------------------------------------------------------------- /Zero-DCE_files/paper_thumbnail.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangyin0810/Zero-DCE/cb3399bbf66f17391f208c08815e73f76fbc6f00/Zero-DCE_files/paper_thumbnail.jpg -------------------------------------------------------------------------------- /Zero-DCE_files/parameter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangyin0810/Zero-DCE/cb3399bbf66f17391f208c08815e73f76fbc6f00/Zero-DCE_files/parameter.png -------------------------------------------------------------------------------- /Zero-DCE_files/project.css: -------------------------------------------------------------------------------- 1 | html, 2 | body { 3 | margin: 10px 0px; 4 | padding: 0px; 5 | text-align: center; 6 | background-color: #EEEEEE; 7 | font-family: 'Open Sans', Arial, Helvetica, sans-serif; 8 | -webkit-text-size-adjust: none; 9 | } 10 | 11 | table { 12 | /*border: 1px solid black;*/ 13 | border: none; 14 | border-collapse: collapse; 15 | } 16 | 17 | th, 18 | td { 19 | /* border: 1px solid black; */ 20 | border: none; 21 | padding: 5px; 22 | } 23 | 24 | #content { 25 | width: auto; 26 | max-width: 960px; 27 | min-width: 800px; 28 | height: auto !important; 29 | height: 100%; 30 | min-height: 100%; 31 | margin: 0 auto; 32 | text-align: left; 33 | /* border:1px solid #777; */ 34 | background-color: white; 35 | box-shadow: 0px 1px 5px #999; 36 | font-family: 'Open Sans', sans-serif; 37 | font-size: 12pt; 38 | /* line-height: 2; */ 39 | -webkit-text-size-adjust: none; 40 | } 41 | 42 | #content-inner { 43 | padding: 15px 0; 44 | } 45 | 46 | #teaseimg { 47 | height: auto; 48 | width: 50%; 49 | box-shadow: 0px 0px 10px #444444; 50 | border: 1px solid #000000; 51 | } 52 | 53 | /* for enlarging images */ 54 | 55 | .img_container { 56 | position: relative; 57 | /* background: rgba(96, 248, 50, 0.4); */ 58 | z-index: 1 59 | } 60 | 61 | .img_container .leftView { 62 | width: 95%; 63 | /* background: rgba(248, 73, 50, 0.4); */ 64 | /*box-shadow: 3px 8px 5px 0px rgba(0, 0, 0, 0.2)*/ 65 | } 66 | 67 | .img_container .leftView .mask { 68 | width: 160px; 69 | height: 160px; 70 | position: absolute; 71 | display: none; 72 | cursor: move; 73 | top: 0; 74 | left: 0; 75 | background: rgba(50, 153, 248, 0.4); 76 | } 77 | 78 | .img_container .leftView .small { 79 | width: 65%; 80 | position:relative; 81 | } 82 | 83 | .img_container .leftView .std { 84 | width: 100%; 85 | position:relative; 86 | } 87 | 88 | .img_container .leftView .big { 89 | width: 110%; 90 | position:relative; 91 | } 92 | .img_container .rightView { 93 | width: 400px; 94 | height: 400px; 95 | display: none; 96 | position: absolute; 97 | top: 0px; 98 | left: 0px; 99 | overflow: hidden; 100 | background-color: white; 101 | box-shadow: 0px 1px 5px #999; 102 | border: 4px solid rgb(50, 153, 248) 103 | } 104 | 105 | .img_container .rightView .big { 106 | /* width: 1200%; */ 107 | position: absolute; 108 | top: 0; 109 | left: 0; 110 | z-index: 5 111 | } 112 | 113 | #tabs { 114 | overflow: hidden; 115 | position: relative; 116 | bottom: -7px; 117 | width: 100%; 118 | margin: 0; 119 | padding: 0; 120 | list-style: none; 121 | } 122 | 123 | #tabs li { 124 | float: left; 125 | margin: 0 -15px 0 0; 126 | } 127 | 128 | #tabs a { 129 | float: left; 130 | position: relative; 131 | padding: 0 40px; 132 | height: 0; 133 | line-height: 30px; 134 | text-transform: uppercase; 135 | text-decoration: none; 136 | color: #fff; 137 | border-right: 30px solid transparent; 138 | border-bottom: 30px solid #3D3D3D; 139 | /* border-bottom-color: #777\9; */ 140 | opacity: .3; 141 | filter: alpha(opacity=30); 142 | } 143 | 144 | #tabs a:hover, 145 | #tabs a:focus { 146 | border-bottom-color: #2ac7e1; 147 | opacity: 1; 148 | filter: alpha(opacity=100); 149 | } 150 | 151 | #tabs a:focus { 152 | outline: 0; 153 | } 154 | 155 | #tabs #current { 156 | z-index: 3; 157 | border-bottom-color: #3d3d3d; 158 | opacity: 1; 159 | filter: alpha(opacity=100); 160 | } 161 | 162 | #tabs a { 163 | height: 0; 164 | line-height: 30px; 165 | border-right: 30px solid transparent; 166 | border-bottom: 30px solid #3D3D3D; 167 | } 168 | 169 | hr.smooth { 170 | border: 0; 171 | height: 1px; 172 | width: 100%; 173 | background: #333; 174 | background-image: -webkit-linear-gradient(left, #ccc, #333, #ccc); 175 | background-image: -moz-linear-gradient(left, #ccc, #333, #ccc); 176 | background-image: -ms-linear-gradient(left, #ccc, #333, #ccc); 177 | background-image: -o-linear-gradient(left, #ccc, #333, #ccc); 178 | } 179 | 180 | a:link { 181 | color: #0066CC; 182 | text-decoration: none 183 | } 184 | 185 | a:visited { 186 | color: #743399; 187 | text-decoration: none 188 | } 189 | 190 | a:hover { 191 | color: #FF4B33; 192 | text-decoration: none 193 | } 194 | 195 | a:active { 196 | color: #FF4B33; 197 | text-decoration: none 198 | } 199 | 200 | /* Some of this has been copied from http://www.mpi-inf.mpg.de/resources/rgbz-camera/ */ 201 | 202 | /* Sections of the page. */ 203 | 204 | .section { 205 | margin: 2em 2em 0.5em 2em; 206 | line-height: 130%; 207 | } 208 | 209 | .section h2 { 210 | margin-top: 0.5em; 211 | margin-bottom: 0.2em; 212 | } 213 | 214 | /* Logo section. */ 215 | 216 | .logos { 217 | margin: 1.5em 0; 218 | text-align: center; 219 | margin-top: 5px; 220 | margin-bottom: 10px; 221 | } 222 | 223 | .logos img { 224 | vertical-align: top; 225 | margin: 0 1.25em; 226 | border: 0; 227 | } 228 | 229 | /* Page header. */ 230 | 231 | .head { 232 | text-align: center; 233 | margin: 0.6em 0; 234 | padding: 0.6em 0; 235 | background-color: #f3ecec40; 236 | text-shadow: 1px 1px 3px #cccccc; 237 | } 238 | 239 | .head { 240 | color: #111; 241 | } 242 | 243 | .head h1 { 244 | font-size: 24pt; 245 | line-height: 27pt; 246 | margin: 10px 0; 247 | } 248 | 249 | .head h1 a { 250 | text-decoration: none; 251 | } 252 | 253 | .authors { 254 | font-size: 14pt; 255 | margin: 0 0 1em 0; 256 | } 257 | 258 | .affiliations { 259 | font-size: 13pt; 260 | margin: -0.5em 0 10pt 0; 261 | } 262 | 263 | .venue { 264 | font-style: italic; 265 | font-size: 12pt; 266 | margin: 1em 0 1em 0; 267 | } 268 | 269 | .tagline { 270 | font-style: italic; 271 | font-size: 10.5pt; 272 | margin: 1em 0 1em 0; 273 | } 274 | 275 | /* Specific section styling. */ 276 | 277 | .teaser { 278 | margin: 1.5em 0; 279 | text-align: center; 280 | } 281 | 282 | div.content-primary .teaser p img { 283 | display: block; 284 | float: none; 285 | border: 0; 286 | margin: 4em auto 1em auto; 287 | } 288 | 289 | .abstract { 290 | line-height: 130%; 291 | } 292 | 293 | .abstract p { 294 | margin-top: 0; 295 | } 296 | 297 | .downloads ul { 298 | margin-top: 0.5em; 299 | } 300 | 301 | .list ul { 302 | margin-top: 0.5em; 303 | } 304 | 305 | .bibtex pre { 306 | margin-bottom: 0; 307 | font-family: Consolas, Monaco, monospace; 308 | white-space: pre-wrap; 309 | /* CSS 3 */ 310 | white-space: -moz-pre-wrap; 311 | /* Mozilla, since 1999 */ 312 | white-space: -pre-wrap; 313 | /* Opera 4-6 */ 314 | white-space: -o-pre-wrap; 315 | /* Opera 7 */ 316 | word-wrap: break-word; 317 | /* IE 5.5+ */ 318 | width: 100%; 319 | color: #444; 320 | padding: 2px; 321 | background: #eee; 322 | border: 1px solid #ccc; 323 | overflow: auto; 324 | } 325 | 326 | .acknowledgments { 327 | line-height: 130%; 328 | } 329 | 330 | .acknowledgments p { 331 | margin-top: 0; 332 | } 333 | 334 | .contact { 335 | line-height: 130%; 336 | } 337 | 338 | .heading { 339 | margin: 2.5em 0; 340 | text-align: center; 341 | } 342 | 343 | .datasets { 344 | width: 650px; 345 | margin: 3em auto; 346 | } 347 | 348 | .datasets ul { 349 | padding-bottom: 1em; 350 | } 351 | 352 | .dataset { 353 | float: left; 354 | width: 204px; 355 | margin: 5px 10px 15px 0px; 356 | text-align: center; 357 | } 358 | 359 | .dataset h2 { 360 | display: inline; 361 | } 362 | 363 | .dataset img { 364 | border: 2px solid #222; 365 | margin: 0.25em auto; 366 | display: block; 367 | } 368 | 369 | .backlink { 370 | text-align: center; 371 | } 372 | 373 | /* Display lists in a grid of fixed size. This is useful when lists have associated images. */ 374 | 375 | /* Idea from http://blog.mozilla.org/webdev/2009/02/20/cross-browser-inline-block/ */ 376 | 377 | li.grid { 378 | width: auto; 379 | height: auto; 380 | /* border: 1px solid #000; */ 381 | display: -moz-inline-stack; 382 | display: inline-block; 383 | vertical-align: top; 384 | margin: 5px; 385 | zoom: 1; 386 | *display: inline; 387 | _height: 100px; 388 | } 389 | 390 | /* Formatting for each item in a 2D grid. This is used typically in the downloads section. */ 391 | 392 | .griditem { 393 | font-size: 10pt; 394 | text-align: center; 395 | padding: 5px 5px 5px 5px; 396 | } 397 | 398 | .griditem img { 399 | text-align: center; 400 | height: 120px; 401 | width: auto; 402 | } 403 | 404 | /* light-box */ 405 | 406 | body { 407 | font-family: Verdana, sans-serif; 408 | margin: 0; 409 | } 410 | 411 | * { 412 | box-sizing: border-box; 413 | } 414 | 415 | .row>.column { 416 | padding: 0 8px; 417 | } 418 | 419 | .row:after { 420 | content: ""; 421 | display: table; 422 | clear: both; 423 | } 424 | 425 | .column { 426 | float: left; 427 | width: 100%; 428 | } 429 | 430 | /* The Modal (background) */ 431 | 432 | .modal { 433 | display: none; 434 | position: fixed; 435 | z-index: 1; 436 | padding-top: 100px; 437 | left: 0; 438 | top: 0; 439 | width: 100%; 440 | height: 100%; 441 | overflow: auto; 442 | background-color: black; 443 | } 444 | 445 | /* Modal Content */ 446 | 447 | .modal-content { 448 | position: relative; 449 | /* background-color: #fefefe; */ 450 | margin: auto; 451 | padding: 0; 452 | width: 90%; 453 | max-width: 1400px; 454 | } 455 | 456 | /* The Close Button */ 457 | 458 | .close { 459 | color: white; 460 | position: absolute; 461 | top: 10px; 462 | right: 25px; 463 | font-size: 35px; 464 | font-weight: bold; 465 | } 466 | 467 | .close:hover, 468 | .close:focus { 469 | color: #999; 470 | text-decoration: none; 471 | cursor: pointer; 472 | } 473 | 474 | .mySlides { 475 | display: none; 476 | } 477 | 478 | .cursor { 479 | cursor: pointer 480 | } 481 | 482 | /* Next & previous buttons */ 483 | 484 | .prev, 485 | .next { 486 | cursor: pointer; 487 | position: absolute; 488 | top: 50%; 489 | width: auto; 490 | padding: 16px; 491 | margin-top: -50px; 492 | color: rgb(0, 17, 253); 493 | font-weight: bold; 494 | font-size: 50px; 495 | transition: 0.6s ease; 496 | border-radius: 0 3px 3px 0; 497 | user-select: none; 498 | -webkit-user-select: none; 499 | } 500 | 501 | .next { 502 | right: 0; 503 | border-radius: 3px 0 0 3px; 504 | } 505 | 506 | .prev:hover, 507 | .next:hover { 508 | background-color: rgba(146, 10, 224, 0.486); 509 | } 510 | 511 | .numbertext { 512 | color: #f2f2f2; 513 | font-size: 12px; 514 | padding: 8px 12px; 515 | position: absolute; 516 | top: 0; 517 | } 518 | 519 | img { 520 | margin-bottom: 0px; 521 | } 522 | 523 | .caption-container { 524 | text-align: center; 525 | background-color: black; 526 | padding: 2px 16px; 527 | color: white; 528 | } 529 | 530 | /* The dots/bullets/indicators */ 531 | 532 | .dot { 533 | cursor: pointer; 534 | height: 15px; 535 | width: 15px; 536 | margin: 0 2px; 537 | background-color: #bbb; 538 | border-radius: 50%; 539 | display: inline-block; 540 | transition: background-color 0.6s ease; 541 | } 542 | 543 | .active, 544 | .dot:hover { 545 | background-color: #717171; 546 | } 547 | 548 | img.hover-shadow { 549 | transition: 0.3s; 550 | box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.2), 0 3px 10px 0 rgba(0, 0, 0, 0.19) 551 | } 552 | 553 | .hover-shadow:hover { 554 | box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.4), 0 6px 20px 0 rgba(0, 0, 0, 0.36) 555 | } -------------------------------------------------------------------------------- /Zero-DCE_files/results.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangyin0810/Zero-DCE/cb3399bbf66f17391f208c08815e73f76fbc6f00/Zero-DCE_files/results.png -------------------------------------------------------------------------------- /Zero-DCE_files/training.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangyin0810/Zero-DCE/cb3399bbf66f17391f208c08815e73f76fbc6f00/Zero-DCE_files/training.png --------------------------------------------------------------------------------