Downloads · 30 days
0
MarekWadinger/crystal-detector-cpsam
crystal-detector-cpsam is a image segmentation model from MarekWadinger. Use it for the image segmentation task on the model card, and read the license before you ship it in a product. It is set up for cellpose. The card lists the license as bsd-3-clause.
A Cellpose 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 measure…
Downloads · 30 days
0
Access
Public
Updated Jun 22, 2026
Repo size
1.2 GB
Likes
0
Public
Click a slice to open those files.
Other1.2 GB · 100%
From the Hugging Face model README
A Cellpose 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.
This checkpoint backs the crystal_detector component of the
crystalization research
project — the deep-learning counterpart to that repo's deterministic
(focus/motion) crystal annotator.
The project downloads and caches this checkpoint automatically:
uv sync --group crystal-detector
uv run crystal-detector-analyze image.png
Or directly with huggingface_hub + Cellpose:
import torch
from huggingface_hub import hf_hub_download
from cellpose import models
ckpt = hf_hub_download("MarekWadinger/crystal-detector-cpsam", "cpsam_20260517_223507")
model = models.CellposeModel(gpu=torch.cuda.is_available(), pretrained_model=ckpt)
masks, flows, _ = model.eval(image, diameter=None, flow_threshold=0.9, cellprob_threshold=-2.0)
The inference defaults used by the project are flow_threshold=0.9 and
cellprob_threshold=-2.0, on images preprocessed with flat-field correction +
CLAHE (see src/crystal_detector/analyze.py).
Fine-tuned from the base Cellpose 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.
Released under BSD-3-Clause, matching the upstream Cellpose license.