Skip to main content

lungs_segmentation

Automated lung segmentation in chest-x ray

https://habrastorage.org/webt/vk/jv/8r/vkjv8rjd04f1oicbczq5hyadhv0.png

Train pipeline: https://github.com/alimbekovKZ/lungs_segmentation_train

Installation

pip install lungs-segmentation

Example inference

Jupyter notebook with the example: Open In Colab

WebApp

https://lungssegmentation.herokuapp.com/

Models weights

model best dice Mb
resnet34 0.9657 103.4
densenet121 0.9655 62.8

Usage

Code example for resnet34:

from lungs_segmentation.pre_trained_models import create_model
import lungs_segmentation.inference as inference

model = create_model("resnet34")
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
model = model.to(device)

plt.figure(figsize=(20,40))
plt.subplot(1,1,1)
image, mask = inference.inference(model,'739px-Chest_Xray_PA_3-8-2010.png', 0.2)
plt.imshow(inference.img_with_masks( image, [mask[0], mask[1]], alpha = 0.1))

Results on data from the Internet

resnet34

https://habrastorage.org/webt/e3/mb/kc/e3mbkcxsmos6q4jlw5-tybudzji.png

densenet121

https://habrastorage.org/webt/ef/01/zo/ef01zo2g2qgsux8ses4keg4g8is.png

Authors

Renat Alimbekov, Ivan Vassilenko, Abylaikhan Turlassov

Metadata

Release files for lungs-segmentation 1.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lungs-segmentation 1.1.2
File Size Uploaded
lungs_segmentation-1.1.2.tar.gz 15.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for lungs-segmentation 1.1.2
File Interpreter ABI Platform
lungs_segmentation-1.1.2-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 31.5 kB

Release files / lungs_segmentation-1.1.2.tar.gz

Download URL lungs_segmentation-1.1.2.tar.gz
Size 15.1 kB
Tags Source
SHA-256 checksum
How to use checksums
5406eafce99a60a938ab7ad900148508dac51ba269cefc938311ef814a57064f
BLAKE2b-256 checksum
How to use checksums
8057b7c4aae8ed7b19ce37bf3223f608bcf323296e618e8d2c1de3f376eaaed0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.7.3

Release files / lungs_segmentation-1.1.2-py2.py3-none-any.whl

Download URL lungs_segmentation-1.1.2-py2.py3-none-any.whl
Size 16.5 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
890b8c0c3fd37d2b3e7ada13bc2fda5955ece4c004691d99cb3451fe4e527b06
BLAKE2b-256 checksum
How to use checksums
6fd7623a222151a50c2b3034c4a25fb036355b0959bdbb95e44e638dc90614e3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.7.3

Release history Release notifications | RSS feed

This release

1.1.2 This release

2 release files

1.1.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page