Spaces:
Runtime error
Runtime error
from gradio_client import Client, handle_file | |
def generate_depth_map(image_path): | |
client = Client("depth-anything/Depth-Anything-V2") | |
result = client.predict( | |
image=handle_file(image_path), | |
api_name="/on_submit" | |
) | |
# Extract the grayscale depth map (second item in the result tuple) | |
depth_map_path = result[1] | |
return depth_map_path | |