You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
Do you have any idea where is the problem? Thank you so much.
The text was updated successfully, but these errors were encountered:
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.
Here's the result:
Do you have any idea where is the problem? Thank you so much.
The text was updated successfully, but these errors were encountered: