{"id":13442393,"url":"https://github.com/swz30/Restormer","last_synced_at":"2025-03-20T13:33:31.221Z","repository":{"id":37480770,"uuid":"418793252","full_name":"swz30/Restormer","owner":"swz30","description":"[CVPR 2022--Oral] Restormer: Efficient Transformer for High-Resolution Image Restoration. SOTA  for motion deblurring, image deraining, denoising (Gaussian/real data), and defocus deblurring. ","archived":false,"fork":false,"pushed_at":"2024-08-16T07:38:40.000Z","size":1597,"stargazers_count":1950,"open_issues_count":48,"forks_count":249,"subscribers_count":17,"default_branch":"main","last_synced_at":"2025-03-14T03:02:55.502Z","etag":null,"topics":["cvpr2022","defocus-deblurring","efficient-transformers","high-resolution","image-deblurring","image-deraining","image-restoration","low-level-vision","motion-deblurring","pytorch","transformer"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/swz30.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2021-10-19T06:09:34.000Z","updated_at":"2025-03-13T15:45:13.000Z","dependencies_parsed_at":"2024-01-16T02:46:31.692Z","dependency_job_id":"e432bec1-cb91-40b2-b8fa-8c3e316c04be","html_url":"https://github.com/swz30/Restormer","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swz30%2FRestormer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swz30%2FRestormer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swz30%2FRestormer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swz30%2FRestormer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/swz30","download_url":"https://codeload.github.com/swz30/Restormer/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244619309,"owners_count":20482396,"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":["cvpr2022","defocus-deblurring","efficient-transformers","high-resolution","image-deblurring","image-deraining","image-restoration","low-level-vision","motion-deblurring","pytorch","transformer"],"created_at":"2024-07-31T03:01:45.166Z","updated_at":"2025-03-20T13:33:30.658Z","avatar_url":"https://github.com/swz30.png","language":"Python","funding_links":[],"categories":["Python","图像恢复"],"sub_categories":["资源传输下载"],"readme":"\n# Restormer: Efficient Transformer for High-Resolution Image Restoration (CVPR 2022 -- Oral)\n\n[Syed Waqas Zamir](https://scholar.google.ae/citations?hl=en\u0026user=POoai-QAAAAJ), [Aditya Arora](https://adityac8.github.io/), [Salman Khan](https://salman-h-khan.github.io/), [Munawar Hayat](https://scholar.google.com/citations?user=Mx8MbWYAAAAJ\u0026hl=en), [Fahad Shahbaz Khan](https://scholar.google.es/citations?user=zvaeYnUAAAAJ\u0026hl=en), and [Ming-Hsuan Yang](https://scholar.google.com/citations?user=p9-ohHsAAAAJ\u0026hl=en)\n\n[![paper](https://img.shields.io/badge/arXiv-Paper-\u003cCOLOR\u003e.svg)](https://arxiv.org/abs/2111.09881)\n[![supplement](https://img.shields.io/badge/Supplementary-Material-red)](https://drive.google.com/file/d/1oKGON8vG4uDWMmZKqHeTMnFowhOubifK/view?usp=sharing)\n[![video](https://img.shields.io/badge/Video-Presentation-F9D371)](https://www.youtube.com/watch?v=3mqu6N4_0pY\u0026t)\n[![slides](https://img.shields.io/badge/Presentation-Slides-B762C1)](https://drive.google.com/file/d/19wKhnQtr3mcD6IsLj0ZFSwCgIRKUkDQJ/view?usp=sharing)\n[![Summary](https://img.shields.io/badge/Summary-Slide-87CEEB)](https://drive.google.com/file/d/1wyKAMLzJpDqHiF6AMsmnmGQC241GyT8q/view?usp=sharing)\n\n\n#### News\n- **April 4, 2022:** Integrated into [Huggingface Spaces 🤗](https://huggingface.co/spaces) using [Gradio](https://github.com/gradio-app/gradio). Try out the web demo: [![Hugging Face Spaces](https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Spaces-blue)](https://huggingface.co/spaces/swzamir/Restormer)\n- **March 30, 2022:** Added Colab Demo. [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1C2818h7KnjNv4R1sabe14_AYL7lWhmu6?usp=sharing)\n- **March 29, 2022:** Restormer is selected for an ORAL presentation at CVPR 2022 :dizzy:\n- **March 10, 2022:** Training codes are released :fire:\n- **March 3, 2022:** Paper accepted at CVPR 2022 :tada: \n- **Nov 21, 2021:** Testing codes and pre-trained models are released!\n\n\u003chr /\u003e\n\n\u003e **Abstract:** *Since convolutional neural networks (CNNs) perform well at learning generalizable image priors from large-scale data, these models have been extensively applied to image restoration and related tasks. Recently, another class of neural architectures, Transformers, have shown significant performance gains on natural language and high-level vision tasks. While the Transformer model mitigates the shortcomings of CNNs (i.e., limited receptive field and inadaptability to input content), its computational complexity grows quadratically with the spatial resolution, therefore making it infeasible to apply to most image restoration tasks involving high-resolution images. In this work, we propose an efficient Transformer model by making several key designs in the building blocks (multi-head attention and feed-forward network) such that it can capture long-range pixel interactions, while still remaining applicable to large images. Our model, named Restoration Transformer (Restormer), achieves state-of-the-art results on several image restoration tasks, including image deraining, single-image motion deblurring, defocus deblurring (single-image and dual-pixel data), and image denoising (Gaussian grayscale/color denoising, and real image denoising).* \n\u003chr /\u003e\n\n## Network Architecture\n\n\u003cimg src = \"https://i.imgur.com/ulLoEig.png\"\u003e \n\n## Installation\n\nSee [INSTALL.md](INSTALL.md) for the installation of dependencies required to run Restormer.\n\n## Demo\n\nTo test the pre-trained Restormer models of [Deraining](https://drive.google.com/drive/folders/1ZEDDEVW0UgkpWi-N4Lj_JUoVChGXCu_u), [Motion Deblurring](https://drive.google.com/drive/folders/1czMyfRTQDX3j3ErByYeZ1PM4GVLbJeGK), [Defocus Deblurring](https://drive.google.com/drive/folders/1bRBG8DG_72AGA6-eRePvChlT5ZO4cwJ4?usp=sharing), and [Denoising](https://drive.google.com/drive/folders/1Qwsjyny54RZWa7zC4Apg7exixLBo4uF0) on your own images, you can either use Google Colab [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1C2818h7KnjNv4R1sabe14_AYL7lWhmu6?usp=sharing), or command line as following\n```\npython demo.py --task Task_Name --input_dir path_to_images --result_dir save_images_here\n```\nExample usage to perform Defocus Deblurring on a directory of images:\n```\npython demo.py --task Single_Image_Defocus_Deblurring --input_dir './demo/degraded/' --result_dir './demo/restored/'\n```\nExample usage to perform Defocus Deblurring on an image directly:\n```\npython demo.py --task Single_Image_Defocus_Deblurring --input_dir './demo/degraded/portrait.jpg' --result_dir './demo/restored/'\n```\n\n## Training and Evaluation\n\nTraining and Testing instructions for Deraining, Motion Deblurring, Defocus Deblurring, and Denoising are provided in their respective directories. Here is a summary table containing hyperlinks for easy navigation:\n\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003cth align=\"left\"\u003eTask\u003c/th\u003e\n    \u003cth align=\"center\"\u003eTraining Instructions\u003c/th\u003e\n    \u003cth align=\"center\"\u003eTesting Instructions\u003c/th\u003e\n    \u003cth align=\"center\"\u003eRestormer's Visual Results\u003c/th\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"left\"\u003eDeraining\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"Deraining/README.md#training\"\u003eLink\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"Deraining/README.md#evaluation\"\u003eLink\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://drive.google.com/drive/folders/1HcLc6v03q_sP_lRPcl7_NJmlB9f48TWU?usp=sharing\"\u003eDownload\u003c/a\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eMotion Deblurring\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"Motion_Deblurring/README.md#training\"\u003eLink\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"Motion_Deblurring/README.md#evaluation\"\u003eLink\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://drive.google.com/drive/folders/1qla3HEOuGapv1hqBwXEMi2USFPB2qmx_?usp=sharing\"\u003eDownload\u003c/a\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eDefocus Deblurring\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"Defocus_Deblurring/README.md#training\"\u003eLink\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"Defocus_Deblurring/README.md#evaluation\"\u003eLink\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://drive.google.com/drive/folders/1V_pLc9CZFe4vN7c4SxtXsXKi2FnLUt98?usp=sharing\"\u003eDownload\u003c/a\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eGaussian Denoising\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"Denoising/README.md#training\"\u003eLink\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"Denoising/README.md#evaluation\"\u003eLink\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://drive.google.com/drive/folders/1rEAHUBkA9uCe9Q0AzI5zkYxePSgxYDEG?usp=sharing\"\u003eDownload\u003c/a\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eReal Denoising\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"Denoising/README.md#training-1\"\u003eLink\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"Denoising/README.md#evaluation-1\"\u003eLink\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://drive.google.com/file/d/1CsEiN6R0hlmEoSTyy48nnhfF06P5aRR7/view?usp=sharing\"\u003eDownload\u003c/a\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n## Results\nExperiments are performed for different image processing tasks including, image deraining, single-image motion deblurring, defocus deblurring (both on single image and dual pixel data), and image denoising (both on Gaussian and real data). \n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eImage Deraining\u003c/strong\u003e (click to expand) \u003c/summary\u003e\n\n\u003cimg src = \"https://i.imgur.com/mMoqYJi.png\"\u003e \n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eSingle-Image Motion Deblurring\u003c/strong\u003e (click to expand) \u003c/summary\u003e\n\n\u003cp align=\"center\"\u003e\u003cimg src = \"https://i.imgur.com/htagDSl.png\" width=\"400\"\u003e\u003c/p\u003e\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eDefocus Deblurring\u003c/strong\u003e (click to expand) \u003c/summary\u003e\n\nS: single-image defocus deblurring.\nD: dual-pixel defocus deblurring.\n\n\u003cimg src = \"https://i.imgur.com/sfKnLG2.png\"\u003e \n\u003c/details\u003e\n\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eGaussian Image Denoising\u003c/strong\u003e (click to expand) \u003c/summary\u003e\n\nTop super-row: learning a single model to handle various noise levels.\nBottom super-row: training a separate model for each noise level.\n\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e \u003cimg src = \"https://i.imgur.com/4vzV8Qy.png\" width=\"400\"\u003e \u003c/td\u003e\n    \u003ctd\u003e \u003cimg src = \"https://i.imgur.com/Sx986Xs.png\" width=\"500\"\u003e \u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e\u003cp align=\"center\"\u003e\u003cb\u003eGrayscale\u003c/b\u003e\u003c/p\u003e\u003c/td\u003e\n    \u003ctd\u003e\u003cp align=\"center\"\u003e\u003cb\u003eColor\u003c/b\u003e\u003c/p\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eReal Image Denoising\u003c/strong\u003e (click to expand) \u003c/summary\u003e\n\n\u003cimg src = \"https://i.imgur.com/6v5PRxj.png\"\u003e\n\u003c/details\u003e\n\n## Citation\nIf you use Restormer, please consider citing:\n\n    @inproceedings{Zamir2021Restormer,\n        title={Restormer: Efficient Transformer for High-Resolution Image Restoration}, \n        author={Syed Waqas Zamir and Aditya Arora and Salman Khan and Munawar Hayat \n                and Fahad Shahbaz Khan and Ming-Hsuan Yang},\n        booktitle={CVPR},\n        year={2022}\n    }\n\n\n## Contact\nShould you have any question, please contact waqas.zamir@inceptioniai.org\n\n\n**Acknowledgment:** This code is based on the [BasicSR](https://github.com/xinntao/BasicSR) toolbox and [HINet](https://github.com/megvii-model/HINet). \n\n## Our Related Works\n- Learning Enriched Features for Fast Image Restoration and Enhancement, TPAMI 2022. [Paper](https://www.waqaszamir.com/publication/zamir-2022-mirnetv2/) | [Code](https://github.com/swz30/MIRNetv2)\n- Multi-Stage Progressive Image Restoration, CVPR 2021. [Paper](https://arxiv.org/abs/2102.02808) | [Code](https://github.com/swz30/MPRNet)\n- Learning Enriched Features for Real Image Restoration and Enhancement, ECCV 2020. [Paper](https://arxiv.org/abs/2003.06792) | [Code](https://github.com/swz30/MIRNet)\n- CycleISP: Real Image Restoration via Improved Data Synthesis, CVPR 2020. [Paper](https://arxiv.org/abs/2003.07761) | [Code](https://github.com/swz30/CycleISP)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fswz30%2FRestormer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fswz30%2FRestormer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fswz30%2FRestormer/lists"}