Skip to main content

TF2 (Keras) implementation of LWBNA_Unet. Unrelated to the authors of the paper

Project description

Light Weight Bottle Neck Attention Unet

TF implementation of the architecture described in A lightweight deep learning model for automatic segmentation and analysis of ophthalmic images by Sharma et al.

This is an independent implementation unrelated to the autors of the paper. I have used it for segmenting fibers in my own project. Please leave a Star if this code is useful to you :smile:.

Usage

# install your favorite version of tensorflow2
pip install tensorflow
# install this package
pip install lwbna-unet
import lwbna_unet as unet
import numpy as np

# input has shape `(Batch size, Height, Width, Channels)`
# input has dtype float and is expected to be normalized to the range [0,1].
# output has shape `(Batch size, Height, Width, n_classes)`

my_unet = unet.LWBNAUnet(
    n_classes=1, 
    filters=128, 
    depth=4, 
    midblock_steps=4, 
    dropout_rate=0.3, 
    name="my_unet"
)

# the network is untrained. Dummy input.
my_unet.build(input_shape=(8,320,320,3))
my_unet.predict(np.random.rand(8,256,256,3))
my_unet.summary()
# you can now train `my_unet` as a regular `keras.Model`
<script async defer src="https://buttons.github.io/buttons.js"></script>

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

lwbna-unet-1.0.0.tar.gz (6.3 kB view details)

Uploaded Source

Built Distribution

lwbna_unet-1.0.0-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

File details

Details for the file lwbna-unet-1.0.0.tar.gz.

File metadata

  • Download URL: lwbna-unet-1.0.0.tar.gz
  • Upload date:
  • Size: 6.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.11

File hashes

Hashes for lwbna-unet-1.0.0.tar.gz
Algorithm Hash digest
SHA256 b11bb1d5a47a35f0ac19f069ef438e4a827f8b249cfe27e0fba46eafe77cc45e
MD5 710f6ab32cffa3d9a3bbce0556b97cb6
BLAKE2b-256 a0c4f1d86103d800435af7565680ca05e3cd427b7c0d6af6a85bde1f5ac7cd70

See more details on using hashes here.

File details

Details for the file lwbna_unet-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: lwbna_unet-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 6.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.11

File hashes

Hashes for lwbna_unet-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2e2ce85b4b91e52f163fd90a21968b73c870b64e94d8f123a718017728b5d3ec
MD5 a2e2b0195aacabe434bab8e929518c24
BLAKE2b-256 d7595b29bc6858bcff5fadc7d69160e7f1e4c8581521ebaa759d421c91d93688

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