(root_dir, viz_root_dir, model, img_pairs, keep_size)
| 152 | return model |
| 153 | |
| 154 | def visualize_flow(root_dir, viz_root_dir, model, img_pairs, keep_size): |
| 155 | weights = None |
| 156 | for img_pair in img_pairs: |
| 157 | fn1, fn2 = img_pair |
| 158 | print(f"processing {fn1}, {fn2}...") |
| 159 | |
| 160 | image1, image2, viz_fn = prepare_image(root_dir, viz_root_dir, fn1, fn2, keep_size) |
| 161 | flow = compute_flow(model, image1, image2, weights) |
| 162 | flow_img = flow_viz.flow_to_image(flow) |
| 163 | cv2.imwrite(viz_fn, flow_img[:, :, [2,1,0]]) |
| 164 | |
| 165 | def process_sintel(sintel_dir): |
| 166 | img_pairs = [] |
no test coverage detected