{"id":19760631,"url":"https://github.com/hasnainraz/fast-srgan","last_synced_at":"2025-05-15T09:09:29.058Z","repository":{"id":38897915,"uuid":"216393766","full_name":"HasnainRaz/Fast-SRGAN","owner":"HasnainRaz","description":"A Fast Deep Learning Model to Upsample Low Resolution Videos to High Resolution at 30fps","archived":false,"fork":false,"pushed_at":"2025-03-06T03:46:41.000Z","size":4669,"stargazers_count":682,"open_issues_count":1,"forks_count":118,"subscribers_count":18,"default_branch":"master","last_synced_at":"2025-04-14T15:56:53.411Z","etag":null,"topics":["artificial-intelligence","cnn","fastsrgan","gans","generative-adversarial-network","neural-network","realtime-super-resolution","residual-blocks","resolution-image","single-image-super-resolution","sisr","srgan","super-resolution","tensorboard","tensorflow","tf-keras","tf2","upsample"],"latest_commit_sha":null,"homepage":"","language":"Python","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/HasnainRaz.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,"zenodo":null}},"created_at":"2019-10-20T16:41:22.000Z","updated_at":"2025-04-14T09:45:50.000Z","dependencies_parsed_at":"2025-01-18T03:02:26.495Z","dependency_job_id":"f2f84b54-fa52-4cda-be08-ee35dc620fca","html_url":"https://github.com/HasnainRaz/Fast-SRGAN","commit_stats":{"total_commits":37,"total_committers":3,"mean_commits":"12.333333333333334","dds":"0.16216216216216217","last_synced_commit":"2c09baa662f864ad9197f5b64171e6cc5c37a409"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HasnainRaz%2FFast-SRGAN","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HasnainRaz%2FFast-SRGAN/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HasnainRaz%2FFast-SRGAN/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HasnainRaz%2FFast-SRGAN/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HasnainRaz","download_url":"https://codeload.github.com/HasnainRaz/Fast-SRGAN/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254310520,"owners_count":22049470,"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":["artificial-intelligence","cnn","fastsrgan","gans","generative-adversarial-network","neural-network","realtime-super-resolution","residual-blocks","resolution-image","single-image-super-resolution","sisr","srgan","super-resolution","tensorboard","tensorflow","tf-keras","tf2","upsample"],"created_at":"2024-11-12T03:38:06.859Z","updated_at":"2025-05-15T09:09:24.046Z","avatar_url":"https://github.com/HasnainRaz.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Fast-SRGAN\nThe goal of this repository is to enable real time super resolution for upsampling low resolution videos. Currently, the design follows the [SR-GAN](https://arxiv.org/pdf/1609.04802.pdf) architecture. For speed, the upsampling is done through pixel shuffle.\n\nThe training setup looks like the following diagram:\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://user-images.githubusercontent.com/4294680/67164120-22157480-f377-11e9-87c1-5b6acace0e47.png\"\u003e\n\u003c/p\u003e\n\n# Speed Benchmarks\nThe following runtimes/fps are obtained by averaging runtimes over 800 frames. Measured on MPS (MacBook M1 Pro GPU).\n\n| Input Image Size  |      Output Size     | Time (s)  | FPS |\n|   -------------   |:--------------------:|:---------:|:---:|\n|     90x160        |    360x640 (360p)    |   0.01    | 82  |\n|     180x320       |    720x1080 (720p)   |   0.04    | 27  |\n\nWe see it's possible to upsample to 720p at around 30fps.\n\n# Requirements\nThis was tested on Python 3.10. To install the required packages, use the provided Pipfile:\n```bash\npip install pipenv --upgrade\npipenv install --system --deploy\n```\n\n# Pre-trained Model\nA pretrained generator model on the DIV2k dataset is provided in the 'models' directory. It uses 8 residual blocks, with 64 filters in every layer of the generator. \n\n\nTo try out the provided pretrained model on your own images, run the following:\n\n```bash\npython inference.py --image_dir 'path/to/your/image/directory' --output_dir 'path/to/save/super/resolution/images'\n```\n\n# Training\nTo train, simply edit the config file in the folder `configs/config.yaml` with your settings, and then launch the training with:\n```bash\npython train.py\n```\n\nYou can also change the config parameters from the command line. The following will run training with a `batch_size` of 32, a generator with 12 residual blocks, and a path to the image directory `/path/to/image/dataset`.\n```\npython train.py data.image_dir=\"/path/to/image/dataset\" training.batch_size=32 generator.n_layers=12\n\n```\nThis is powered by `hydra`, which means all the parameters in the config are editable via the CLI.\n\nModel checkpoints and training summaries are saved in tensorboard. To monitor training progress, open up tensorboard by pointing it to the `outputs` directory that will be created when you start training.\n\n# Samples\nFollowing are some results from the provided trained model. Left shows the low res image, after 4x bicubic upsampling. Middle is the output of the model. Right is the actual high resolution image.\n\n\u003cp align=\"center\"\u003e\n  \u003cb\u003eThe following shows images upsampled 4x by bicubic interpolation, the pretrained model from this repository and the original high resolution image as a comparison\u003c/b\u003e\n  \u003cimg src=\"https://github.com/HasnainRaz/Fast-SRGAN/assets/4294680/95b6f8e4-f6c0-403b-854e-78c5589fbec6g\"\u003e \n  \u003cimg src=\"https://github.com/HasnainRaz/Fast-SRGAN/assets/4294680/d57abe02-46d8-48ce-bd1f-3cd06a9a66087\"\u003e\n  \u003cimg src=\"https://github.com/HasnainRaz/Fast-SRGAN/assets/4294680/67472974-56a5-4505-abaa-5e1c86467da1\"\u003e\n  \u003cimg src=\"https://github.com/HasnainRaz/Fast-SRGAN/assets/4294680/0d16647e-75ea-4150-bba0-2ea70ba05ca0\"\u003e\n\u003c/p\u003e\n\n# Contributing\nIf you have ideas on improving model performance, adding metrics, or any other changes, please make a pull request or open an issue. I'd be happy to accept any contributions.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhasnainraz%2Ffast-srgan","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhasnainraz%2Ffast-srgan","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhasnainraz%2Ffast-srgan/lists"}