Skip to content

Commit

Permalink
Allow napari GUI to accept custom weights (#460)
Browse files Browse the repository at this point in the history
* Check if provided model is weights only and work around

* Period to commit
  • Loading branch information
IgorTatarnikov authored Oct 8, 2024
1 parent 34c8a3f commit 894c285
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions cellfinder/core/classify/classify.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,14 @@ def main(
workers=workers,
)

if trained_model and trained_model.suffix == ".h5":
print(
"Weights provided in place of the model, "
"loading weights into default model."
)
model_weights = trained_model
trained_model = None

model = get_model(
existing_model=trained_model,
model_weights=model_weights,
Expand Down

0 comments on commit 894c285

Please sign in to comment.