From 037a8430f7d6e1ba28ac98175604341f788ef6a6 Mon Sep 17 00:00:00 2001 From: iback Date: Mon, 9 Sep 2024 08:54:06 +0000 Subject: [PATCH] splits between instance and sem models in version --- spineps/auto_download.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/spineps/auto_download.py b/spineps/auto_download.py index 82390b4..0b16ded 100644 --- a/spineps/auto_download.py +++ b/spineps/auto_download.py @@ -10,8 +10,9 @@ link = "https://github.com/Hendrik-code/spineps/releases/download/" current_highest_version = "v1.0.9" +current_instance_highest_version = "v1.2.0" -instances: dict[str, Path | str] = {"instance": link + current_highest_version + "/instance.zip"} +instances: dict[str, Path | str] = {"instance": link + current_instance_highest_version + "/instance.zip"} semantic: dict[str, Path | str] = { "t2w": link + current_highest_version + "/t2w.zip", "t1w": link + current_highest_version + "/t1w.zip", @@ -27,8 +28,9 @@ } -def download_if_missing(key, url): - out_path = Path(get_mri_segmentor_models_dir(), download_names[key] + "_" + current_highest_version) +def download_if_missing(key, url, is_instance: bool): + version = current_highest_version if not is_instance else current_instance_highest_version + out_path = Path(get_mri_segmentor_models_dir(), download_names[key] + "_" + version) if not out_path.exists(): download_weights(url, out_path)