Skip to content

Refactor models API - #18

Merged
elevans merged 15 commits into
mainfrom
refactor-models-api
Jun 25, 2026
Merged

Refactor models API#18
elevans merged 15 commits into
mainfrom
refactor-models-api

Conversation

@elevans

@elevans elevans commented Jun 24, 2026

Copy link
Copy Markdown
Member

This PR refactors the models API to allow custom .bpk format weights.

elevans added 8 commits June 22, 2026 11:31
This commit implements how I want models to work
going forward. The target API looks like this now:

```rust
use cellcast::models::StarDist2D;

let sd = StarDist2D::init_fluo("path/to/weights.bpk", gpu=true);
let labels = sd.predict_fluo(&data);
```
The versatile name refers to the pretrained model
that has been trained on a large variety of data.
But any model can be used with the networks. Thus
they are now renamed "fluo" and "he" in refeference
to the type of data they target.
@elevans

elevans commented Jun 24, 2026

Copy link
Copy Markdown
Member Author

Cellcast core compiles but I need to update the pyo3 Python bindings.

@elevans elevans changed the title Refactor models api Refactor models API Jun 24, 2026
@elevans
elevans marked this pull request as ready for review June 25, 2026 14:09
@elevans

elevans commented Jun 25, 2026

Copy link
Copy Markdown
Member Author

Overall I like the way the new API works. It allows for custom weights to now be used with cellcast's StarDist models. Going forward new additions to cellcast should follow this pattern.

There is still more to do like clean up the docstring and optimizations. Additionally I want to re-work on the warm_up functions work. I prefer to do that work on main so I will merge this PR now.

@elevans
elevans merged commit e0c901f into main Jun 25, 2026
3 checks passed
@elevans
elevans deleted the refactor-models-api branch June 25, 2026 14:12
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.

1 participant