Skip to content

Images and radiographs

Required files

Use a compatible vision-language model and its matching projector. The image path currently targets compatible Gemma 3 / MedGemma models on macOS. The Mac image path is not a claim of equivalent CUDA image support.

spum run medgemma-4b-it-Q4_K_M.gguf --gpu \
  --mmproj mmproj-F16.gguf \
  --image chest-xray.jpg \
  -p "Describe the visible anatomy and any limitations of this image." \
  --temperature 0 --seed 42 --max-tokens 192

If the matching projector sits beside the model in a recognized layout, it may be discovered automatically. Use --mmproj when discovery is ambiguous.

Record an image run

spum run model.gguf --gpu --mmproj projector.gguf \
  --image image.png --prompt-file image-question.txt \
  --json --output image-result.json --no-image-cache

The response belongs to that model and prompt. A fast description is not diagnostic validation. Image-encoding time, prompt processing and generation are distinct measurements. --no-image-cache disables persistent caching for this invocation; it does not erase earlier cache files.

CPU image encoding

spum run model.gguf --gpu --vision-cpu --mmproj projector.gguf \
  --image image.jpg -p "Describe this image."

The image encoder runs on CPU while the supported language-model path can still use GPU. Use --cpu to select CPU model execution as well.

Specialized localization commands

These interfaces require separately supplied compatible model assets. A MedGemma GGUF alone is not a detection or segmentation pack.

spum xray /path/to/modelpack --image chest-xray.jpg --output xray-results
spum detect /path/to/modelpack --image image.jpg --output findings.json
spum segment encoder.mlmodelc decoder.mlmodelc \
  --image image.jpg --detections findings.json --mask mask.pgm

A command being present does not establish validated clinical performance. Do not use a demonstration mask or generated sentence as ground truth. Evaluate localization against expert annotations on held-out data before making an accuracy claim.