How to - ONNX Inference on volumes ?

   314   1   1
User Avatar
Member
861 posts
Joined: Oct. 2008
Offline
Does anybody know of an example of the onnx inference SOP on volumes?

I can get it to work on points but if I try volumes on the same model it always errors with

Error No volumes match.

Error occurred extracting input 1.


The data is structured the same way and volumes are the same size and resolution, and position (if that matters). I tried vdb vs volumes. They are named correctly and have sensible values as far as I can tell. Tensors are the right shape.

I have attached a test file.
Edited by Soothsayer - April 29, 2024 02:57:21

Attachments:
test.hiplc (139.7 KB)
best_model_avgx_avgy_avgz.onnx (81.5 KB)

--
Jobless
User Avatar
Member
101 posts
Joined: Dec. 2019
Offline
You can find an example with Heightfields (which are 2D volumes) in the Content Library https://www.sidefx.com/contentlibrary/ml-terrain/ [www.sidefx.com]

This node expects Houdini's native volumes, not VDBs, so in your scene you can use a VDB Convert node to convert VDB to Volume and be able to use ONNX Inference node.

However, the onnx model you are using seems to output 1D volumes, so you need to copy data to 3D volume using 3D to 1D index conversion, I used formula from this site to do the conversion and copy results from ONNX node to expected output volumes https://ennogames.com/blog/3d-and-2d-coordinates-to-1d-indexes [ennogames.com]

Also added an example without VDBs, by creating either a 2D (image) or 3D (smoke) volume.

Attachments:
onnx_volumes.hiplc (658.9 KB)

Houdini Pipeline Supervisor @ TAT Studio
  • Quick Links