File size: 868 Bytes
24fceea | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | #!/bin/bash
set -e
# CancerVerse CT volumes and metadata from https://huggingface.co/datasets/BodyMaps/CancerVerse
# Needs the Hugging Face CLI: pip install -U "huggingface_hub[cli]"
if ! command -v hf > /dev/null; then
echo "The Hugging Face CLI (hf) is not installed. Run: pip install -U \"huggingface_hub[cli]\""
exit 1
fi
# Download CancerVerse_dataset_metadata.csv and CancerVerse/CV_XXXXXXXX/ct.nii.gz (24,422 CTs, ~3 TB) into this folder.
# hf download skips files it already has, so an interrupted download (e.g. a rate limit) resumes where it stopped.
echo "Downloading CancerVerse CT volumes and metadata..."
until hf download BodyMaps/CancerVerse --repo-type dataset --local-dir . \
--include "CancerVerse_dataset_metadata.csv" "CancerVerse/*"; do
echo "Download interrupted at $(date). Retrying in 30 minutes..."
sleep 1800
done
|