isl-org / MiDaS

Code for robust monocular depth estimation described in "Ranftl et. al., Towards Robust Monocular Depth Estimation: Mixing Datasets for Zero-shot Cross-dataset Transfer, TPAMI 2022"
MIT License
4.25k stars 597 forks source link

Fix TypeError: Tuple error #248

Open besarismaili opened 8 months ago

besarismaili commented 8 months ago

The error occurs when the F.interpolate function was called with new_height and new_width as arguments for the size parameter. These variables were of type numpy.intc, while F.interpolate expected arguments of type int or Tuple[int] or Tuple[int, int] or Tuple[int, int, #int].

The fix involves converting new_height and new_width to Python's native int type before they are passed to F.interpolate. This ensures that the function receives arguments of the correct type, preventing the TypeError. #246