{"id":20437003,"url":"https://github.com/hayashi-yudai/srgan","last_synced_at":"2026-04-21T19:04:36.840Z","repository":{"id":130362490,"uuid":"399123480","full_name":"Hayashi-Yudai/SRGAN","owner":"Hayashi-Yudai","description":"Super resolution GAN","archived":false,"fork":false,"pushed_at":"2022-10-16T11:24:04.000Z","size":2032,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-08T06:12:54.516Z","etag":null,"topics":["computer-vision","gan","machine-learning","python3","super-resolution","tensorflow"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Hayashi-Yudai.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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-08-23T13:56:05.000Z","updated_at":"2023-04-17T14:51:49.000Z","dependencies_parsed_at":"2023-03-13T11:16:30.563Z","dependency_job_id":null,"html_url":"https://github.com/Hayashi-Yudai/SRGAN","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Hayashi-Yudai/SRGAN","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hayashi-Yudai%2FSRGAN","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hayashi-Yudai%2FSRGAN/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hayashi-Yudai%2FSRGAN/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hayashi-Yudai%2FSRGAN/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Hayashi-Yudai","download_url":"https://codeload.github.com/Hayashi-Yudai/SRGAN/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hayashi-Yudai%2FSRGAN/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32105870,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-21T11:25:29.218Z","status":"ssl_error","status_checked_at":"2026-04-21T11:25:28.499Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["computer-vision","gan","machine-learning","python3","super-resolution","tensorflow"],"created_at":"2024-11-15T08:46:29.865Z","updated_at":"2026-04-21T19:04:36.801Z","avatar_url":"https://github.com/Hayashi-Yudai.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SRGAN\n\n## Verification environment\n\n- Python 3.10.4\n- Tensorflow 2.10.0\n\n## Network structure\n\n![https://arxiv.org/pdf/1609.04802.pdf](https://github.com/Hayashi-Yudai/SRGAN/blob/main/assets/network_img.png \"cited from https://arxiv.org/pdf/1609.04802.pdf\")\ncited from https://arxiv.org/pdf/1609.04802.pdf\n\n## How to train\n\n### Prepare your dataset\n\nMake the following directory tree for your dataset on the project root and place original images in `train/high_resolution` and `validate/high_resolution/` directories.\n\n```\n.datasets\n└── (your dataset name)\n    ├── test\n    │   ├── high_resolution\n    │   └── low_resolution\n    ├── train\n    │   ├── high_resolution\n    │   └── low_resolution\n    └── validate\n        ├── high_resolution\n        └── low_resolution\n```\n\nNext, make low resolution images which have quarter size of original ones and place them in `low_resolution` directories.\n\nThis program request TFRecords as dataset. I prepare a function for you. Fix `dataset_name` and `extension` in the src/datasets.py and execute it from project root.\n\n```bash\npoetry run python src/dataset.py\n```\n\nMake sure there exists `train.tfrecords` and `valid.tfrecords` in the `datasets/(your dataset name)` directory.\n\n### Configure parameters\n\nThe parameters like hyper-parameters are set in the config.yaml\n\n### Training\n\n#### Pre-training SRResNet\n\nconfig.yaml\n\n```\nTYPE: SRResNet\nEPOCHS: 10000\nBATCH_SIZE: 16\nIMG_HEIGHT: 32\nIMG_WIDTH: 32\nLEARNING_RATE: 0.0001\nTRAIN_DATA_PATH: ./datasets/train.tfrecords\nVALIDATE_DATA_PATH: ./datasets/valid.tfrecords\nCHECKPOINT_PATH: ./checkpoint/generator_train\nSTART_EPOCH: 0\nGEN_WEIGHT:\nDISC_WEIGHT:\nG_LOSS: 100000000\n```\n\nStart training with the following command\n\n```bash\n$ poetry run python src/train.py\n```\n\n#### Training SRGAN\n\nconfig.yaml\n\n```\nTYPE: SRGAN\nEPOCHS: 10000\nBATCH_SIZE: 16\nIMG_HEIGHT: 32\nIMG_WIDTH: 32\nLEARNING_RATE: 0.0001\nTRAIN_DATA_PATH: ./datasets/train.tfrecords\nVALIDATE_DATA_PATH: ./datasets/valid.tfrecords\nCHECKPOINT_PATH: ./checkpoint/gan_train\nSTART_EPOCH: 0\nGEN_WEIGHT: ./generator_train/generator_best\nDISC_WEIGHT:\nG_LOSS: 100000000\n```\n\nStart training with the following command\n\n```bash\n$ poetry run python train\n```\n\n## Example\n\nYou can download pre-trained weight from [here](https://drive.google.com/drive/folders/1LE1AK0HVHN-_x9S3-aCUeA0mFT-D68VW?usp=sharing). These weights are trained with 32x32 images.\n\n![](https://github.com/Hayashi-Yudai/SRGAN/blob/main/assets/test_data.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhayashi-yudai%2Fsrgan","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhayashi-yudai%2Fsrgan","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhayashi-yudai%2Fsrgan/lists"}