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.39k stars 617 forks source link

3.0 models in ROS/LibTorch #122

Open jpapon opened 3 years ago

jpapon commented 3 years ago

Hello! I recently converted your ROS1 node to ROS2, and have found the model works very well, so thanks for sharing it!

One small question... would it be possible to get traced versions of the 3.0 models? Would love to try them out and see the performance differences.

Thanks!

ranftlr commented 3 years ago

Thanks for the feedback. The current implementation is unfortunately not directly traceable and requires are rewrite+model conversion. As this seems to be popular request, we will prioritize this.

jpapon commented 3 years ago

Thanks for working on it, much appreciated!

ranftlr commented 3 years ago

I just pushed a preview of a scriptable and traceable model to branch "dpt_scriptable" in the DPT repo: https://github.com/isl-org/DPT/tree/dpt_scriptable. Note that you have to download updated weight files for this to work. You can find updated links in the README of the branch.

Please let us know if this solves your problem or if you experience any issues with this. We'd also be happy to hear what you find out about performance differences.

3togo commented 3 years ago

@ranftlr , I try to trace your "dpt_hybrid-midas-d889a10e.pt" using torch.jit.trace but failed

Below is the error message: File "/usr/local/lib/python3.9/dist-packages/torch/_tensor.py", line 867, in unflatten return super(Tensor, self).unflatten(dim, sizes, names) RuntimeError: NYI: Named tensors are not supported with the tracer

jpapon commented 3 years ago

Excellent @ranftlr thank you! I will test this on Friday.

naitiknakrani commented 2 years ago

@jpapon Hi, Is your ROS2 ported code available anywhere?