GANetic


NameGANetic JSON
Version 0.0.3 PyPI version JSON
download
home_pagehttps://github.com/kingjuno/GANetic
SummaryA Collection of GANs - PyTorch
upload_time2023-02-08 15:30:49
maintainer
docs_urlNone
authorGeo Jolly
requires_python
licenseMIT
keywords gan generative adversarial networks deep learning pytorch ganetic
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # GANetic
A collection of GANs implemented in PyTorch.

## Table of Contents
<!-- - [Installation](#installation) -->
- [Usage](#usage)
    - [DCGAN](#dcgan)
    - [SRGAN](#srgan)
- [Citations](#citations)

## Usage
### DCGAN
```python
import torch

from ganetic.dcgan import Discriminator, Generator

netG = Generator(
    nz=100,  # length of latent vector
    nc=3,    # number of channels in the training images.
    ngf=64,  # size of feature maps in generator
)
netD = Discriminator(
    nc=3,    # number of channels in the training images.
    ndf=64,  # size of feature maps in discriminator
)

noise = torch.randn(1, 100, 1, 1)
fake_img = netG(noise)
prediction = netD(fake_img)
```

### SRGAN
```python
import torch

from ganetic.srgan import Generator, Discriminator

img = torch.randn(1, 3, 64, 64)
gen = Generator(
    scale_factor=4, # scale factor for super resolution
    nci=3,          # number of channels in input image
    nco=3,          # number of channels in output image
    ngf=64,         # number of filters in the generator
    no_of_residual_blocks=5 
)
disc = Discriminator(
    input_shape=(3, 256, 256),
    ndf=64,              # number of filters in the discriminator
    negative_slope=0.2,  # negative slope of leaky relu
)

HR_img = gen(img)
pred = disc(HR_img)
```

## Citations
```bibtex
@article{radford2015unsupervised,
  title={Unsupervised representation learning with deep convolutional generative adversarial networks},
  author={Radford, Alec and Metz, Luke and Chintala, Soumith},
  journal={arXiv preprint arXiv:1511.06434},
  year={2015}
}
```

```bibtex
@inproceedings{ledig2017photo,
  title={Photo-realistic single image super-resolution using a generative adversarial network},
  author={Ledig, Christian and Theis, Lucas and Husz{\'a}r, Ferenc and Caballero, Jose and Cunningham, Andrew and Acosta, Alejandro and Aitken, Andrew and Tejani, Alykhan and Totz, Johannes and Wang, Zehan and others},
  booktitle={Proceedings of the IEEE conference on computer vision and pattern recognition},
  pages={4681--4690},
  year={2017}
}
```


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/kingjuno/GANetic",
    "name": "GANetic",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "GAN,Generative Adversarial Networks,Deep Learning,PyTorch,GANetic",
    "author": "Geo Jolly",
    "author_email": "geojollyc@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/59/cc/9e9659d50b30e6b8ae43929fa6f93aad8d849a39e5470f9e66ee364d034c/GANetic-0.0.3.tar.gz",
    "platform": null,
    "description": "# GANetic\nA collection of GANs implemented in PyTorch.\n\n## Table of Contents\n<!-- - [Installation](#installation) -->\n- [Usage](#usage)\n    - [DCGAN](#dcgan)\n    - [SRGAN](#srgan)\n- [Citations](#citations)\n\n## Usage\n### DCGAN\n```python\nimport torch\n\nfrom ganetic.dcgan import Discriminator, Generator\n\nnetG = Generator(\n    nz=100,  # length of latent vector\n    nc=3,    # number of channels in the training images.\n    ngf=64,  # size of feature maps in generator\n)\nnetD = Discriminator(\n    nc=3,    # number of channels in the training images.\n    ndf=64,  # size of feature maps in discriminator\n)\n\nnoise = torch.randn(1, 100, 1, 1)\nfake_img = netG(noise)\nprediction = netD(fake_img)\n```\n\n### SRGAN\n```python\nimport torch\n\nfrom ganetic.srgan import Generator, Discriminator\n\nimg = torch.randn(1, 3, 64, 64)\ngen = Generator(\n    scale_factor=4, # scale factor for super resolution\n    nci=3,          # number of channels in input image\n    nco=3,          # number of channels in output image\n    ngf=64,         # number of filters in the generator\n    no_of_residual_blocks=5 \n)\ndisc = Discriminator(\n    input_shape=(3, 256, 256),\n    ndf=64,              # number of filters in the discriminator\n    negative_slope=0.2,  # negative slope of leaky relu\n)\n\nHR_img = gen(img)\npred = disc(HR_img)\n```\n\n## Citations\n```bibtex\n@article{radford2015unsupervised,\n  title={Unsupervised representation learning with deep convolutional generative adversarial networks},\n  author={Radford, Alec and Metz, Luke and Chintala, Soumith},\n  journal={arXiv preprint arXiv:1511.06434},\n  year={2015}\n}\n```\n\n```bibtex\n@inproceedings{ledig2017photo,\n  title={Photo-realistic single image super-resolution using a generative adversarial network},\n  author={Ledig, Christian and Theis, Lucas and Husz{\\'a}r, Ferenc and Caballero, Jose and Cunningham, Andrew and Acosta, Alejandro and Aitken, Andrew and Tejani, Alykhan and Totz, Johannes and Wang, Zehan and others},\n  booktitle={Proceedings of the IEEE conference on computer vision and pattern recognition},\n  pages={4681--4690},\n  year={2017}\n}\n```\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A Collection of GANs - PyTorch",
    "version": "0.0.3",
    "split_keywords": [
        "gan",
        "generative adversarial networks",
        "deep learning",
        "pytorch",
        "ganetic"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "59cc9e9659d50b30e6b8ae43929fa6f93aad8d849a39e5470f9e66ee364d034c",
                "md5": "6dd1c59305070bc61b876217dcb0e807",
                "sha256": "52924e19d8cc6fea4d3da654ff4fd37a1384264306efb769ada2e57a14a84454"
            },
            "downloads": -1,
            "filename": "GANetic-0.0.3.tar.gz",
            "has_sig": false,
            "md5_digest": "6dd1c59305070bc61b876217dcb0e807",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 4598,
            "upload_time": "2023-02-08T15:30:49",
            "upload_time_iso_8601": "2023-02-08T15:30:49.720582Z",
            "url": "https://files.pythonhosted.org/packages/59/cc/9e9659d50b30e6b8ae43929fa6f93aad8d849a39e5470f9e66ee364d034c/GANetic-0.0.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-02-08 15:30:49",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "kingjuno",
    "github_project": "GANetic",
    "lcname": "ganetic"
}
        
Elapsed time: 0.20910s