How to use the redisai.model.Model.load function in redisai

To help you get started, we’ve selected a few redisai examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github RedisAI / benchmarks / experiments / _tensorflow / _redisai / client.py View on Github external
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)
github RedisAI / benchmarks / experiments / _pytorch / _redisai / client.py View on Github external
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)