nuc_resunet_setup_56

Nuclei (nuc) from FIB-SEM at 128 nm, 3D residual U-Net (InstanceNorm, valid convs), exp_mito setup_56 at 350000 iterations. Valid convolutions (88 voxels of context per axis); outputs raw logits. ONNX web version: cellmap/onnx-web-models/setup_56.

Model Details

Architecture ResUNet3DValid
Framework torch
Spatial Dims 3
Input Channels 1
Output Channels 1
Channel Names nuc
Iteration 350000
Input Voxel Size 128, 128, 128 nm
Output Voxel Size 128, 128, 128 nm
Inference Input Shape 300, 300, 300
Inference Output Shape 212, 212, 212
Input Normalization {"max": 1.0, "method": "min_max", "min": -1.0}
Inference Output Activation {"apply_after_model": true, "name": "sigmoid"}

Available Formats

File Format Usage
model.pt PyTorch pickle torch.load("model.pt")
model.ts TorchScript torch.jit.load("model.ts")
model.onnx ONNX onnxruntime.InferenceSession("model.onnx")
metadata.json JSON Model metadata

Usage

pip install cellmap-models
from cellmap_models.model_export.cellmap_model import CellmapModel

model = CellmapModel("path/to/model/folder")

# Inference
output = model.ts_model(input_tensor)

# Finetuning
trainable_model = model.train()

Or download from this repo and load directly:

from huggingface_hub import snapshot_download
from cellmap_models.model_export.cellmap_model import CellmapModel

path = snapshot_download(repo_id="nuc_resunet_setup_56")
model = CellmapModel(path)

Author

Marwan Zouinkhi

Links

PyTorch original (for finetuning / re-export)

model_state_dict.pt (plain tensors, weights_only=True) + the module code (model_def.py); torch_source.json names the class and constructor arguments.

import json, importlib.util, torch
src = json.load(open("torch_source.json"))
spec = importlib.util.spec_from_file_location("model_def", src["module"]); mod = importlib.util.module_from_spec(spec)
spec.loader.exec_module(mod)
model = getattr(mod, src["class"])(**src["kwargs"])
model.load_state_dict(torch.load("model_state_dict.pt", weights_only=True))
model.eval()
Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support