shubham-goel / ds

Code for Differentiable Stereopsis. Goel, Gkioxari, Malik 2021
69 stars 7 forks source link

Something went wrong with d.update #4

Closed pfeducode closed 1 year ago

pfeducode commented 1 year ago

2022-10-15_11-57

The last update dimension of t is [12,2]

2022-10-15_11-56 Could you give me some suggestions

FavorMylikes commented 1 year ago

Same issue here.

FavorMylikes commented 1 year ago

Maybe we should use

cam_metrics.update(loss_tensor_to_dict(fov_l1.mean(axis=1), prefix='fov/'))

to instead? https://github.com/shubham-goel/ds/blob/2ef898894abb33c82e73790eedf30995ddc9d1c1/src/utils/metrics.py#L70-L71

shubham-goel commented 1 year ago

Hi, thanks for the issue!

This error arises because your camera objects are storing focal_length as a tuple (f_x, f_y) instead of just f. This could be because of a Pytorch3D version update, but it's an easy fix. Following @FavorMylikes's suggestion above, please add the following before line 71:

if fov_l1.dim() == 2: 
    fov_l1= fov_l1.mean(axis=1)

I've also committed this change to the code. Thank you!

pfeducode commented 1 year ago

thank you, it works well