{"id":13778772,"url":"https://github.com/yinboc/liif","last_synced_at":"2025-04-12T16:35:28.206Z","repository":{"id":39517926,"uuid":"322048570","full_name":"yinboc/liif","owner":"yinboc","description":"Learning Continuous Image Representation with Local Implicit Image Function, in CVPR 2021 (Oral)","archived":false,"fork":false,"pushed_at":"2021-08-21T17:43:06.000Z","size":65,"stargazers_count":1312,"open_issues_count":30,"forks_count":147,"subscribers_count":20,"default_branch":"main","last_synced_at":"2025-04-03T17:11:18.682Z","etag":null,"topics":["implicit-neural-representation","machine-learning","pytorch","super-resolution"],"latest_commit_sha":null,"homepage":"https://yinboc.github.io/liif/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yinboc.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}},"created_at":"2020-12-16T17:04:04.000Z","updated_at":"2025-04-01T22:08:21.000Z","dependencies_parsed_at":"2022-07-13T16:44:24.116Z","dependency_job_id":null,"html_url":"https://github.com/yinboc/liif","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/yinboc%2Fliif","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yinboc%2Fliif/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yinboc%2Fliif/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yinboc%2Fliif/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yinboc","download_url":"https://codeload.github.com/yinboc/liif/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248597111,"owners_count":21130812,"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":["implicit-neural-representation","machine-learning","pytorch","super-resolution"],"created_at":"2024-08-03T18:00:57.328Z","updated_at":"2025-04-12T16:35:28.159Z","avatar_url":"https://github.com/yinboc.png","language":"Python","funding_links":[],"categories":["Generative Adverserial Networks with Implicit Representations"],"sub_categories":["For 2D"],"readme":"# LIIF\n\nThis repository contains the official implementation for LIIF introduced in the following paper:\n\n[**Learning Continuous Image Representation with Local Implicit Image Function**](https://arxiv.org/abs/2012.09161)\n\u003cbr\u003e\n[Yinbo Chen](https://yinboc.github.io/), [Sifei Liu](https://www.sifeiliu.net/), [Xiaolong Wang](https://xiaolonw.github.io/)\n\u003cbr\u003e\nCVPR 2021 (Oral)\n\nThe project page with video is at https://yinboc.github.io/liif/.\n\n\u003cimg src=\"https://user-images.githubusercontent.com/10364424/102488232-b3c96080-40a6-11eb-905f-a1a21b7c6f8a.png\" width=\"200\"\u003e\n\n### Citation\n\nIf you find our work useful in your research, please cite:\n\n```\n@inproceedings{chen2021learning,\n  title={Learning continuous image representation with local implicit image function},\n  author={Chen, Yinbo and Liu, Sifei and Wang, Xiaolong},\n  booktitle={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition},\n  pages={8628--8638},\n  year={2021}\n}\n```\n\n### Environment\n- Python 3\n- Pytorch 1.6.0\n- TensorboardX\n- yaml, numpy, tqdm, imageio\n\n## Quick Start\n\n1. Download a DIV2K pre-trained model.\n\nModel|File size|Download\n:-:|:-:|:-:\nEDSR-baseline-LIIF|18M|[Dropbox](https://www.dropbox.com/s/6f402wcn4v83w2v/edsr-baseline-liif.pth?dl=0) \u0026#124; [Google Drive](https://drive.google.com/file/d/1wBHSrgPLOHL_QVhPAIAcDC30KSJLf67x/view?usp=sharing)\nRDN-LIIF|256M|[Dropbox](https://www.dropbox.com/s/mzha6ll9kb9bwy0/rdn-liif.pth?dl=0) \u0026#124; [Google Drive](https://drive.google.com/file/d/1xaAx6lBVVw_PJ3YVp02h3k4HuOAXcUkt/view?usp=sharing)\n\n2. Convert your image to LIIF and present it in a given resolution (with GPU 0, `[MODEL_PATH]` denotes the `.pth` file)\n\n```\npython demo.py --input xxx.png --model [MODEL_PATH] --resolution [HEIGHT],[WIDTH] --output output.png --gpu 0\n```\n\n## Reproducing Experiments\n\n### Data\n\n`mkdir load` for putting the dataset folders.\n\n- **DIV2K**: `mkdir` and `cd` into `load/div2k`. Download HR images and bicubic validation LR images from [DIV2K website](https://data.vision.ee.ethz.ch/cvl/DIV2K/) (i.e. [Train_HR](http://data.vision.ee.ethz.ch/cvl/DIV2K/DIV2K_train_HR.zip), [Valid_HR](http://data.vision.ee.ethz.ch/cvl/DIV2K/DIV2K_valid_HR.zip), [Valid_LR_X2](http://data.vision.ee.ethz.ch/cvl/DIV2K/DIV2K_valid_LR_bicubic_X2.zip), [Valid_LR_X3](http://data.vision.ee.ethz.ch/cvl/DIV2K/DIV2K_valid_LR_bicubic_X3.zip), [Valid_LR_X4](http://data.vision.ee.ethz.ch/cvl/DIV2K/DIV2K_valid_LR_bicubic_X4.zip)). `unzip` these files to get the image folders.\n\n- **benchmark datasets**: `cd` into `load/`. Download and `tar -xf` the [benchmark datasets](https://cv.snu.ac.kr/research/EDSR/benchmark.tar) (provided by [this repo](https://github.com/thstkdgus35/EDSR-PyTorch)), get a `load/benchmark` folder with sub-folders `Set5/, Set14/, B100/, Urban100/`.\n\n- **celebAHQ**: `mkdir load/celebAHQ` and `cp scripts/resize.py load/celebAHQ/`, then `cd load/celebAHQ/`. Download and `unzip` data1024x1024.zip from the [Google Drive link](https://drive.google.com/drive/folders/11Vz0fqHS2rXDb5pprgTjpD7S2BAJhi1P?usp=sharing) (provided by [this repo](github.com/suvojit-0x55aa/celebA-HQ-dataset-download)). Run `python resize.py` and get image folders `256/, 128/, 64/, 32/`. Download the [split.json](https://www.dropbox.com/s/2qeijojdjzvp3b9/split.json?dl=0).\n\n### Running the code\n\n**0. Preliminaries**\n\n- For `train_liif.py` or `test.py`, use `--gpu [GPU]` to specify the GPUs (e.g. `--gpu 0` or `--gpu 0,1`).\n\n- For `train_liif.py`, by default, the save folder is at `save/_[CONFIG_NAME]`. We can use `--name` to specify a name if needed.\n\n- For dataset args in configs, `cache: in_memory` denotes pre-loading into memory (may require large memory, e.g. ~40GB for DIV2K), `cache: bin` denotes creating binary files (in a sibling folder) for the first time, `cache: none` denotes direct loading. We can modify it according to the hardware resources before running the training scripts.\n\n**1. DIV2K experiments**\n\n**Train**: `python train_liif.py --config configs/train-div2k/train_edsr-baseline-liif.yaml` (with EDSR-baseline backbone, for RDN replace `edsr-baseline` with `rdn`). We use 1 GPU for training EDSR-baseline-LIIF and 4 GPUs for RDN-LIIF.\n\n**Test**: `bash scripts/test-div2k.sh [MODEL_PATH] [GPU]` for div2k validation set, `bash scripts/test-benchmark.sh [MODEL_PATH] [GPU]` for benchmark datasets. `[MODEL_PATH]` is the path to a `.pth` file, we use `epoch-last.pth` in corresponding save folder.\n\n**2. celebAHQ experiments**\n\n**Train**: `python train_liif.py --config configs/train-celebAHQ/[CONFIG_NAME].yaml`.\n\n**Test**: `python test.py --config configs/test/test-celebAHQ-32-256.yaml --model [MODEL_PATH]` (or `test-celebAHQ-64-128.yaml` for another task). We use `epoch-best.pth` in corresponding save folder.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyinboc%2Fliif","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyinboc%2Fliif","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyinboc%2Fliif/lists"}