Skip to content

Apptainer Container

Apptainer/Singularity images for pybioclip are provided at ghcr.io/Imageomics/pybioclip-sif registry.

NOTE: It is also possible to download the pybioclip docker container and convert that into a singularity container, but that process can take quite a while.

Tutorial

Download example images

Download two images from the bioclip-demo.

wget https://huggingface.co/spaces/imageomics/bioclip-demo/resolve/main/examples/Ursus-arctos.jpeg
wget https://huggingface.co/spaces/imageomics/bioclip-demo/resolve/main/examples/Felis-catus.jpeg

Download a pybioclip container

apptainer pull oras://ghcr.io/imageomics/pybioclip-sif:1.0.0
The above command will create a pybioclip_1.0.0.sif container image file.

Create predictions using a CPU

./pybioclip_sif_1.0.0.sif bioclip predict Ursus-arctos.jpeg Felis-catus.jpeg

Create predictions using a GPU

This step requires a cuda GPU.

apptainer exec -nv ./pybioclip_sif_1.0.0.sif bioclip predict --device cuda Ursus-arctos.jpeg Felis-catus.jpeg

Create predictions using a GPU via a Slurm Job

This step requires being on a Slurm cluster.

Create a Slurm sbatch script named bioclip.sh with the following content:

#!/bin/bash
#SBATCH --nodes=1
#SBATCH --time=00:10:00
#SBATCH --gpus-per-node=1
apptainer exec --nv ./pybioclip_sif_1.0.0.sif bioclip predict --device cuda $*
Run the slurm job filling in your Slurm account:
sbatch --account <SLURMACCT> bioclip.sh Ursus-arctos.jpeg Felis-catus.jpeg