(pred_func, input_file)
| 94 | |
| 95 | |
| 96 | def 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 | |
| 109 | if __name__ == '__main__': |
no test coverage detected