Created
April 19, 2020 19:58
-
-
Save wkentaro/fb0371701fc5217a4cf43ae84a0b8471 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| import numpy as np | |
| import torch | |
| import corvus_segmentation_models | |
| from train import TransformDataset | |
| def transform(i, images): | |
| K = np.array(dataset.meta_root["intrinsic_matrix"]) | |
| images["hha"] = corvus_segmentation_models.geometry.depth2hha(images["depth_filled"], K) | |
| out_file = f"out/{i:08d}/images.npz" | |
| np.savez_compressed(out_file, **images) | |
| return images | |
| dataset = corvus_segmentation_models.datasets.NyuDepthV2Dataset("all") | |
| dataset = TransformDataset(dataset, transform) | |
| loader = torch.utils.data.DataLoader(dataset, batch_size=1, shuffle=False, num_workers=12) | |
| import tqdm | |
| for _ in tqdm.tqdm(loader): | |
| pass |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment