API Guide¶
samstars exposes a small training and segmentation interface, plus component functions for prepared tiles, records, and custom reruns.
Model Bundle Workflow¶
Use these objects for most training and segmentation runs:
samstars.train(...)samstars.segment(...)samstars.SamStarssamstars.SamStarsResult
train(...) writes a model bundle and returns a SamStars runtime wrapper.
segment(...) accepts either a bundle path or an existing SamStars instance and returns a SamStarsResult.
1 2 3 4 5 6 7 8 9 10 11 12 | |
Use the model bundle workflow when you want stored defaults and a single model directory to pass between training and segmentation.
Component Functions¶
Use these functions when you want direct control over prepared tiles, run records, SAM checkpoints, or StarDist model directories:
samstars.datasamstars.segmentation.run_segmentation(...)samstars.training.chipssamstars.training.recordssamstars.training.sam_trainingsamstars.training.stardist_training
run_segmentation(...) uses a direct SAM decoder checkpoint path and a direct StarDist model path.
1 2 3 4 5 6 7 8 9 10 | |
Use these functions for experiments, partial reruns, and custom training workflows.
Feature Helpers¶
Use this module when you need custom feature preparation:
samstars.features
It exposes cost-surface and seed-generation helpers.
Choosing an Interface¶
Start with train(...) and segment(...).
Use component functions when you need separate model-file paths, prepared-tile records, or partial stage control.
Use feature helpers when you are replacing or inspecting part of the data-preparation workflow.