in src/inference_mxnet.py [0:0]
def output_fn(prediction, content_type):
'''
Serializes predictions from predict_fn() to JSON format.
'''
shape, cid, score, bbox = prediction
if content_type == 'application/json':
return json.dumps({
'shape': shape,
'cid': cid.asnumpy().tolist(),
'score': score.asnumpy().tolist(),
'bbox': bbox.asnumpy().tolist()
})