Skip to main content

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.

Metadata

Release files for npsam 3.2.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for npsam 3.2.3
File Size Uploaded Provenance Actions
npsam-3.2.3.tar.gz 158.4 kB Without provenance Details for npsam-3.2.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for npsam 3.2.3
File Interpreter ABI Platform Actions
npsam-3.2.3-py3-none-any.whl Python 3 none any Details for npsam-3.2.3-py3-none-any.whl

Total release size: 323.8 kB

Release files / npsam-3.2.3.tar.gz

Download URL npsam-3.2.3.tar.gz
Size 158.4 kB
Tags Source
SHA-256 checksum
How to use checksums
e357b6877ce710072ff6e0ba04cfd3977bb35b02dc37ef3fdae3c47c5c088134
BLAKE2b-256 checksum
How to use checksums
b17f9288e15163f1f6bcc0d7c5a5ef154c7a2413f7b09b0e7360e703994eb7ab
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.15

Release files / npsam-3.2.3-py3-none-any.whl

Download URL npsam-3.2.3-py3-none-any.whl
Size 165.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7a9e69786fb55f91498e77fedf95f41b215555e948d169e3cf1106be9ac3b854
BLAKE2b-256 checksum
How to use checksums
4d445cd0d8c93018e7094415a94e6cbc60e612bd41568dd256fe9111534b668b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.15

Security for npsam 3.2.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

3.2.3 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page