import gradio as gr from transformers import pipeline import torch import numpy as np from PIL import Image import gradio as gr from gradio_client import Client import os import spaces import json dpt_beit = pipeline(task = "depth-estimation", model="Intel/dpt-beit-base-384") depth_anything = pipeline(task = "depth-estimation", model="nielsr/depth-anything-small") dpt_large = pipeline(task = "depth-estimation", model="intel/dpt-large") @spaces.GPU def depth_anything_inference(img): return depth_anything(img)["depth"] @spaces.GPU def dpt_beit_inference(img): return dpt_beit(img)["depth"] @spaces.GPU def dpt_large_inference(img): return dpt_large(img)["depth"] def infer(img): return dpt_large_inference(img), dpt_beit_inference(img), depth_anything_inference(img) css = """ #mkd { height: 500px; overflow: auto; border: 1px solid #ccc; } """ with gr.Blocks(css=css) as demo: gr.HTML("