CoolFace
Modelpublic

sklumpe/fibsemos-drosophila-follicle-cells-v1

sourceHugging Facecc-by-4.0updated 2mo agoView on Hugging Face
0likes
Model Card

fibsemOS — Drosophila melanogaster follicle-cell cryo-FIB segmentation (nnU-Net)

nnU-Net v2 model for semantic segmentation of cryo-FIB images of **Drosophila melanogaster follicle cells**, trained for the fibsemOS automated-milling pipeline.

  • —Task: Automated milling / semantic segmentation
  • —Framework: nnU-Net v2 (U-Net), configuration 2d
  • —Input axes: yx (single-channel grayscale)
  • —Checkpoint: checkpoint_best.pth, fold 0
  • —Classes (4): Cracks, Contamination, Grid bars, Cells
  • —Authors: IMP & IMBA, Vienna BioCenter
  • —Ion source: <!-- TODO: plasma or gallium FIB -->
  • —Training images: <!-- TODO: number of images -->

Files

  • —model.zip — nnU-Net trained-model folder (contains plans.json, dataset.json, fold_0/).

Usage

Run it in the fibsemOS Model Zoo Space, or locally:

python
import zipfile, numpy as np, torch
from PIL import Image
from huggingface_hub import hf_hub_download
from nnunetv2.inference.predict_from_raw_data import nnUNetPredictor

zip_path = hf_hub_download("sklumpe/fibsemos-drosophila-follicle-cells-v1", "model.zip")
zipfile.ZipFile(zip_path).extractall("model")          # -> model/<trainer folder>/
model_folder = "model/model2"                          # folder with plans.json + dataset.json + fold_0

pred = nnUNetPredictor(device=torch.device("cpu"), allow_tqdm=False)
pred.initialize_from_trained_model_folder(model_folder, use_folds=(0,), checkpoint_name="checkpoint_best.pth")

img = np.asarray(Image.open("image.png").convert("L"), dtype=np.float32)[None, None]  # (c,z,y,x)
seg = pred.predict_single_npy_array(img, {"spacing": (999.0, 1.0, 1.0)}, None, None, False).squeeze()

License

CC-BY-4.0. Please cite fibsemOS if you use this model.