How to use C++ API deploy models more complicated than fadd, etc

https://docs.tvm.ai/deploy/cpp_deploy.html

The example this uses is a really simple example that just takes a vector as input/output. What if I wanted to import resnet (after having previously deployed it from prepare_test_libs.py), are there any examples on how to import that and get it into the correct format?

Since that one (even in the python example required some preprocessing, I’m not sure how the interface lines up with the C++ version.

https://docs.tvm.ai/api/python/graph_runtime.html might be relevant

Hmm, I think this is the Python API but it looks like it’s a wrapper for the C++ class.

I can import the graph (as far as I can tell, it imports the same way), but everything else is a mystery to me. Like importing the image, looking up sysnet, etc. Since most of that was done via numpy, I’m not sure how to deal with it in C++.

Is using OpenCV for all that possible or am I going down a rabbit hole?

You can use OpenCV for image import as you can always just manually copy the data into a canonical format (e.g., NCHW float32). We do something similar in Android. As far as synset goes you may have to write some boilerplate (read class names from a file) but that should be quick.