Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
Returns
-------
List[List[AnyStr]]
List of list of models and tags for each model if they existed
Example
-------
>>> con.modelscan()
[['pt_model', ''], ['m', 'v1.2']]
"""
warnings.warn("Experimental: Model List API is experimental and might change "
"in the future without any notice", UserWarning)
args = builder.modelscan()
result = self.execute_command(*args)
return utils.recursive_bytetransform(result, lambda x: x.decode())
def tensorget(res, as_numpy, meta_only):
"""Process the tensorget output.
If ``as_numpy`` is True, it'll be converted to a numpy array. The required
information such as datatype and shape must be in ``rai_result`` itself.
"""
rai_result = utils.list2dict(res)
if meta_only:
return rai_result
elif as_numpy is True:
return utils.blob2numpy(rai_result['blob'], rai_result['shape'], rai_result['dtype'])
else:
target = float if rai_result['dtype'] in ('FLOAT', 'DOUBLE') else int
utils.recursive_bytetransform(rai_result['values'], target)
return rai_result
def modelget(res):
resdict = utils.list2dict(res)
utils.recursive_bytetransform(resdict['inputs'], lambda x: x.decode())
utils.recursive_bytetransform(resdict['outputs'], lambda x: x.decode())
return resdict
def scriptscan(res):
return utils.recursive_bytetransform(res, lambda x: x.decode())