Skip to content

Commit

Permalink
splits between instance and sem models in version
Browse files Browse the repository at this point in the history
  • Loading branch information
Hendrik-code committed Sep 9, 2024
1 parent 9f211c8 commit 037a843
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions spineps/auto_download.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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)

Expand Down

0 comments on commit 037a843

Please sign in to comment.