Skip to main content

No project description provided

Project description

nuset-lib

PyPI version

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://journals.plos.org/ploscompbiol/article?id=10.1371/journal.pcbi.1008193

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.

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nuset-lib-0.2.0.tar.gz (185.1 kB view details)

Uploaded Source

Built Distribution

nuset_lib-0.2.0-py3-none-any.whl (196.2 kB view details)

Uploaded Python 3

File details

Details for the file nuset-lib-0.2.0.tar.gz.

File metadata

  • Download URL: nuset-lib-0.2.0.tar.gz
  • Upload date:
  • Size: 185.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.2

File hashes

Hashes for nuset-lib-0.2.0.tar.gz
Algorithm Hash digest
SHA256 c01ad92436305a685e545e95f19a368b30588b03f0089d765db957ea263549e7
MD5 70b29ef2a262c5ed433f23a9f36c0069
BLAKE2b-256 0c01de6367ae34a47552f32758afa50052fedc1dc3102fc904283b4817d14c94

See more details on using hashes here.

File details

Details for the file nuset_lib-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: nuset_lib-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 196.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.2

File hashes

Hashes for nuset_lib-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a48fcfe7bbc38a06f4757e71abdeb274ab7bea1ad589ffc832fed615921cc0b5
MD5 08a8425aacdf2669b0a86e58ba90b2e0
BLAKE2b-256 9ac93c096ac06a5de5c17587caac5fab012f9c73378ff51703985f36d7ac0888

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page