File size: 372 Bytes
a921818 |
1 2 3 4 5 6 7 8 9 10 11 12 |
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
|