The repo for "Metric3D: Towards Zero-shot Metric 3D Prediction from A Single Image" and "Metric3Dv2: A Versatile Monocular Geometric Foundation Model..."
When trying test_onnx.py with the model from https://huggingface.co/onnx-community/metric3d-vit-large I got the following error: ValueError: Required inputs (['pixel_values']) are missing from input feed (['image'])
due to mismatch between the onnx_input dictionary used in the script and the input dictionary expected by the model.
Changing the key name from "image" to "pixel_values" in the code below will solve the issue.
onnx_input = {
"image": np.ascontiguousarray(
np.transpose(rgb, (2, 0, 1))[None], dtype=np.float32
), # 1, 3, H, W
}
to
onnx_input = {
"pixel_values": np.ascontiguousarray(
np.transpose(rgb, (2, 0, 1))[None], dtype=np.float32
), # 1, 3, H, W
}
When trying test_onnx.py with the model from https://huggingface.co/onnx-community/metric3d-vit-large I got the following error: ValueError: Required inputs (['pixel_values']) are missing from input feed (['image']) due to mismatch between the onnx_input dictionary used in the script and the input dictionary expected by the model. Changing the key name from "image" to "pixel_values" in the code below will solve the issue. onnx_input = { "image": np.ascontiguousarray( np.transpose(rgb, (2, 0, 1))[None], dtype=np.float32 ), # 1, 3, H, W } to onnx_input = { "pixel_values": np.ascontiguousarray( np.transpose(rgb, (2, 0, 1))[None], dtype=np.float32 ), # 1, 3, H, W }