Monai, Medical Imaging, Pytorch, Triton Inference Server, Torchserve.
post_transform(inference_output, out_dir='./', ref_image=None): post_trans = Compose([Activations(sigmoid=True), AsDiscrete(threshold=0.5), ]) image_itk = sitk.GetImageFromArray(np.transpose(postprocess_output, [2, 1, 0])) image_itk.SetSpacing(ref_image.GetSpacing())