最新的深度估计方法,源码是python和桌面级GPU运行,如果实现在嵌入式设备jetson Orin上用C++实时运行一定很有意思。
1、需要什么准备工作?
先下depth anything的代码:
https://github.com/LiheYoung/Depth-Anything.git
再下一个实现C++ tensorRT部署的范例代码–参考用,主要还是自己写一个:
https://github.com/spacewalk01/depth-anything-tensorrt.git。
2、获得onnx模型
要实现在C++上做深度模型推理,目前推荐的方法是先为onnx模型,再用C++调用:
2.1 先下载depth anything 的预训练模型:https://huggingface.co/spaces/LiheYoung/Depth-Anything/tree/main/checkpoints
2.2 配置depth anything 的环境,针对jetson orin平台 应该有所不同
看看都需要安装啥
gradio_imageslider #这个不用变
gradio==4.14.0 #这个不用变 Requires: Python >=3.8 注意,安装的时候会出现torchvision 0.15.1需要 torch但其未安装的错误,但是不打紧马上就安装了,应该是自动安装了torchvision 0.15.1。
torch #这个安装jetson对应的版本