Skip to main content

A small example package

Project description

torchxrayvision

A library for chest X-ray datasets and models. Including pre-trainined models.

This code is still under development

models

model = xrv.models.DenseNet(weights="nih")
model = xrv.models.DenseNet(weights="chex")
model = xrv.models.DenseNet(weights="minix_nb")
model = xrv.models.DenseNet(weights="minix_ch")
model = xrv.models.DenseNet(weights="all")

datasets

transform = torchvision.transforms.Compose([xrv.datasets.XRayCenterCrop(),
                                            xrv.datasets.XRayResizer(224)])

d_kaggle = xrv.datasets.Kaggle_Dataset(imgpath="path to stage_2_train_images_jpg",
                                       transform=transform)

d_chex = xrv.datasets.CheX_Dataset(imgpath="path to CheXpert-v1.0-small",
                                   csvpath="path to CheXpert-v1.0-small/train.csv",
                                   transform=transform)

d_nih = xrv.datasets.NIH_Dataset(imgpath="path to NIH images")

d_nih2 = xrv.datasets.NIH_Google_Dataset(imgpath="path to NIH images")

d_pc = xrv.datasets.PC_Dataset(imgpath="path to image folder")


d_covid19 = xrv.datasets.COVID19_Dataset()

dataset tools

relabel_dataset will align labels to have the same order as the pathologies argument.

xrv.datasets.relabel_dataset(pathologies, d_nih) # has side effects

Cite:

Joseph Paul Cohen, Joseph Viviano, and Hadrien Bertrand. TorchXrayVision: A library of chest X-ray datasets and models. https://github.com/mlmed/torchxrayvision, 2020

and

Cohen, J. P., Hashir, M., Brooks, R., & Bertrand, H. On the limits of cross-domain generalization in automated X-ray prediction. 2020 arXiv preprint arXiv:2002.02497.

@article{cohen2020limits,
  title={On the limits of cross-domain generalization in automated X-ray prediction},
  author={Cohen, Joseph Paul and Hashir, Mohammad and Brooks, Rupert and Bertrand, Hadrien},
  journal={arXiv preprint arXiv:2002.02497},
  year={2020}
}

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

torchxrayvision-0.0.2.tar.gz (10.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

torchxrayvision-0.0.2-py3-none-any.whl (14.7 kB view details)

Uploaded Python 3

File details

Details for the file torchxrayvision-0.0.2.tar.gz.

File metadata

  • Download URL: torchxrayvision-0.0.2.tar.gz
  • Upload date:
  • Size: 10.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.6

File hashes

Hashes for torchxrayvision-0.0.2.tar.gz
Algorithm Hash digest
SHA256 6538f52b6d0703400c1829b082892c518eccb52d0167503b553e44d5b667d9d8
MD5 59ca35abaeef1118080449f1d9f37492
BLAKE2b-256 7d358e50339ac325131aec264634d5f9aecad508027c1d51160c0afe0caa403f

See more details on using hashes here.

File details

Details for the file torchxrayvision-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: torchxrayvision-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 14.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.6

File hashes

Hashes for torchxrayvision-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 c08681e44a0a1413982f89d2bdb230bca60b4ea7528ae17334384b1b11d9949b
MD5 3fc766d5bfff07843bd0394b7be962d3
BLAKE2b-256 0badf5d03cf9c98f7530298e763f5a0baf078d2d0969138230888c6b09c9abbe

See more details on using hashes here.

Supported by

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