import gradio as gr from inference import make_inference def monai_inference(input): data_dict = [{"t2": input.name}] return make_inference(data_dict) demo = gr.Interface( fn=monai_inference, inputs=gr.File(file_count="single", file_types=[".nii.gz", ".zip"], label=".nii.gz file or .zip file"), outputs="file", title="Inference on monai model", description="You can upload either zip of dicom folder or .nii.gz file. In turn, you can download the mask as .nii.gz file.", ) demo.queue() demo.launch()