No project description provided
Project description
nuset-lib
NuSeT packaged as a library with an easy to use API
nuset-lib
is based on the NuSeT package by Linfeng Yang: https://github.com/yanglf1121/NuSeT
Their paper: https://www.biorxiv.org/content/10.1101/749754v1
Please cite their paper if you use nuset-lib
Training is not yet implemented but it can be used for predicting.
Installation
nuset-lib
can be installed via pip
.
You will need to install tensorflow-gpu
or tensorflow
before installing nuset-lib
# tensorflow 1.15 will not install with older pip & setuptools
pip install --upgrade pip setuptools wheel
pip install tensorflow-gpu~=1.15 # or tensorflow~=1.15
pip install nuset-lib
After installation
~1GB of network weights will be downloaded the first time that you import nuset
.
By default these network weight files are kept in your user home directory.
If you do not want these files to be stored in your home directory (such as with shared computing systems, limited user quotas etc.),
you may specify a different location by setting the following environment variable:
export NUSET_CONFIG=/path/to/dir
On RTX 2000 series cards you will need to set the following environment variable due to a bug in tensorflow:
export TF_FORCE_GPU_ALLOW_GROWTH=true
Basic Usage
from nuset import Nuset
import numpy as np
from matplotlib import pyplot as plt
import tifffile
img = tifffile.imread('path to file')
nuset = Nuset()
mask = nuset.predict(
image=img,
watershed=True,
min_score=0.8,
nms_threshold=0.1,
rescale_ratio=2.5
)
thr = 0.7
mask[mask < thr] = 0
mask[mask > thr] = 1
fig = plt.figure(figsize=(15, 15))
plt.imshow(img, cmap='viridis')
plt.imshow(mask, alpha=0.5)
plt.show()
You may benefit from preprocessing the image to adjust gamma, equalize the histogram etc.
See the example notebook for more details: https://github.com/kushalkolar/nuset-lib/blob/master/example.ipynb
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
Hashes for nuset_lib-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f8973b224973274bf99bb4e69f696557cba6b1be1e93db7676f52f4d365c7e2e |
|
MD5 | fdb3c83db4100f1e8d6383a038ec7692 |
|
BLAKE2b-256 | 6004121c0d1de52c6fe7cae487e1eb12e6e8eb2b9b36e4dcb5cb9722963f6517 |