Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

visualize the depth_pred #58

Open
Tartisan opened this issue Feb 2, 2024 · 1 comment
Open

visualize the depth_pred #58

Tartisan opened this issue Feb 2, 2024 · 1 comment

Comments

@Tartisan
Copy link

Tartisan commented Feb 2, 2024

Sorry I'm new in this area, how to visualize the depth_pred from ZeroDepth or PackNet ?

@ximader
Copy link

ximader commented Jul 23, 2024

cap = cv2.VideoCapture('video.mp4')

ret, frame = cap.read()

frame = cv2.resize(frame, (640, 384))

rgb = torch.tensor(frame).permute(2,0,1).unsqueeze(0)/255.

with torch.no_grad():
    depth_pred = zerodepth_model(rgb, intrinsics)

depthmap = depth_pred.permute(0,2,3,1).squeeze().detach().cpu().numpy()
depthmap = np.uint8(depthmap/np.max(depthmap) * 255)
depthmap = cv2.applyColorMap(depthmap, cv2.COLORMAP_JET)

out = np.hstack([frame, depthmap])

cv2.imshow("depthmap", out)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants