(model_path)
| 113 | |
| 114 | |
| 115 | def sample(model_path): |
| 116 | pred = PredictConfig( |
| 117 | session_init=SmartInit(model_path), |
| 118 | model=Model(), |
| 119 | input_names=['label', 'z'], |
| 120 | output_names=['gen/gen']) |
| 121 | |
| 122 | ds = MapData(RandomZData((100, 100)), |
| 123 | lambda dp: [np.arange(100) % 10, dp[0]]) |
| 124 | pred = SimpleDatasetPredictor(pred, ds) |
| 125 | for o in pred.get_result(): |
| 126 | o = o[0] * 255.0 |
| 127 | viz = stack_patches(o, nr_row=10, nr_col=10) |
| 128 | viz = cv2.resize(viz, (800, 800)) |
| 129 | interactive_imshow(viz) |
| 130 | |
| 131 | |
| 132 | if __name__ == '__main__': |
no test coverage detected
searching dependent graphs…