Skip to content

Commit

Permalink
Fixup model extraction code.
Browse files Browse the repository at this point in the history
  • Loading branch information
rossbar committed Apr 5, 2024
1 parent 110e01e commit a84bd37
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cellSAM/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ def get_model(model: nn.Module = None) -> nn.Module:
cellsam_assets_dir.mkdir(parents=True, exist_ok=True)
if not model_path.exists():
fetch_data("models/cellsam_base.tar.gz", cache_subdir="models")
extract_archive(model_path, cellsam_assets_dir)
extract_archive(
cellsam_assets_dir / "cellsam_base.tar.gz", cellsam_assets_dir
)
assert model_path.exists()
model = CellSAM(config)
model.load_state_dict(torch.load(model_path))
Expand Down

0 comments on commit a84bd37

Please sign in to comment.