KidneyCell2Tissue
Collection
Instance segmentation models for tissue annotations of kidney xenium data • 3 items • Updated
Access is granted only to users whose Hugging Face primary email matches their institutional/academic email. Requests from personal domains (e.g., @gmail, @hotmail) will be declined.
These models are intended for research purposes, for automated segmentation of tissue compartments in kidney transplant from Xenium datasets.
Load model
from huggingface_hub import login
from huggingface_hub import hf_hub_download
from ultralytics import YOLO
login() # login with your User Access Token, found at https://huggingface.co/settings/tokens
#load model (example for glomeruli)
REPO_ID = "bertrandchauveau/KidneyCell2Tissue_combined"
FILENAME = "yolo26_1024_glomerulus_xenium_multi_thr0480.pt"
# Download the .pt file from the Hub (cached locally for future use)
model_path = hf_hub_download(repo_id=REPO_ID, filename=FILENAME)
# Load the weights into Ultralytics YOLO
model = YOLO(model_path)
Inference
import cv2
import numpy as np
img_size = (1024, 1024)
threshold = float(FILENAME.split('thr')[1].split('.')[0]) / 10000 #recommended threshold
#get an example image
!wget https://raw.githubusercontent.com/bertrandchauveau/KidneyCell2Tissue/main/example_image/example_combined.tiff
#load image
success, frames_list = cv2.imreadmulti("example_combined.tiff")
img_array = np.stack(frames_list, axis=2)
#prediction
res = model.predict(img_array, imgsz=(1024, 1024), conf=threshold, iou=0.7, max_det=300, retina_masks=True)
Python Packages
For any additional questions or comments, contact Bertrand Chauveau (bertrand.chauveau@chu-bordeaux.fr)