I am trying to write the inference code in python for the model given in the link below:
I have managed to write the following code but cannot understand how to use the output from TVM to generate coordinates in the same way they have done in C++. A little help with go a long way.
import numpy as np
import nnvm.compiler
import nnvm.testing
import tvm
from tvm.contrib import graph_runtime
import mxnet as mx
import cv2
from mxnet import ndarray as nd
ctx = tvm.cpu()
data_shape = (640, 480, 3)
loaded_json = open("./models/480P/mnet.25.x86.cpu.json").read()
loaded_lib = tvm.module.load("./models/480P/mnet.25.x86.cpu.so")
loaded_params = bytearray(open("./models/480P/mnet.25.x86.cpu.params", "rb").read())
module = graph_runtime.create(loaded_json, loaded_lib, ctx)
module.load_params(loaded_params)
img = cv2.imread('/home/xyz/desktop/7.jpg')
resized = cv2.resize(img, (480, 640))
input_data = tvm.nd.array(resized.astype("float32"))
module.run(data=input_data)
ret = module.get_output(0).asnumpy()