Skip to content

DL models: Inference time

Jan Valosek edited this page Oct 16, 2025 · 7 revisions

Inference time of SCT DL models

This table tracks the inference time of different SCT deep learning models on different images and different hardware.

DL Model Name Image Used Image pixdim Image dim GPU Inference Time GPU Specs CPU Inference Time CPU Specs SCT Version DL Model Release
sct_deepseg -task seg_sc_lesion_t2w_sci $SCT_DIR/data/sct_course_data/single_subject/data/t2/t2.nii.gz 0.8, 0.8, 0.8 64, 320, 320 0 m 8 s NVIDIA RTX 3080 (12GB) 0 m 54 s Intel i7-7820X (16 core, 128GB RAM) 6.5 cae52ada r20240729
sct_deepseg -task seg_sc_contrast_agnostic $SCT_DIR/data/sct_course_data/single_subject/data/t2/t2.nii.gz 0.8, 0.8, 0.8 64, 320, 320 - (crashing) NVIDIA RTX 3080 (12GB) 0 m 4 s Intel i7-7820X (16 core, 128GB RAM) 6.5 cae52ada v2.5

Data

You can download the example data using the following command:

sct_download_data -d sct_course_data

Getting image details

You can get pixdim and dim of an image using the sct_image -i command:

sct_image -i <IMAGE> -header | grep pixdim
sct_image -i <IMAGE> -header | grep dim | head -n 1

Getting GPU and CPU inference time

After running a sct_deepseg model, copy the inference time from the output. For example:

$ sct_deepseg -i t2.nii.gz -task seg_sc_lesion_t2w_sci
...
Total inference time: 0 minute(s) 8 seconds
...

GPU inference

You can run a model on GPU using the following command:

CUDA_VISIBLE_DEVICES=0 SCT_USE_GPU=1 sct_deepseg -i ${file}.nii.gz -task seg_sc_lesion_t2w_sci

See, the Installing for GPU inference guide for more information on how to set up SCT for GPU inference.

CPU inference

To run a model on CPU, simply run the sct_deepseg command without the SCT_USE_GPU=1 variable, for example:

sct_deepseg -i ${file}.nii.gz -task seg_sc_lesion_t2w_sci

Getting GPU and CPU specs

You can get your GPU specs using the nvidia-smi command:

nvidia-smi

You can get your CPU specs using the lscpu command:

lscpu

Getting SCT version

You can get the SCT version using the sct_version command:

sct_version

Getting DL model release

You can get the DL model release from the sct_deepseg output. For example:

$ sct_deepseg -i t2.nii.gz -task seg_sc_lesion_t2w_sci
...
Model 'model_seg_sci_multiclass_sc_lesion_nnunet' is up to date (Source: https://github.com/ivadomed/model_seg_sci/releases/download/r20240729/model_SCIsegV2_r20240729.zip)
...

Clone this wiki locally