MCPcopy Index your code
hub / github.com/tensorpack/tensorpack / do_predict

Function do_predict

examples/FasterRCNN/predict.py:96–106  ·  view source on GitHub ↗
(pred_func, input_file)

Source from the content-addressed store, hash-verified

94
95
96def do_predict(pred_func, input_file):
97 img = cv2.imread(input_file, cv2.IMREAD_COLOR)
98 results = predict_image(img, pred_func)
99 if cfg.MODE_MASK:
100 final = draw_final_outputs_blackwhite(img, results)
101 else:
102 final = draw_final_outputs(img, results)
103 viz = np.concatenate((img, final), axis=1)
104 cv2.imwrite("output.png", viz)
105 logger.info("Inference output for {} written to output.png".format(input_file))
106 tpviz.interactive_imshow(viz)
107
108
109if __name__ == '__main__':

Callers 1

predict.pyFile · 0.85

Calls 4

predict_imageFunction · 0.90
draw_final_outputsFunction · 0.90
formatMethod · 0.80

Tested by

no test coverage detected