import gradio as gr import os.path import torch import cv2 import numpy as np from PIL import Image def output(image_path): pil_image = Image.open(image_path).convert("RGB") image = np.array(pil_image)[:, :, [2, 1, 0]] output_path = 'output' caption = 'person . mask' flag = False save_image_path = os.path.join(output_path,os.path.split(image_path)[-1]) return save_image_path with gr.Blocks() as demo: gr.Markdown("