(filelist: List[str], new_width: int, device: str, verbose: bool)
| 77 | |
| 78 | |
| 79 | def load_and_resize14(filelist: List[str], new_width: int, device: str, verbose: bool): |
| 80 | imgs = load_images(filelist, new_width=new_width, verbose=verbose).to(device) |
| 81 | |
| 82 | ori_h, ori_w = imgs.shape[-2:] |
| 83 | patch_h, patch_w = ori_h // 14, ori_w // 14 |
| 84 | # (N, 3, h, w) -> (1, N, 3, h_14, w_14) |
| 85 | imgs = F.interpolate(imgs, (patch_h * 14, patch_w * 14), mode="bilinear", align_corners=False, antialias=True).unsqueeze(0) |
| 86 | return imgs |
| 87 | |
| 88 | def infer_monodepth(file: str, model: Pi3, hydra_cfg: DictConfig): |
| 89 |
no test coverage detected