def predict(images, exp_config):
'''
Returns the prediction for an image given a network from the model zoo
:param images: An input image tensor
:param inference_handle: A model function from the model zoo
:return: A prediction mask, and the corresponding softmax output
'''
logits = exp_config.model_handle(images, training=tf.constant(False, dtype=tf.bool), nlabels=exp_config.nlabels)
softmax = tf.nn.softmax(logits)
mask = tf.arg_max(softmax, dimension=-1)
return mask, softmax
评论列表
文章目录