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

您好,我想问下这个网络的输出是affine-variant depth么,还是disparity #213

Open
booker-max opened this issue Nov 25, 2024 · 1 comment

Comments

@booker-max
Copy link

您好,这是一份很好的工作,我想问下,在这里面的输出是depth还是disparity
raw_img = cv2.imread('your/image/path')
depth = model.infer_image(raw_img) # HxW raw depth map in numpy,
如果是深度,我直接通过这种方式对齐真实尺度和shift可以么
def align_scale_shift_numpy(pred: np.array, target: np.array):
mask = target > 0
target_mask = target[mask]
pred_mask = pred[mask]
if np.sum(mask) > 10:
scale, shift = np.polyfit(pred_mask, target_mask, deg=1)
if scale < 0:
scale = np.median(target[mask]) / (np.median(pred[mask]) + 1e-8)
shift = 0
else:
scale = 1
shift = 0
pred = pred * scale + shift

return pred, scale
@LiheYoung
Copy link
Contributor

你好,这里输出的是disparity

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