Skip to content

Small Cellpose improvements#44

Merged
nilsmechtel merged 33 commits intoaicell-lab:mainfrom
hugokallander:main
Feb 16, 2026
Merged

Small Cellpose improvements#44
nilsmechtel merged 33 commits intoaicell-lab:mainfrom
hugokallander:main

Conversation

@hugokallander
Copy link
Copy Markdown
Member

@hugokallander hugokallander commented Dec 16, 2025

  • Added ensure_3_channels_batch
  • Added validation performance logging during training
  • Made test, instead of prod, deployment default. TODO: replace ri-scale workspace with bioimage-io after given access

@hugokallander hugokallander changed the title Add ensure_3_channels_batch to cellpose Small Cellpose improvements Dec 16, 2025
Comment thread bioengine_apps/cellpose_finetuning/scripts/redeploy_cellpose.py Outdated
Comment thread bioengine_apps/cellpose_finetuning/main.py Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would maybe swap the name, and keep manifest.yaml for the prod, and manifest-test.yaml for dev.

Comment thread bioengine_apps/cellpose_finetuning/main.py
Copy link
Copy Markdown
Contributor

@oeway oeway left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did a quick review, the changes looks good to me! I assume you have already tested it?

I made a few comments, would be nice if you can take a stab on them. Thanks!

Comment thread bioengine_apps/cellpose_finetuning/main.py
hugokallander and others added 6 commits February 5, 2026 16:15
Resolved conflict in update_status() keeping main's read-modify-write
pattern while adding PR's test_metrics parameter.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Fix _predict_and_encode() missing output=mask_np (broke inference)
- Preserve update_status() read-modify-write pattern with test_metrics
- Restore dataset_artifact_id in SessionStatus and start_training()
- Restore training history inheritance including test_metrics
- Fix SessionStatusWithId for Ray cloudpickle compatibility
- Deduplicate metrics: extract _binary_threshold helper to module level
- Remove all cast() calls (19 -> 0), reduce # type: ignore (90 -> 22)
- Delete manifest-test.yaml (referenced non-existent class)
- Restore deploy_cellpose.py with argparse and production defaults
- Fix redeploy/test scripts to default to production target
- Add wait-for-services logic in deploy/redeploy scripts
- Add py.typed PEP 561 marker
- Update README: validation metrics docs, CLI args, example scripts

Deployed and tested: training (3 epochs), inference, dataset_artifact_id
all verified on https://hypha.aicell.io.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@oeway
Copy link
Copy Markdown
Contributor

oeway commented Feb 11, 2026

FYI: hugokallander#1

oeway and others added 6 commits February 11, 2026 04:42
…cs, consistent sentinels

- Add validation_interval parameter to start_training() API (default: every 10 epochs)
- Add InstanceMetrics (AP@0.5/0.75/0.9) computed at end of training via cellpose.metrics
- Change test_losses sentinel from 0.0 to None for non-evaluated epochs
- Clarify ValidationMetrics docstring: pixel-level binary foreground, NOT instance segmentation
- Update consumer scripts (test_service.py, test_callbacks.py) to filter with `is not None`
- Add --validation-interval CLI arg to test_service.py
- Update README with new parameters, metrics docs, and filter patterns
- Deployed and tested end-to-end: 3 epochs, validation_interval=1, instance metrics computed

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…x CLI args

- Add stop_training() and list_training_sessions() API docs
- Remove non-existent list_pretrained_models() from README
- Add missing params: min_train_masks, return_flows, validation_interval in examples
- Add missing status fields: current_batch, total_batches, exported_artifact_id, model_modified
- Fix status_type values: add "stopped" and "unknown"
- Fix export_model() model_name as optional
- Fix save_application.py CLI: --server-url not --server_url
- Fix list_training_sessions() to include dataset_artifact_id and instance_metrics
- Add "Validation Metrics" to Features list

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@oeway
Copy link
Copy Markdown
Contributor

oeway commented Feb 12, 2026

@hugokallander could you resolve this and merge, then we deploy the merged version?

@hugokallander
Copy link
Copy Markdown
Member Author

Updated this PR to include changes from PR #46 and local fixes. This branch now contains the consolidated work for Cellpose finetuning improvements.

@nilsmechtel nilsmechtel merged commit d18c693 into aicell-lab:main Feb 16, 2026
1 check passed
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.

3 participants