{"id":25999628,"url":"https://github.com/jinyeying/night-enhancement","last_synced_at":"2025-03-05T18:40:51.726Z","repository":{"id":45774966,"uuid":"514501472","full_name":"jinyeying/night-enhancement","owner":"jinyeying","description":"[ECCV2022] \"Unsupervised Night Image Enhancement: When Layer Decomposition Meets Light-Effects Suppression\",  https://arxiv.org/abs/2207.10564","archived":false,"fork":false,"pushed_at":"2024-08-29T03:54:01.000Z","size":46553,"stargazers_count":386,"open_issues_count":1,"forks_count":34,"subscribers_count":5,"default_branch":"main","last_synced_at":"2024-08-29T09:42:51.800Z","etag":null,"topics":["deep-learning","flare","glare","glow","image-enhancement","light-effects","low-level-vision","low-light","low-light-enhance","low-light-image","low-light-image-enhancement","night","night-images","nighttime","nighttime-lights","restoration"],"latest_commit_sha":null,"homepage":"https://github.com/jinyeying/night-enhancement","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jinyeying.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-07-16T06:47:06.000Z","updated_at":"2024-08-29T03:54:06.000Z","dependencies_parsed_at":"2023-11-16T12:25:26.118Z","dependency_job_id":"7b2228fe-9be6-4992-b2ce-d2d184c5d012","html_url":"https://github.com/jinyeying/night-enhancement","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jinyeying%2Fnight-enhancement","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jinyeying%2Fnight-enhancement/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jinyeying%2Fnight-enhancement/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jinyeying%2Fnight-enhancement/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jinyeying","download_url":"https://codeload.github.com/jinyeying/night-enhancement/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242082566,"owners_count":20069149,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["deep-learning","flare","glare","glow","image-enhancement","light-effects","low-level-vision","low-light","low-light-enhance","low-light-image","low-light-image-enhancement","night","night-images","nighttime","nighttime-lights","restoration"],"created_at":"2025-03-05T18:40:42.829Z","updated_at":"2025-03-05T18:40:51.705Z","avatar_url":"https://github.com/jinyeying.png","language":"HTML","funding_links":[],"categories":["HTML"],"sub_categories":[],"readme":"# night_enhancement (ECCV'2022)\n\n## Introduction\nThis is an implementation of the following paper.\n\u003e [Unsupervised Night Image Enhancement: When Layer Decomposition Meets Light-Effects Suppression](https://arxiv.org/abs/2207.10564)\\\n\u003e European Conference on Computer Vision (`ECCV'2022`)\n\n[Yeying Jin](https://jinyeying.github.io/), [Wenhan Yang](https://flyywh.github.io/) and [Robby T. Tan](https://tanrobby.github.io/pub.html)\n\n[[Paper]](https://www.ecva.net/papers/eccv_2022/papers_ECCV/papers/136970396.pdf)\n[[Supplementary]](https://www.ecva.net/papers/eccv_2022/papers_ECCV/papers/136970396-supp.pdf)\n[![arXiv](https://img.shields.io/badge/arXiv-Paper-\u003cCOLOR\u003e.svg)](https://arxiv.org/abs/2207.10564)\n[[Poster]](https://github.com/jinyeying/night-enhancement/blob/main/poster_slides/0982_poster.pdf) \n[[Slides]](https://github.com/jinyeying/night-enhancement/blob/main/poster_slides/0982_slides.pdf) \n[[Link]](https://mp.weixin.qq.com/s/5wjV6R95SrQHXxqMnENAAw)\n[[Video]](https://www.bilibili.com/video/BV1Ec411s7at/?share_source=copy_web\u0026vd_source=de01cad5025255c4901de808728937c0)\n\n[![PWC](https://img.shields.io/endpoint.svg?url=https://paperswithcode.com/badge/unsupervised-night-image-enhancement-when/low-light-image-enhancement-on-lol)](https://paperswithcode.com/sota/low-light-image-enhancement-on-lol?p=unsupervised-night-image-enhancement-when)\n🔥[![Replicate](https://replicate.com/cjwbw/night-enhancement/badge)](https://replicate.com/cjwbw/night-enhancement)🔥\n\n\n## Prerequisites, or follow [bilibili](https://www.bilibili.com/video/BV1Nv4y1B7Mp/?spm_id_from=333.337.search-card.all.click)\n```\ngit clone https://github.com/jinyeying/night-enhancement.git\ncd night-enhancement/\nconda create -n night python=3.7\nconda activate night\nconda install pytorch=1.10.2 torchvision torchaudio cudatoolkit=11.3 -c pytorch\npython3 -m pip install -r requirements.txt\n```\n\n## Datasets\n### Light-Effects Suppression on Night Data\n1. Light-effects data [[Dropbox]](https://www.dropbox.com/sh/ro8fs629ldebzc2/AAD_W78jDffsJhH-smJr0cNSa?dl=0) | [[BaiduPan (code:self)]](https://pan.baidu.com/s/1x6HHdi-YlO7USkNQrp23ng?pwd=self) \u003cbr\u003e\nLight-effects data is collected from Flickr and by ourselves, with multiple light colors in various scenes. \u003cbr\u003e\n* `CVPR2021`\n*Nighttime Visibility Enhancement by Increasing the Dynamic Range and Suppression of Light Effects* [[Paper]](https://openaccess.thecvf.com/content/CVPR2021/papers/Sharma_Nighttime_Visibility_Enhancement_by_Increasing_the_Dynamic_Range_and_Suppression_CVPR_2021_paper.pdf)\\\n[Aashish Sharma](https://aasharma90.github.io/) and [Robby T. Tan](https://tanrobby.github.io/pub.html)\n\n\u003cp align=\"left\"\u003e\n  \u003cimg width=950\" src=\"teaser/self-collected.png\"\u003e\n\u003c/p\u003e\n\n2. LED data [[Dropbox]](https://www.dropbox.com/sh/7lhpnj2onb8c3dl/AAC-UF1fvJLxvCG-IuYLQ8T4a?dl=0) | [[BaiduPan (code:ledl)]](https://pan.baidu.com/s/1jVYjvLkoBLXtGZVDj2JJZA?pwd=ledl) \u003cbr\u003e\nWe captured images with dimmer light as the reference images.\n\u003cp align=\"left\"\u003e\n  \u003cimg width=350\" src=\"teaser/LED.PNG\"\u003e\n\u003c/p\u003e\n\n3. GTA5 nighttime fog [[Dropbox]](https://www.dropbox.com/sh/gfw44ttcu5czrbg/AACr2GZWvAdwYPV0wgs7s00xa?dl=0) | [[BaiduPan (code:67ml)]](https://pan.baidu.com/s/1hW9wfVhvYbRaUdHbozOPbw?pwd=67ml) \u003cbr\u003e\nSynthetic GTA5 nighttime fog data.\u003cbr\u003e \n* `ECCV2020`\n*Nighttime Defogging Using High-Low Frequency Decomposition and Grayscale-Color Networks* [[Paper]](https://www.ecva.net/papers/eccv_2020/papers_ECCV/papers/123570460.pdf)\\\nWending Yan, [Robby T. Tan](https://tanrobby.github.io/pub.html) and [Dengxin Dai](https://vas.mpi-inf.mpg.de/) \n\n\u003cp align=\"left\"\u003e\n  \u003cimg width=350\" src=\"teaser/GTA5.PNG\"\u003e\n\u003c/p\u003e\n\n4. Syn-light-effects [[Dropbox]](https://www.dropbox.com/sh/2sb9na4ur7ry2gf/AAB1-DNxy4Hq6qPU-afYIKVaa?dl=0) | [[BaiduPan (code:synt)]](https://pan.baidu.com/s/1nfg2FnlBbh_QoBJM6nsY8g?pwd=synt) \u003cbr\u003e\nSynthetic-light-effects data is the implementation of the paper:\u003cbr\u003e\n* `ICCV2017`\n*A New Convolution Kernel for Atmospheric Point Spread Function Applied to Computer Vision* [[Paper]](https://ieeexplore.ieee.org/document/4408899)\\\nRun the [Matlab code](https://github.com/jinyeying/night-enhancement/blob/main/glow_rendering_code/repro_ICCV2007_Fig5.m) to generate Syn-light-effects:\n```\nglow_rendering_code/repro_ICCV2007_Fig5.m\n```\n\u003cp align=\"left\"\u003e\n  \u003cimg width=350\" src=\"teaser/syn.PNG\"\u003e\n\u003c/p\u003e\n\n# 1. Low-Light Enhancement:\n## Pre-trained Model\n1. Download the pre-trained LOL model [[Dropbox]](https://www.dropbox.com/s/0ykpsm1d48f74ao/LOL_params_0900000.pt?dl=0) | [[BaiduPan (code:lol2)]](https://pan.baidu.com/s/10VL4ZhV13zfokmRSBTOKyg?pwd=lol2), put in `./results/LOL/model/`\n2. Put the test images in `./LOL/`\n\n## Low-light Enhancement Test \n🔥[![Replicate](https://replicate.com/cjwbw/night-enhancement/badge)](https://replicate.com/cjwbw/night-enhancement)🔥 Online test: https://replicate.com/cjwbw/night-enhancement\n\u003cp align=\"left\"\u003e\n  \u003cimg width=\"750\" src=\"teaser/lowlight_enhance.png\"\u003e\n\u003c/p\u003e\n\n```\npython main.py\n```\n\n## Low-light Enhancement Train\n1. Download Low-Light Enhancement Dataset\n\n1.1 [LOL dataset](https://daooshee.github.io/BMVC2018website/) \u003cbr\u003e\n\"Deep Retinex Decomposition for Low-Light Enhancement\", BMVC, 2018. [[Baiduyun (code:sdd0)]](https://pan.baidu.com/s/1spt0kYU3OqsQSND-be4UaA) | [[Google Drive]](https://drive.google.com/file/d/18bs_mAREhLipaM2qvhxs7u7ff2VSHet2/view?usp=sharing) \u003cbr\u003e\n\n1.2 [LOL_Cap dataset](https://github.com/flyywh/CVPR-2020-Semi-Low-Light/) \u003cbr\u003e\n\"Sparse Gradient Regularized Deep Retinex Network for Robust Low-Light Image Enhancement\", TIP, 2021. [[Baiduyun (code:l9xm)]](https://pan.baidu.com/s/1U9ePTfeLlnEbr5dtI1tm5g) | [[Google Drive]](https://drive.google.com/file/d/1dzuLCk9_gE2bFF222n3-7GVUlSVHpMYC/view?usp=sharing) \u003cbr\u003e \n\n```\n|-- LOL_Cap\n    |-- trainA ## Low \n    |-- trainB ## Normal\n    |-- testA  ## Low \n    |-- testB  ## Normal\n\n```\n\n2. There is no decomposition, light-effects guidance for low-light enhancement. \n```\nCUDA_VISIBLE_DEVICES=1 python main.py --dataset LOL --phase train --datasetpath /home1/yeying/data/LOL_Cap/\n```\n\u003cp align=\"left\"\u003e\n  \u003cimg width=\"750\" src=\"teaser/lowlight_enhancement.PNG\"\u003e\n\u003c/p\u003e\n\n## Low-light Enhancement Results\n\u003cp align=\"left\"\u003e\n  \u003cimg width=\"750\" src=\"teaser/lowlight.PNG\"\u003e\n\u003c/p\u003e\n\n1. LOL-test Results (15 test images) [[Dropbox]](https://www.dropbox.com/sh/la21ocjk14dtg9t/AABOBsCQ39Oml33fItqX5koFa?dl=0) | [[BaiduPan (code:lol1)]](https://pan.baidu.com/s/1ZnUrz90IvxvrkBync_TR-Q?pwd=lol1)\u003cbr\u003e\n\nGet the following Table 3 in the main paper on the LOL-test dataset.\n|Learning| Method | PSNR | SSIM | \n|--------|--------|------|------ |\n| Unsupervised Learning| **Ours** | **21.521** |**0.7647**|\n| N/A | Input | 7.773 | 0.1259|\n\n\u003cp align=\"left\"\u003e\n  \u003cimg width=\"350\" src=\"teaser/LOL.PNG\"\u003e\n\u003c/p\u003e\n\n2. LOL_Cap Results (100 test images) [[Dropbox]](https://www.dropbox.com/sh/t6eb4aq025ctnhy/AADRRJNN3u-N8HApe1tFo19Ra?dl=0) | [[BaiduPan (code:lolc)]](https://pan.baidu.com/s/1DlRc53HsFXbZe4gch3kVcw?pwd=lolc)\u003cbr\u003e\n\nGet the following Table 4 in the main paper on the LOL-Real dataset.\n|Learning| Method | PSNR | SSIM | \n|--------|--------|------|------ |\n| Unsupervised Learning| **Ours** | **25.51** |**0.8015**|\n| N/A | Input | 9.72 | 0.1752|\n\n\u003cp align=\"left\"\u003e\n  \u003cimg width=\"350\" src=\"teaser/LOL_real.PNG\"\u003e\n\u003c/p\u003e\n\nRe-train (train from scratch) in LOL_V2_real (698 train images), and test on LOL_V2_real [[Dropbox]](https://www.dropbox.com/sh/7t1qgl4anlqcvle/AAAyOUHMoG5IkzCX5GQDPd1Oa?dl=0) | [[BaiduPan (code:lol2)]](https://pan.baidu.com/s/1HfPb6tJy7Nv7L9reukJ3Cw?pwd=lol2 ).\u003cbr\u003e\nPSNR: 20.85 (vs EnlightenGAN's 18.23), SSIM: 0.7243 (vs EnlightenGAN's 0.61).\n\n# 2. Light-Effects Suppression:\n## Pre-trained Model\n1. Download the pre-trained de-light-effects model [[Dropbox]](https://www.dropbox.com/s/9fif8itsu06quvn/delighteffects_params_0600000.pt?dl=0) | [[BaiduPan (code:dele)]](https://pan.baidu.com/s/1mvNiK3H-llUx56SDpDeS7g?pwd=dele), put in `./results/delighteffects/model/`\n2. Put the [test images](https://github.com/jinyeying/night-enhancement/tree/main/light-effects) in `./light-effects/`\n\n## Light-effects Suppression Test\n```\npython main_delighteffects.py\n```\n## [Decomposition1](demo_all.html) \n\u003cp align=\"left\"\u003e\n  \u003cimg width=\"350\" src=\"teaser/demo1.png\"\u003e\n\u003c/p\u003e\n\n[Inputs](./light-effects) are in `./light-effects/`, [Outputs](./light-effects-output) are in `./light-effects-output/`. \u003cbr\u003e\n`Inputs` and `Outputs` are `trainA` and `trainB` for the translation network.\n```\ndemo_all.ipynb\n```\n```\npython demo.py\n```\n\u003cp align=\"left\"\u003e\n  \u003cimg width=\"950\" src=\"teaser/light_effects.PNG\"\u003e\n\u003c/p\u003e\n\n## [Decomposition2](demo_separation.py) \n\u003cp align=\"left\"\u003e\n  \u003cimg width=\"350\" src=\"teaser/demo2.png\"\u003e\n\u003c/p\u003e\n\n[Inputs](./light-effects) are in `./light-effects/`, [Outputs](./light-effects-output/DSC01065/) are in `./light-effects-output/DSC01065/`. \u003cbr\u003e\n`Inputs` and `Outputs` are `trainA` and `trainB` for the translation network.\n```\npython demo_separation.py --img_name DSC01065.JPG \n```\n## [Decomposition3](./decomposition_code/demo_decomposition.m)\n```\ndemo_decomposition.m\n```\n`Inputs` and `Initial Background Results` are `trainA` and `trainB` for the translation network.\n\n| Initial Background Results [[Dropbox]](https://www.dropbox.com/sh/bis4350df85gz0e/AAC7wY92U9K5JW3aSaD0mvcya?dl=0) | Light-Effects Results [[Dropbox]](https://www.dropbox.com/sh/d7myjujl9gwotkz/AAA0iSsO1FbWqNkbB6QR-sLCa?dl=0) | Shading Results [[Dropbox]](https://www.dropbox.com/sh/venya8tvetyiv07/AABud1xlWGVquKptBsIZ0jxpa?dl=0) |\n| :-----------: | :-----------: |:-----------: |\n| [[BaiduPan (code:jjjj)]](https://pan.baidu.com/s/1a0C90-GZjGR38pt5qlam-g?pwd=jjjj) | [[BaiduPan (code:lele)]](https://pan.baidu.com/s/1o-Gcy1rOwuqaMtpDGIH9iw?pwd=lele) |  [[BaiduPan (code:llll)]](https://pan.baidu.com/s/1OzjE1mp4VZhP_IAKC-TLYg?pwd=llll)|\n\n\u003cp align=\"left\"\u003e\n  \u003cimg width=\"350\" src=\"teaser/decomposition.png\"\u003e\n\u003c/p\u003e\n\n## Light-effects Suppression Train\n```\nCUDA_VISIBLE_DEVICES=1 python main.py --dataset delighteffects --phase train --datasetpath /home1/yeying/data/light-effects/\n```\n\n### Feature Results:\n1. Run the [MATLAB code](https://github.com/jinyeying/night-enhancement/blob/main/VGG_code/checkGrayMerge.m) to adaptively fuse the three color channels, and output `I_gray`.\n```\ncheckGrayMerge.m\n```\n\u003cp align=\"left\"\u003e\n  \u003cimg width=\"350\" src=\"VGG_code/results_VGGfeatures/DSC01607_I_GrayBest.png\"\u003e\n\u003c/p\u003e\n\n2. Download the fine-tuned VGG model [[Dropbox]](https://www.dropbox.com/s/xzzoruz1i6m7mm0/model_best.tar?dl=0) | [[BaiduPan (code:dark)]](https://pan.baidu.com/s/1UZdo3R2I_ODJ7qVhZUcOkA?pwd=dark) (fine-tuned on [ExDark](https://github.com/cs-chan/Exclusively-Dark-Image-Dataset)), put in `./VGG_code/ckpts/vgg16_featureextractFalse_ExDark/nets/model_best.tar`\n\n3. Obtain structure features.\n```\npython test_VGGfeatures.py\n```\n\n## Summary of Comparisons:\n\u003cp align=\"left\"\u003e\n  \u003cimg width=\"350\" src=\"teaser/comparison.png\"\u003e\n\u003c/p\u003e\n\n## License\nThe code and models in this repository are licensed under the MIT License for academic and other non-commercial uses.\u003cbr\u003e\nFor commercial use of the code and models, separate commercial licensing is available. Please contact:\n- Yeying Jin (jinyeying@u.nus.edu)\n- Robby T. Tan (tanrobby@gmail.com)\n- Jonathan Tan (jonathan_tano@nus.edu.sg)\n\n## Acknowledgments\nThe decomposition code is implemented based on [DoubleDIP](https://github.com/yossigandelsman/DoubleDIP/blob/master/transparency_separation.py), [Layer Seperation](https://github.com/yu-li/yu-li.github.io/blob/master/paper/li_cvpr14_layer.zip) and LIME.\u003cbr\u003e\nThe translation code is implemented based on [U-GAT-IT](https://github.com/znxlwm/UGATIT-pytorch), we would like to thank them.\n\u003cbr\u003e One trick used in `networks.py` is to change `out = self.UpBlock2(x)` to [out = (self.UpBlock2(x)+input).tanh()](https://github.com/jinyeying/night-enhancement/blob/main/networks.py#L96) to learn a residual.\n\n### Citations\nIf this work is useful for your research, please cite our paper. \n```BibTeX\n@inproceedings{jin2022unsupervised,\n  title={Unsupervised night image enhancement: When layer decomposition meets light-effects suppression},\n  author={Jin, Yeying and Yang, Wenhan and Tan, Robby T},\n  booktitle={European Conference on Computer Vision},\n  pages={404--421},\n  year={2022},\n  organization={Springer}\n}\n\n@inproceedings{jin2023enhancing,\n  title={Enhancing visibility in nighttime haze images using guided apsf and gradient adaptive convolution},\n  author={Jin, Yeying and Lin, Beibei and Yan, Wending and Yuan, Yuan and Ye, Wei and Tan, Robby T},\n  booktitle={Proceedings of the 31st ACM International Conference on Multimedia},\n  pages={2446--2457},\n  year={2023}\n}\n```\nIf light-effects data is useful for your research, please cite the paper. \n```BibTeX\n@inproceedings{sharma2021nighttime,\n\ttitle={Nighttime Visibility Enhancement by Increasing the Dynamic Range and Suppression of Light Effects},\n\tauthor={Sharma, Aashish and Tan, Robby T},\n\tbooktitle={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition},\n\tpages={11977--11986},\n\tyear={2021}\n}\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjinyeying%2Fnight-enhancement","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjinyeying%2Fnight-enhancement","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjinyeying%2Fnight-enhancement/lists"}