Views
No views yet
cpsam model fine-tuned to
segment individual crystals in microscopy images of crystallization. Given a
frame, it produces an instance mask (one label per crystal), from which centroid
and pixel-area measurements are derived.crystal_detector component of the
crystalization research
project — the deep-learning counterpart to that repo's deterministic
(focus/motion) crystal annotator.1uv sync --group crystal-detector
2uv run crystal-detector-analyze image.pnghuggingface_hub + Cellpose:1import torch
2from huggingface_hub import hf_hub_download
3from cellpose import models
4
5ckpt = hf_hub_download("MarekWadinger/crystal-detector-cpsam", "cpsam_20260517_223507")
6model = models.CellposeModel(gpu=torch.cuda.is_available(), pretrained_model=ckpt)
7masks, flows, _ = model.eval(image, diameter=None, flow_threshold=0.9, cellprob_threshold=-2.0)flow_threshold=0.9 and
cellprob_threshold=-2.0, on images preprocessed with flat-field correction +
CLAHE (see src/crystal_detector/analyze.py).cpsam model in the Cellpose GUI on
flat-field-corrected microscopy frames, with masks hand-corrected per image.
The frame-export and training workflow is documented in the project's
component README.