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
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
lwbna-unet-1.0.1.tar.gz
(6.3 kB
view details)
Built Distribution
File details
Details for the file lwbna-unet-1.0.1.tar.gz
.
File metadata
- Download URL: lwbna-unet-1.0.1.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
Algorithm | Hash digest | |
---|---|---|
SHA256 | c6451f781ff36ecc709d9300836fea0c4563a7aa5863a28ce5b226cb2734390e |
|
MD5 | 292e10a6d0126f510dc84894387b580d |
|
BLAKE2b-256 | 2c9dd442027eff45e88940f5bbd22db40ee0b9da4b3b098e48dbed6d90005a82 |
File details
Details for the file lwbna_unet-1.0.1-py3-none-any.whl
.
File metadata
- Download URL: lwbna_unet-1.0.1-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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5a7e55eede385aea6d4e0d74fc7158c12ee3243ce07abf85eb2ad76bbe1259c2 |
|
MD5 | d1091a9600cca98fe2218f54fc8abe93 |
|
BLAKE2b-256 | 6ae724abecb161b34d6583ffc1d985194cbaaf038791ba1b2ade992d770270ad |