JuliaWolleb / Diffusion-based-Segmentation

This is the official Pytorch implementation of the paper "Diffusion Models for Implicit Image Segmentation Ensembles".
MIT License
271 stars 35 forks source link

How to submit validation set results to the website for validation #25

Closed MuqinZ closed 1 year ago

MuqinZ commented 1 year ago

The output results are respectively output0-output4 and Their format are not nil.gz .So I can not submit validation set results to the website for validation. So how to submit validation set results to the website for validation is my queastion.

guanzhenghua commented 1 year ago

hi,Have you solved the problem. I converted the output to nii format,

import nibabel as nib import numpy as np import torch as torch

gen = torch.load(r"C:\Users\John\Desktop\aaa\guanzhenghua_output4",map_location=torch.device('cpu')) gen = gen[0] gen = gen.numpy() print(gen.shape) gen = nib.Nifti1Image(gen, np.eye(4)) nib.save(gen, r'C:\Users\John\Desktop\aaa\show4.nii')

If you only want to load the output, you can just use the first line of code. gen = torch.load(r"C:\Users\John\Desktop\aaa\guanzhenghua_output4",map_location=torch.device('cpu')) I hope it can help you