BiaPy

Accessible deep learning on bioimages

Latest release notes

🔥NEWS🔥: BiaPy's paper is finally out in Nature Methods!
[Preprint in bioRxiv]

  •   Download
    Get Additional Installers   |  

    Please install Docker to use the GUI following these instructions.
    Find instructions on how to use the GUI in this video.

    You can also install previous versions of BiaPy's graphical user interface.

  • For each workflow we have both 2D and 3D versions:

    Image classification
    (2D)
    Image denoising
    (2D)
    Image to image
    (2D)
    Instance segmentation
    (2D)
    Object detection
    (2D)
    Self-supervision
    (2D)
    Semantic segmentation
    (2D)
    Super-resolution
    (2D)
    Image classification
    (3D)
    Image denoising
    (3D)
    Image to image
    (3D)
    Instance segmentation
    (3D)
    Object detection
    (3D)
    Self supervision
    (3D)
    Semantic segmentation
    (3D)
    Super-resolution
    (3D)

    For just predicting/inference you can use the following notebook:

    Inference
    (2D/3D)
  • BiaPy is available as a tool in the Galaxy platform, enabling users to run biomedical image analysis workflows through an intuitive, web-based interface without requiring any local installation. The tool can be accessed directly from the Galaxy ToolShed at this link, and it can also be found by searching for “biapy” in the Galaxy ToolShed interface here.

  • We have a container prepared to run BiaPy:

    Docker Engine is available for Windows, macOS, and Linux, through Docker Desktop. For instructions on how to install Docker Desktop, see:

  • If you want to use BiaPy as a library in your own Python scripts, you can install it via pip:

    pip install biapy
    

    or via conda/mamba:

    conda install -c conda-forge biapy
    

    pip install biapy and conda install -c conda-forge biapy already pull in a compatible CPU build of PyTorch as part of dependency resolution. If you have an NVIDIA GPU, replace it with a matching CUDA build afterwards: check the torch/torchvision versions pinned in BiaPy’s pyproject.toml (as of BiaPy 3.6.8: torch==2.12.1 / torchvision==0.27.1) and reinstall that exact pair through the official PyTorch selector for your CUDA version, for example:

    pip install torch==2.12.1 torchvision==0.27.1 --index-url https://download.pytorch.org/whl/cu126
    

    After that you can import BiaPy in your Python scripts:

    import biapy
    

    You can find more information in the following sections:

    • Library examples that show how to use BiaPy as a library in your own Python scripts.
    • API documentation for more information on how to use BiaPy as a library in your own Python scripts.
  • You have three different options to install BiaPy. Choose one or another depending on your preferences:

    • To use BiaPy via the command line, you will need to set up a conda environment. To do this, you will first need to install Conda. Then choose one of the following options based on your machine capabilities:

      A. GPU-capable machine (NVIDIA GPU)

      conda config --set channel_priority strict
      conda create -n BiaPy_env -c conda-forge python=3.11 biapy pytorch-gpu
      conda activate BiaPy_env
      

      Verify GPU at runtime:

      python -c 'import torch; print(torch.__version__)'
      >>> 2.12.1
      python -c 'import torch; print(torch.cuda.is_available())'
      >>> True
      

      B. CPU-only machine

      conda config --set channel_priority strict
      conda create -n BiaPy_env -c conda-forge python=3.11 biapy
      conda activate BiaPy_env
      
    • Before you begin, ensure you have Mamba installed. Mamba is a faster alternative to Conda and can be used to manage your conda environments.Once you have mamba installed you will to choose one of the following options based on your machine capabilities:

      A. GPU-capable machine (NVIDIA GPU)

      mamba create -n BiaPy_env -c conda-forge python=3.11 biapy pytorch-gpu
      mamba activate BiaPy_env
      

      Verify GPU at runtime:

      python -c 'import torch; print(torch.__version__)'
      >>> 2.12.1
      python -c 'import torch; print(torch.cuda.is_available())'
      >>> True
      

      B. CPU-only machine

      mamba create -n BiaPy_env -c conda-forge python=3.11 biapy
      mamba activate BiaPy_env
      
    • Set up a conda/mamba environment:

      mamba create -n BiaPy_env -c conda-forge python=3.11
      mamba activate BiaPy_env
      

      Clone BiaPy repository:

      git clone https://github.com/BiaPyX/BiaPy.git
      cd BiaPy
      

      Check pyproject.toml for the exact supported torch/torchvision versions (as of BiaPy 3.6.8: torch>=2.12,<2.13 / torchvision>=0.27,<0.28, i.e. the 2.12.1 / 0.27.1 pair). Install that exact pair, choosing GPU or CPU. Use the official PyTorch selector to find the right --index-url for your CUDA version (the selector always proposes the latest torch release, so replace the version-less command it gives you with the pinned versions below). Check nvidia-smi first: the “CUDA Version” it reports is the newest CUDA build your driver can run, so pick an index whose CUDA version does not exceed it, for example:

      # GPU (CUDA 12.6, for example)
      pip install torch==2.12.1 torchvision==0.27.1 --index-url https://download.pytorch.org/whl/cu126
      
      # CPU only
      pip install torch==2.12.1 torchvision==0.27.1 --index-url https://download.pytorch.org/whl/cpu
      

      Install BiaPy in editable mode:

      pip install -e .