Skip to main content

Pyramid Focus Augmentation: Medical Image Segmentation with Step Wise Focus - Pytorch support dataset

Project description

pyra-pytorch

This is a package suporting Pytorch datasets. This implementation is based on the augmentation method discussed in the paper "Pyramid-Focus-Augmentation: Medical Image Segmentation with Step-Wise Focus" (PDF) and the original github repository: PYRA.

@article{thambawita2020pyramid,
  title={Pyramid-Focus-Augmentation: Medical Image Segmentation with Step-Wise Focus},
  author={Thambawita, Vajira and Hicks, Steven and Halvorsen, P{\aa}l and Riegler, Michael A},
  journal={arXiv preprint arXiv:2012.07430},
  year={2020}
}

How to use:

Install the package,

pip install pyra-pytorch

Create a dataset with gird sizes which are going to be used as augmentation in the training process. If you want to get only the original mask, then, you have to pass image size as the gird size.

from pyra_pytorch import PYRADataset

dataset = PYRADataset("./image_path", # image folder
                      "./masks_path", # mask folder - files´s names of this folder should have image names as prefix to find correct image and mask pairs.
                      img_size = 256,  # height and width of image to resize
                      grid_sizes=[2,4,8,16,32,64,128,256] , # Gird sizes to use as grid augmentation. Note that, the image size after resizing ()
                      transforms = None
                      )
'''
./image_path" --> image folder

./masks_path" --> mask folder - files´s names of this folder should have image names as prefix to find correct image and mask pairs.

img_size = 256 --> height and width of image to resize

grid_sizes=[2,4,8,16,32,64,128,256]  --> Gird sizes to use as grid augmentation. Note that, the image size after resizing (in this case, it is 256) shoud be divisible by these grid sizes.

transforms = None --> Other type of transformations using in Pytorch. 

'''

Sample ipython notebook

notebook

Contact us:

vajira@simula.no | michael@simula.no

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyra-pytorch-0.0.3.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

pyra_pytorch-0.0.3-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file pyra-pytorch-0.0.3.tar.gz.

File metadata

  • Download URL: pyra-pytorch-0.0.3.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.23.0 setuptools/46.4.0.post20200518 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.3

File hashes

Hashes for pyra-pytorch-0.0.3.tar.gz
Algorithm Hash digest
SHA256 05750ebce118651e69d1fb0653c987788a6fbdff172a18b624ea768e27d0e3ca
MD5 147e6ac66b37c1fab7f0bcc7508c9a74
BLAKE2b-256 3db3d854f957ab431df65fc235233cc3ae46c72d1aeab6885a21670f152aba78

See more details on using hashes here.

File details

Details for the file pyra_pytorch-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: pyra_pytorch-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 5.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.23.0 setuptools/46.4.0.post20200518 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.3

File hashes

Hashes for pyra_pytorch-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 90fc20886dec00b4d91de2f10ac799df6a3999c502c956cf696cd385184d816b
MD5 5fcb067290f1c37b677d035979a29d07
BLAKE2b-256 1cde5366510fc041da93bacd6eb72d00e220f2db21d4b1642115cc5b114d71d0

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page