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

The Depth Prediction on Waymo Dataset seems not good #91

Open
xiao10ma opened this issue Jan 15, 2025 · 0 comments
Open

The Depth Prediction on Waymo Dataset seems not good #91

xiao10ma opened this issue Jan 15, 2025 · 0 comments

Comments

@xiao10ma
Copy link

I use the unidepth-v2-vitl14 to predict the waymo dataset depth. And it seems that it doesn't predict a good result.
I just change the image_path from "assets/demo/rgb.png" to the waymo path.
The demo you provide is correct, however, the waymo dataset is not.

Here's my code.

from unidepth.models import UniDepthV1, UniDepthV2
import torch
from unidepth.utils import colorize, image_grid
import numpy as np
from PIL import Image

model = UniDepthV2.from_pretrained("lpiccinelli/unidepth-v2-vitl14") # or "lpiccinelli/unidepth-v1-cnvnxtl" for the ConvNext backbone

# Move to CUDA, if any
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
model = model.to(device)

# Load the RGB image and the normalization will be taken care of by the model
# image_path = "assets/demo/rgb.png"
image_path = '/HDD_DISK/users/mazipei/BZG/dataset/017/images/000000_0.png'
rgb = np.array(Image.open(image_path))
rgb_torch = torch.from_numpy(rgb).permute(2, 0, 1)


predictions = model.infer(rgb_torch)
depth_pred = predictions["depth"].squeeze().cpu().numpy()

depth_pred_col = colorize(depth_pred, vmin=0.01, vmax=10.0, cmap="magma_r")
artifact = image_grid([rgb, depth_pred_col], 1, 2)
Image.fromarray(artifact).save("./res.png")

Here's the result:
output_depth
res

Do you have any idea where is the problem? Thank you so much.

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

1 participant