Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def init(config):
host = config['server'].split(':')[0]
port = config['server'].split(':')[1]
init.con = rai.Client(host=host, port=port)
graph = raimodel.Model.load(config['modelpath'])
inputs = ['images']
outputs = ['output']
init.con.modelset(
'graph', rai.Backend.tf, rai.Device.cpu, graph,
input=inputs, output=outputs)
image, init.img_class = get_one_image()
init.image = rai.BlobTensor.from_numpy(image)
def init(config):
model = raimodel.Model.load(config['modelpath'])
host = config['server'].split(':')[0]
port = config['server'].split(':')[1]
init.con = rai.Client(host=host, port=port)
init.con.modelset('model', rai.Backend.torch, rai.Device.cpu, model)
image, init.img_class = get_one_image(transpose=(2, 0, 1))
init.image = rai.BlobTensor.from_numpy(image)