Depth-Map-Generation-and-Segmentation / depth_map_generator.py
Abu1998's picture
Create depth_map_generator.py
a921818 verified
raw
history blame
No virus
372 Bytes
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