Run inference from a training model checkpoint.
(model_path)
| 124 | |
| 125 | |
| 126 | def apply(model_path): |
| 127 | """Run inference from a training model checkpoint. """ |
| 128 | pred_config = PredictConfig( |
| 129 | session_init=SmartInit(model_path), |
| 130 | model=Model(), |
| 131 | input_names=['input_img'], |
| 132 | output_names=['prediction_img']) |
| 133 | |
| 134 | pred = OfflinePredictor(pred_config) |
| 135 | img = cv2.imread('lena.png') |
| 136 | prediction = pred([img])[0] |
| 137 | cv2.imwrite('applied_default.jpg', prediction[0]) |
| 138 | |
| 139 | |
| 140 | def apply_inference_graph(model_path): |
no test coverage detected