This project provides an experimental TensorRT implementation of ml-depth-pro by Apple, enabling faster inference speeds, at the cost of quality. Feel free to contribute to improve the quality of the result.
If you like the project, please give me a star! ⭐
Note: Inference was done in FP16, with a warm-up period of 5 frames. The reported time corresponds to the last inference.
Device | Model Resolution | Inference Time (ms) |
---|---|---|
H100 | 1536 x 1536 | 63 |
git clone https://github.com/apple/ml-depth-pro
cd ./ml-depth-pro
pip install -e .
bash get_pretrained_models.sh
git clone https://github.com/yuvraj108c/ml-depth-pro-tensorrt
mv ./ml-depth-pro-tensorrt/* . && rm -r ./ml-depth-pro-tensorrt
pip install -r requirements.txt
git clone https://github.com/yuvraj108c/ml-depth-pro-tensorrt
pip install -r requirements.txt
You can download the prebuilt onnx model from here or build it yourself by running:
python export_onnx.py
python export_trt.py
python infer_trt.py
- The model currently supports images with a fixed resolution of 1536 x 1536
- There is a noticeable loss of quality, even at FP32, compared to the native pytorch implementation
Ubuntu 22.04 LTS, Cuda 12.4, Tensorrt 10.5.0, Python 3.10, H100 GPU