Depth Anything V2
A tool that runs depth_anythingv2 model to generate a depth image from a given RGB image. The returned depth image is monochrome and represents depth values as pixel intesities with pixel values ranging from 0 to 255
Output
python
import requests
import base64
url = "https://api.landing.ai/v1/tools/depth-anything-v2"
with open("{{path_to_image}}", "rb") as image_file:
base64_string = base64.b64encode(image_file.read()).decode('utf-8')
payload = {
"image": base64_string,
"function_name": "depth_anything_v2"
}
headers = {
"Content-Type": "application/json",
"Accept": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())