cellseg: Multiclass Cell Segmentation

PyPI version Stage Codecov Test Install PyPI license Documentation Status Total Downloads Monthly Downloads Weekly Downloads Maintenance GitHub last commit GitHub issues GitHub issues-closed

Development stage

  • [x] Read Tiff Images

  • [x] Read Non Tiff Images

  • [x] Write Data Transformers and Loaders

  • [ ] Write functional model plus scripts

  • [ ] Modify model weights/layers

  • [ ] Read stacked tiff images/videos

Introduction

cellseg is a PyTorch (torch) based deep learning package aimed at multiclass cell segmentation.

Installation

pip install cellseg

Or if you want to build from source

git clone git@github.com:Nelson-Gon/cellseg.git
cd cellseg
python setup.py install

Usage

Script mode

View images

python -m cellseg -d data/train -t "image" -n 4 -s 512

To get help

python -m cellseg --help
#usage: __main__.py [-h] -d IMAGE_DIRECTORY -s IMAGE_SIZE -t TARGET -n NUMBER
#
#optional arguments:
#  -h, --help            show this help message and exit
#  -d IMAGE_DIRECTORY, --image-directory IMAGE_DIRECTORY
#                        Path to image directory containing images and
#                        masks/labels
#  -s IMAGE_SIZE, --image-size IMAGE_SIZE
#                        Size of images
#  -t TARGET, --target TARGET
#                        Target images to show
#  -n NUMBER, --number NUMBER
#                        Number of images to show

Programming mode

Importing relevant modules

from cellseg.data import DataProcessor
from cellseg.model import CellNet
from cellseg.utils import DataProcessor, show_images

Creating a a model object

my_model = CellNet()

Load training data

train_data = DataProcessor(image_dir="data/train/images", label_dir="data/train/images", image_suffix="tif")

View loaded images or masks

show_images(train_data, number = 8, target="image")

Training