Skip to content

Downloads model weights for promptable sam and sam2 when user tries to use them first time#989

Merged
ElpadoCan merged 4 commits intoSchmollerLab:mainfrom
keejkrej:fix/model_download
Jan 29, 2026
Merged

Downloads model weights for promptable sam and sam2 when user tries to use them first time#989
ElpadoCan merged 4 commits intoSchmollerLab:mainfrom
keejkrej:fix/model_download

Conversation

@keejkrej
Copy link
Contributor

No description provided.

keejkrej and others added 3 commits January 28, 2026 19:24
Add download logic to widgets.py selectModel() for segment_anything
and sam2 promptable models, consistent with normal model workflow.

Fixes SchmollerLab#986 - FileNotFoundError when using segment_anything promptable
model for the first time because weights weren't downloaded.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add sam2_weights_filenames to __init__.py so check_model_exists()
works correctly for SAM2. This ensures the download warning dialog
appears before downloading SAM2 weights, consistent with other models.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@keejkrej
Copy link
Contributor Author

Related to #986

@ElpadoCan
Copy link
Collaborator

Hi @keejkrej, thanks for doing this!

One question, what is the reason of moving matplotlib to main dependencies? Do you know if matplotlib can be installed on headless clusters without problems? The reason why it was not a main dependency is that cellacdc is installed headless by default. If you don't know this, I can test on our headless server, thanks!

Remove the model name check so download is triggered for all promptable
models, consistent with gui.py behavior.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@ElpadoCan ElpadoCan merged commit 3deb400 into SchmollerLab:main Jan 29, 2026
17 checks passed
@ElpadoCan
Copy link
Collaborator

Merged! Thanks again for this!

@keejkrej keejkrej deleted the fix/model_download branch January 29, 2026 11:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants