Universal cell segmentation
Project description
UniCell
UniCell is a universal cellular segmentation tool for multi-modality microscopy images. It has three main features
- It works for various microscopy images, especially for the RGB images, e.g., bone marrow slides.
- It works for various image format (e.g., png, bmp, jpg, tif, tiff) without format converting and does not require users to manually select segmentation models and image channels.
- The inference speed is fast (~0.07s for 256x256 image and ~0.33s for 512x512 image on NVIDAI 2080Ti).
Installation
pip install git+https://github.com/bowang-lab/unicell.git
Train UniCell
unicell_train -dir <path to training set> --model_folder <unicell> --batch_size 32
Training set folder structure
training_set/
|----images
|--------img1.png
|--------img2.jpg
|--------img3.bmp
|--------img4.tif
|--------img5.tiff
|----labels
|--------img1_label.tiff
|--------img2_label.tiff
|--------img3_label.tiff
|--------img4_label.tiff
|--------img5_label.tiff
UniCell does not have limitation on the image format. The corresponding labels should have a suffix _label.tiff
.
Inference
unicell_predict -i <input path> -o <output path> --pretrain_model unicell --contour_overlay
Compute metrics
We provide a interface to compute various metrics for cell segmentation results, including F1 score, precision, recall, the number of missing cells, the number of false-positive cells, and dice
com_metric -g <path to ground truth folder> -s <path to segmentation folder> -thre 0.5 0.7 0.9 -o <path to save folder> -n <csv name>
Graphical User Interface (GUI)
We develop a GUI plugin based on napari, which enables users who may not have coding experience to analyze their microscopy images visually in real time.
Install GUI: pip install napari-unicell
Online demo
We deploy an online demo on huggingface, which enables users to directly upload the cell images to get the segmentation results.
Remark: huggingface provides 2 free CPU for the deployment. So the inference can only use CPU, which is a little bit slow for large images (e.g., 1000x1000). We recommend using the command line interface or GUI to analyze large images if GPU is available on your local desktop.
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
Built Distributions
File details
Details for the file UniCell-0.0.1.tar.gz
.
File metadata
- Download URL: UniCell-0.0.1.tar.gz
- Upload date:
- Size: 19.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fec8b05057b7a509324c21f1a2fe992ca7f66f58cad54f503ec031355b179744 |
|
MD5 | d320935006ec5d0280f8c4a2123ef641 |
|
BLAKE2b-256 | d6fd8013cb81c05982ae0fb9d4b2525998926449728191ddd62ed3ef3a8ed4a7 |
File details
Details for the file unicell-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: unicell-0.0.1-py3-none-any.whl
- Upload date:
- Size: 27.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d333b50c962b17f1b5d9da54e28da6ecb4762e2bfeb68f4e1bd390d6b7dc0470 |
|
MD5 | 89a62a1b600c4c49685d531ee5e142a6 |
|
BLAKE2b-256 | a0ffb7ae501a2cac1a1ac663c52e918f57ef56fee158aef61a6c70308e0cfc70 |
File details
Details for the file UniCell-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: UniCell-0.0.1-py3-none-any.whl
- Upload date:
- Size: 27.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bd89e010c732035c27d01365046ddf6a55007228a77c6fae9c12eea86527b0c8 |
|
MD5 | 14a26a103116b385430ec2566152bc0e |
|
BLAKE2b-256 | 1e94c1ff308220cd2c6527852db5db4f9770ec1601234e8dfe40c58beea36c74 |