{"id":17225708,"url":"https://github.com/chaofengc/femasr","last_synced_at":"2025-05-08T23:30:53.175Z","repository":{"id":41476521,"uuid":"444701480","full_name":"chaofengc/FeMaSR","owner":"chaofengc","description":"PyTorch codes for \"Real-World Blind Super-Resolution via Feature Matching with Implicit High-Resolution Priors\", ACM MM2022 (Oral)","archived":false,"fork":false,"pushed_at":"2023-10-18T13:23:54.000Z","size":175165,"stargazers_count":220,"open_issues_count":7,"forks_count":15,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-03-31T19:21:18.101Z","etag":null,"topics":["blind-image-super-resolution","real-image-super-resolution","super-resolution","vqgan"],"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/chaofengc.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-01-05T07:13:32.000Z","updated_at":"2025-03-31T08:38:34.000Z","dependencies_parsed_at":"2024-11-15T03:14:40.436Z","dependency_job_id":null,"html_url":"https://github.com/chaofengc/FeMaSR","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/chaofengc%2FFeMaSR","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chaofengc%2FFeMaSR/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chaofengc%2FFeMaSR/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chaofengc%2FFeMaSR/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chaofengc","download_url":"https://codeload.github.com/chaofengc/FeMaSR/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253163482,"owners_count":21864086,"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":["blind-image-super-resolution","real-image-super-resolution","super-resolution","vqgan"],"created_at":"2024-10-15T04:14:16.881Z","updated_at":"2025-05-08T23:30:53.151Z","avatar_url":"https://github.com/chaofengc.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FeMaSR \n\nThis is the official PyTorch codes for the paper  \n[Real-World Blind Super-Resolution via Feature Matching with Implicit High-Resolution Priors (MM22 Oral)](https://arxiv.org/abs/2202.13142)  \n[Chaofeng Chen\\*](https://chaofengc.github.io), [Xinyu Shi\\*](https://github.com/Xinyu-Shi), [Yipeng Qin](http://yipengqin.github.io/), [Xiaoming Li](https://csxmli2016.github.io/), [Xiaoguang Han](https://mypage.cuhk.edu.cn/academics/hanxiaoguang/), [Tao Yang](https://github.com/yangxy), [Shihui Guo](http://guoshihui.net/)   \n(\\* indicates equal contribution)\n\n[![arXiv](https://img.shields.io/badge/arXiv-Paper-\u003cCOLOR\u003e.svg)](https://arxiv.org/abs/2202.13142)\n\u003ca href=\"https://colab.research.google.com/drive/1Yzb4o5OKjK46jbQ-_HGFOVJOPMVtJQjw?usp=sharing\"\u003e\u003cimg src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"google colab logo\"\u003e\u003c/a\u003e \n[![wandb](https://img.shields.io/badge/Weights_\u0026_Biases-FFBE00?\u0026logo=WeightsAndBiases\u0026logoColor=white)](https://wandb.ai/chaofeng/FeMaSR?workspace=user-chaofeng)\n![visitors](https://visitor-badge.laobi.icu/badge?page_id=chaofengc/FeMaSR)\n[![LICENSE](https://img.shields.io/badge/LICENSE-CC%20BY--NC--SA%204.0-lightgrey)](https://github.com/chaofengc/FeMaSR/blob/main/LICENSE)\n\n![framework_img](framework_overview.png)\n\n### Update\n\n- **2022.10.10** Release reproduce training log for SR stage in [![wandb](https://img.shields.io/badge/Weights_\u0026_Biases-FFBE00?\u0026logo=WeightsAndBiases\u0026logoColor=white)](https://wandb.ai/chaofeng/FeMaSR?workspace=user-chaofeng). Reach similar performance as the paper, `LPIPS: 0.329 @415k` for div2k (x4).\n- **2022.09.26** Add example training log with 70k iterations [![wandb](https://img.shields.io/badge/Weights_\u0026_Biases-FFBE00?\u0026logo=WeightsAndBiases\u0026logoColor=white)](https://wandb.ai/chaofeng/FeMaSR?workspace=user-chaofeng)\n- **2022.09.23** Add colab demo \u003ca href=\"https://colab.research.google.com/drive/1Yzb4o5OKjK46jbQ-_HGFOVJOPMVtJQjw?usp=sharing\"\u003e\u003cimg src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"google colab logo\"\u003e\u003c/a\u003e  \n- **2022.07.02**  \n      - Update codes of the new version FeMaSR   \n      - Please find the old QuanTexSR in the `quantexsr` branch\n\nHere are some example results on test images from [BSRGAN](https://github.com/cszn/BSRGAN) and [RealESRGAN](https://github.com/xinntao/Real-ESRGAN).\n\n---\n\n**Left**: [real images](./testset) **|** **Right**: [super-resolved images with scale factor 4](./results)\n\n\u003cimg src=\"testset/butterfly.png\" width=\"390px\"/\u003e \u003cimg src=\"results_x4/butterfly.png\" width=\"390px\"/\u003e\n\u003cimg src=\"testset/0003.jpg\" width=\"390px\"/\u003e \u003cimg src=\"results_x4/0003.jpg\" width=\"390px\"/\u003e\n\u003cimg src=\"testset/00003.png\" width=\"390px\"/\u003e \u003cimg src=\"results_x4/00003.png\" width=\"390px\"/\u003e\n\u003cimg src=\"testset/Lincoln.png\" width=\"390px\"/\u003e \u003cimg src=\"results_x4/Lincoln.png\" width=\"390px\"/\u003e\n\u003cimg src=\"testset/0014.jpg\" width=\"390px\"/\u003e \u003cimg src=\"results_x4/0014.jpg\" width=\"390px\"/\u003e\n\n\u003c!-- \u003cimg src=\"testset/butterfly.png\" width=\"156\"/\u003e \u003cimg src=\"results/butterfly.png\" width=\"624px\"/\u003e\n\u003cimg src=\"testset/0003.jpg\" width=\"156px\"/\u003e \u003cimg src=\"results/0003.jpg\" width=\"624px\"/\u003e\n\u003cimg src=\"testset/00003.png\" width=\"156px\"/\u003e \u003cimg src=\"results/00003.png\" width=\"624px\"/\u003e\n\u003cimg src=\"testset/Lincoln.png\" width=\"156px\"/\u003e \u003cimg src=\"results/Lincoln.png\" width=\"624px\"/\u003e\n\u003cimg src=\"testset/0014.jpg\" width=\"156px\"/\u003e \u003cimg src=\"results/0014.jpg\" width=\"624px\"/\u003e --\u003e\n\n\n## Dependencies and Installation\n\n- Ubuntu \u003e= 18.04\n- CUDA \u003e= 11.0\n- Other required packages in `requirements.txt`\n```\n# git clone this repository\ngit clone https://github.com/chaofengc/FeMaSR.git\ncd FeMaSR \n\n# create new anaconda env\nconda create -n femasr python=3.8\nsource activate femasr \n\n# install python dependencies\npip3 install -r requirements.txt\npython setup.py develop\n```\n\n## Quick Inference\n\n```\npython inference_femasr.py -s 4 -i ./testset -o results_x4/\npython inference_femasr.py -s 2 -i ./testset -o results_x2/\n```\n\n## Train the model\n\n### Preparation\n\n#### Dataset\n\nPlease prepare the training and testing data follow descriptions in the main paper and supplementary material. In brief, you need to crop 512 x 512 high resolution patches, and generate the low resolution patches with [`degradation_bsrgan`](https://github.com/cszn/BSRGAN/blob/3a958f40a9a24e8b81c3cb1960f05b0e91f1b421/utils/utils_blindsr.py?_pjax=%23js-repo-pjax-container%2C%20div%5Bitemtype%3D%22http%3A%2F%2Fschema.org%2FSoftwareSourceCode%22%5D%20main%2C%20%5Bdata-pjax-container%5D#L432) function provided by [BSRGAN](https://github.com/cszn/BSRGAN). While the synthetic testing LR images are generated by the [`degradation_bsrgan_plus`](https://github.com/cszn/BSRGAN/blob/3a958f40a9a24e8b81c3cb1960f05b0e91f1b421/utils/utils_blindsr.py?_pjax=%23js-repo-pjax-container%2C%20div%5Bitemtype%3D%22http%3A%2F%2Fschema.org%2FSoftwareSourceCode%22%5D%20main%2C%20%5Bdata-pjax-container%5D#L524) function for fair comparison.\n\n#### Model preparation\n\nBefore training, you need to\n- Download the pretrained HRP model: [generator](https://github.com/chaofengc/FeMaSR/releases/download/v0.1-pretrain_models/FeMaSR_HRP_model_g.pth), [discriminator](https://github.com/chaofengc/FeMaSR/releases/download/v0.1-pretrain_models/FeMaSR_HRP_model_d.pth) \n- Put the pretrained models in `experiments/pretrained_models`\n- Specify their path in the corresponding option file.\n\n### Train SR model\n\n```\npython basicsr/train.py -opt options/train_FeMaSR_LQ_stage.yml\n```\n\n### Model pretrain\n\nIn case you want to pretrain your own HRP model, we also provide the training option file:\n\n```\npython basicsr/train.py -opt options/train_FeMaSR_HQ_pretrain_stage.yml\n```\n\n## Citation\n```\n@inproceedings{chen2022femasr,\n      author={Chaofeng Chen and Xinyu Shi and Yipeng Qin and Xiaoming Li and Xiaoguang Han and Tao Yang and Shihui Guo},\n      title={Real-World Blind Super-Resolution via Feature Matching with Implicit High-Resolution Priors}, \n      year={2022},\n      Journal = {ACM International Conference on Multimedia},\n}\n```\n\n## License\n\n\u003ca rel=\"license\" href=\"http://creativecommons.org/licenses/by-nc-sa/4.0/\"\u003e\u003cimg alt=\"Creative Commons License\" style=\"border-width:0\" src=\"https://i.creativecommons.org/l/by-nc-sa/4.0/88x31.png\" /\u003e\u003c/a\u003e\u003cbr /\u003eThis work is licensed under a \u003ca rel=\"license\" href=\"http://creativecommons.org/licenses/by-nc-sa/4.0/\"\u003eCreative Commons Attribution-NonCommercial-ShareAlike 4.0 International License\u003c/a\u003e.\n\n## Acknowledgement\n\nThis project is based on [BasicSR](https://github.com/xinntao/BasicSR).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchaofengc%2Ffemasr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchaofengc%2Ffemasr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchaofengc%2Ffemasr/lists"}