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 Distribution
File details
Details for the file unicell-0.0.1.post0.tar.gz
.
File metadata
- Download URL: unicell-0.0.1.post0.tar.gz
- Upload date:
- Size: 20.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b9749dada9ef9537c355b4677e82fdf2b671ea423eb0d048d6ffdd378c7f465f |
|
MD5 | f4dad7544da22ceb39780a5a299eedc9 |
|
BLAKE2b-256 | 94c4f6d9c514ff17e747713a455ebf2515f8874cfcef39ace065566cd1756f87 |
File details
Details for the file unicell-0.0.1.post0-py3-none-any.whl
.
File metadata
- Download URL: unicell-0.0.1.post0-py3-none-any.whl
- Upload date:
- Size: 27.7 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 | f03351fe686f0f57ad91d330538ffc15919808ea4613e8d6e6f779249bba6316 |
|
MD5 | 6ba02d4ac06e76a7fe870046b878b7d4 |
|
BLAKE2b-256 | 48513427bec5b36d4a3146d829632989fcb6dac45c0f508c17d756efe3f7aa3b |