Skip to content

Commit

Permalink
Merge pull request #30 from Hendrik-code/2ndphase
Browse files Browse the repository at this point in the history
splits between instance and sem models in version
  • Loading branch information
Hendrik-code authored Sep 9, 2024
2 parents 002245a + 7f3b2ad commit c4e40c6
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 c4e40c6

Please sign in to comment.