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
Getting started
pip install torchxrayvision
import torchxrayvision as xrv
These are default pathologies:
xrv.datasets.default_pathologies
['Atelectasis',
'Consolidation',
'Infiltration',
'Pneumothorax',
'Edema',
'Emphysema',
'Fibrosis',
'Effusion',
'Pneumonia',
'Pleural_Thickening',
'Cardiomegaly',
'Nodule',
'Mass',
'Hernia',
'Lung Lesion',
'Fracture',
'Lung Opacity',
'Enlarged Cardiomediastinum']
models
model = xrv.models.DenseNet(weights="all")
model = xrv.models.DenseNet(weights="kaggle")
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")
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() # specify imgpath and csvpath for the dataset
dataset tools
relabel_dataset will align labels to have the same order as the pathologies argument.
xrv.datasets.relabel_dataset(xrv.datasets.default_pathologies , d_nih) # has side effects
Cite:
Joseph Paul Cohen, Joseph Viviano, Mohammad Hashir, 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 [https://arxiv.org/abs/2002.02497](https://arxiv.org/abs/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
Release history Release notifications | RSS feed
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.3.tar.gz
(12.4 kB
view hashes)
Built Distribution
Close
Hashes for torchxrayvision-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bc1eb1bd616b323265b487b70f7ccabb1f2e7d63fe7120c0f79369c6227ceadc |
|
MD5 | 321a3c5d6360fea7ee0f0cf6e57bb324 |
|
BLAKE2b-256 | 5cadd2b46a29dd877a51242089f3dd39e230528d2f07a597449f39f3d4110ebe |