Depth Anything V2
Dedicated Deployment या self-hosted Inference पर monocular depth estimation के लिए Depth Anything V2 का उपयोग करें
कोड नमूना
3
मॉडल चलाएँ
import os
import cv2
import numpy as np
import requests
from inference_sdk import InferenceHTTPClient
content = requests.get("https://media.roboflow.com/notebooks/examples/bicycle.png").content
image = cv2.imdecode(np.frombuffer(content, np.uint8), cv2.IMREAD_COLOR)
client = InferenceHTTPClient(
api_url="https://your-deployment.roboflow.cloud",
api_key=os.environ["ROBOFLOW_API_KEY"],
)
result = client.depth_estimation(image)
depth = np.array(result["normalized_depth"], dtype=np.float32)
depth = cv2.resize(depth, (image.shape[1], image.shape[0]))
depth_vis = (depth * 255).astype(np.uint8)
depth_color = cv2.applyColorMap(depth_vis, cv2.COLORMAP_INFERNO)
cv2.imwrite("depth_annotated.png", np.hstack([image, depth_color]))
Inference speed
मॉडल
विलंबता (ms)
अंतिम अपडेट
क्या यह उपयोगी था?