Skip to content

ClementPla/fundus-lesions-toolkit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

71 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lesions Segmentation Toolkit for Fundus Images

This library offers a set of models (with pretrained weights) for the segmentation of lesions in fundus images. As of now, four lesions are segmented:

1. Cotton Wool Spot
2. Exudates
3. Hemmorrhages
4. Microaneurysms

Installation

pip install .

Basic use

Check the notebooks for detailed examples.

from fundus_lesions_toolkit.models import segment
from fundus_lesions_toolkit.constants import DEFAULT_COLORS, LESIONS
from fundus_lesions_toolkit.utils.images import open_image
from fundus_lesions_toolkit.utils.visualization import plot_image_and_mask

img = open_image(img_path)
pred = segment(img, device='cpu', weights='ALL')
plot_image_and_mask(img, pred, alpha=0.8, title='My segmentation', colors=DEFAULT_COLORS, labels=LESIONS)

Models available

Currently, only a single model is made available (unet with a resnest50 encoder). More will come regularly.

Variants

Models are trained with different publicly available datasets:

  1. IDRiD
  2. MESSIDOR
  3. DDR
  4. FGADR
  5. RETINAL-LESIONS

It also includes models trained with all the data combined.

Training

This library is only a hub to access pure PyTorch trained models.