Skip to main content

NP-SAM is an easy-to-use segmentation and analysis tool for nanoparticles and more.

Project description

NP-SAM

Introduction

In this project we propose an easily implementable workflow for a fast, accurate and seamless experience of segmentation of nanoparticles.

The project's experience can be significantly enhanced with the presence of a CUDA-compatible device; alternatively, Google Colab can be utilized if such a device is not accessible. For a quick access to the program and a CUDA-GPU try our Google Colab notebook.
Google Colab

Installation

Windows Application

Download one of the .zip files below and extract the content. Afterwards, simply run the .exe file.

NP-SAM for PCs with CUDA compatible graphics card (2.5 GB) here: NP-SAM with CUDA

NP-SAM for PCs without CUDA compatible graphics card (500 MB) here: NP-SAM without CUDA

Python package

Step 0 (Optional): Create a new conda environment called npsam (line 1) and activate it (line 2). This prevents interference with other previously installed Python packages.

conda create -n npsam python=3.10
conda activate npsam

Step 1: Install Pytorch. If you use Windows and have a CUDA compatible graphics card, you can use the following line of code:

pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118

Otherwise, install the CPU-only version with:

pip3 install torch torchvision torchaudio

For other operating systems, please refer to PyTorch's website. NP-SAM has been tested with Pytorch 2.1.2 and CUDA 11.8.

Step 2: Install NP-SAM:

pip install npsam

Step 3 (Optional): Make a static link to the npsam ipykernel for easy access to the npsam environment from JupyterLab. This way you don't have to activate the npsam environment every time you want to run NP-SAM.

python -m ipykernel install --user --name npsam --display-name npsam

Get started

In the npsam environment execute jupyter lab in the terminal. This will launch JupyterLab. Try out one of the example notebooks from our GitLab.

Citation

@article{NPSAM,
   author = {Rohde, Rasmus and Villadsen, Torben L. and Mathiesen, Jette K. and Jensen, Kirsten M. Ø and Bøjesen, Espen D.},
   title = {NP-SAM: Implementing the Segment Anything Model for Easy Nanoparticle Segmentation in Electron Microscopy Images},
   journal = {ChemRxiv},
   DOI = {10.26434/chemrxiv-2023-k73qz-v2},
   year = {2023},
   type = {Journal Article}
}

Acknowledgment

This repo benefits from Meta's Segment Anything and FastSAM. Thanks for their great work.

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

npsam-3.2.0.tar.gz (156.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

npsam-3.2.0-py3-none-any.whl (164.2 kB view details)

Uploaded Python 3

File details

Details for the file npsam-3.2.0.tar.gz.

File metadata

  • Download URL: npsam-3.2.0.tar.gz
  • Upload date:
  • Size: 156.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.15

File hashes

Hashes for npsam-3.2.0.tar.gz
Algorithm Hash digest
SHA256 945a5c02d71a2944b4e24becbf918dadc656ad4eb712fd0caae00c822447cc6a
MD5 7c8ba2f1836014ca6c8fff0e794e949f
BLAKE2b-256 843c2acf5263703a3fc8a17ff6087eeee8b45923bdf21734ecda37ee3d6697f6

See more details on using hashes here.

File details

Details for the file npsam-3.2.0-py3-none-any.whl.

File metadata

  • Download URL: npsam-3.2.0-py3-none-any.whl
  • Upload date:
  • Size: 164.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.15

File hashes

Hashes for npsam-3.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5f345fe7cd9c2d8be7b612872888a9a200a3d99af7af2bb3708a79326a8b5016
MD5 3b589cda1c2b048658b09dbf4e982cc4
BLAKE2b-256 06c700b83c4487098fba6918e6924cc13b18202863232be21edc68b5c917907e

See more details on using hashes here.

Supported by

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