Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def bind_model(model, image_frame):
device = winml.LearningModelDevice(winml.LearningModelDeviceKind.DEFAULT)
session = winml.LearningModelSession(model, device)
binding = winml.LearningModelBinding(session)
image_feature_value = winml.ImageFeatureValue.create_from_video_frame(image_frame)
binding.bind("data_0", image_feature_value)
shape = winml.TensorFloat.create([1, 1000, 1, 1])
binding.bind("softmaxout_1", shape)
return (session, binding)