Skip to main content

Code style: black Ruff CodeFactor arXiv Documentation

CellViT/CellViT++ Inference


Documentation

The full documentation is available at: https://tio-ikim.github.io/CellViT-Inference/

The code can be assessed here: https://github.com/TIO-IKIM/CellViT-Inference

Documentation Sections

Section Description
📚 Installation Guide Detailed installation instructions for various environments
📝 Usage Documentation Comprehensive guide on how to use CellViT-Inference
💡 Examples Sample configurations and use cases

Installation

Hardware Requirements

  • 🚀 CUDA-capable GPU: A GPU with at least 24 GB VRAM (48 GB recommended for faster inference, e.g., RTX-A6000). We performed experiments using one NVIDIA A100 with 80GB VRAM.
  • 🧠 Memory: Minimum 32 GB RAM.
  • 💾 Storage: At least 30 GB disk space.
  • 🖥️ CPU: Minimum of 16 CPU cores.

Prerequisites

Before installing the package, ensure that the following prerequisites are met:

Binaries
  • libvips - Image processing library
  • openslide - Whole slide image library
  • gcc/g++ - C/C++ compilers
  • libopencv-core-dev - OpenCV core development files
  • libopencv-imgproc-dev - OpenCV image processing modules
  • libsnappy-dev - Compression library
  • libgeos-dev - Geometry engine library
  • llvm - Compiler infrastructure
  • libjpeg-dev - JPEG image format library
  • libpng-dev - PNG image format library
  • libtiff-dev - TIFF image format library

On Linux-based systems, you can install these using:

sudo apt-get install libvips openslide gcc g++ libopencv-core-dev libopencv-imgproc-dev libsnappy-dev libgeos-dev llvm libjpeg-dev libpng-dev libtiff-dev

Package installation

To install the package, follow these steps:

  1. Ensure that all prerequisites are installed as outlined above.

  2. Verify that OpenSlide (https://openslide.org/) is installed and accessible. If using conda, you can install it with:

    conda install -c conda-forge openslide
    
  3. Install PyTorch for your system by following the instructions at https://pytorch.org/get-started/locally/. Ensure that PyTorch >= 2.0 is installed. To view available versions and their corresponding CUDA versions, visit https://pytorch.org/get-started/previous-versions/. CellViT-Inference has been tested with PyTorch 2.2.2 and CUDA 12.1, such that we installed it via:

    pip install torch==2.2.2 torchvision==0.17.2 torchaudio==2.2.2 --index-url https://download.pytorch.org/whl/cu121
    
  4. Install the CellViT-Inference package using pip:

    pip install cellvit
    

Optional

To enable hardware-accelerated libraries, you can install the following optional dependencies:

  1. CuPy (CUDA accelerated NumPy): https://cupy.dev/
  2. cuCIM (RAPIDS cuCIM library): https://github.com/rapidsai/cucim

Check your installation and the system

To verify a successful installation, run the following command:

cellvit-check

The output should confirm that all required libraries are installed and accessible. If any libraries are missing, refer to the installation instructions for the respective library. This command will also check for optional dependencies and will print a warning if they are not installed. Installing these optional libraries is not required.

If using a virtual environment, ensure it is activated before running the command.

Examples and Usage

A thorough guideline on how to configure and run inference is provided in the Usage Documentation.

Additional examples can be found in the Examples Documentation.

Citation

CellViT++

@misc{horst2025cellvitenergyefficientadaptivecell,
      title   = {CellViT++: Energy-Efficient and Adaptive Cell Segmentation and  
                Classification Using Foundation Models},
      author  = {Fabian Hörst and Moritz Rempe and Helmut Becker and Lukas Heine and
                Julius Keyl and Jens Kleesiek},
      year    = {2025},
      eprint  = {2501.05269},
      archivePrefix = {arXiv},
      primaryClass  = {cs.CV},
      url     = {https://arxiv.org/abs/2501.05269},
}

CellViT

@ARTICLE{Horst2024,
  title    =  {{CellViT}: Vision Transformers for precise cell segmentation and
              classification},
  author   =  {Hörst, Fabian and Rempe, Moritz and Heine, Lukas and Seibold,
              Constantin and Keyl, Julius and Baldini, Giulia and Ugurel, Selma
              and Siveke, Jens and Grünwald, Barbara and Egger, Jan and
              Kleesiek, Jens},
  journal  =  {Med. Image Anal.},
  volume   =  {94},
  pages    =  {103143},
  month    =  {may},
  year     =  {2024},
  keywords =  {Cell segmentation; Deep learning; Digital pathology; Vision
              transformer},
  language = {en}
}

Metadata

Release files for cellvit 1.0.9

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

Source distribution (sdist)

Source distribution for cellvit 1.0.9
File Size Uploaded
cellvit-1.0.9.tar.gz 94.0 kB Details

Built distribution (wheel)

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

Total release size: 205.3 kB

Release files / cellvit-1.0.9.tar.gz

Download URL cellvit-1.0.9.tar.gz
Size 94.0 kB
Tags Source
SHA-256 checksum
How to use checksums
2d18480d27134ad5db7e282ab456f5fb8cf61f42c56e1157852b3a49f92db9b6
BLAKE2b-256 checksum
How to use checksums
0d43e47f53ffc225962cc86b969f8492396bbe478f3543de1ceac96837ab2c5a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.11

Release files / cellvit-1.0.9-py3-none-any.whl

Download URL cellvit-1.0.9-py3-none-any.whl
Size 111.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0dc07a8cb5dd4318882f5200d60170d3326de6de8514cae6f6dafe0a8230b699
BLAKE2b-256 checksum
How to use checksums
276a1a7316d23f7bb7c4086c1dd757ec24f64a7d2aa47a098553bac2006bcc4d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.11
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