Giter Site home page Giter Site logo

nuset-lib's Introduction

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

nuset-lib's People

Contributors

kushalkolar avatar blastorios avatar

Stargazers

Maximilian Hoffmann avatar HHHIT avatar Linfeng Yang avatar

Watchers

James Cloos avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.