Skip to main content

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 😄.

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>

Metadata

Release files for lwbna-unet 1.0.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 lwbna-unet 1.0.2
File Size Uploaded Provenance Actions
lwbna-unet-1.0.2.tar.gz 8.5 kB Without provenance Details for lwbna-unet-1.0.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for lwbna-unet 1.0.2
File Interpreter ABI Platform Actions
lwbna_unet-1.0.2-py3-none-any.whl Python 3 none any Details for lwbna_unet-1.0.2-py3-none-any.whl

Total release size: 17.6 kB

Release files / lwbna-unet-1.0.2.tar.gz

Download URL lwbna-unet-1.0.2.tar.gz
Size 8.5 kB
Tags Source
SHA-256 checksum
How to use checksums
48cd1b3fc38944c6dd8fa7c06a4bd730ff4dc57444be0b4600f1f12737a6c163
BLAKE2b-256 checksum
How to use checksums
ce11fa7c6b6784074ef12e50e6b9538bab440dbe7ea030bacd47ecb376210e01
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.12

Release files / lwbna_unet-1.0.2-py3-none-any.whl

Download URL lwbna_unet-1.0.2-py3-none-any.whl
Size 9.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a1131f7bc43c30202642f62bc1c056702d762066ea2a38c81ff33bd4a0d762ec
BLAKE2b-256 checksum
How to use checksums
569cda9605de7adc0e13daee661e292caabf1ed514e68667ae578be43dfa888a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.12

Security for lwbna-unet 1.0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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