quality_comparison/extract_gibson_real.py [23:48]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
def extract_rgb_images(pano_path: str, save_prefix: str) -> None:
    pano = imageio.imread(pano_path)
    # Convert pano to images
    list_of_images = []
    locs = np.linspace(0, 1.0, num=10)[:-1]
    np.random.shuffle(locs)
    for loc in locs[:NUM_IMAGES_PER_PANO]:
        pimg = e2p(pano, (FOV, FOV), (loc - 0.5) * 360.0, 0.0, (HEIGHT, WIDTH))
        list_of_images.append(pimg)
    # Save images
    for idx, image in enumerate(list_of_images):
        path = save_prefix + f"_img_{idx:03d}.jpg"
        imageio.imwrite(path, image)


def _aux_fn(args):
    extract_rgb_images(*args)


if __name__ == "__main__":
    parser = argparse.ArgumentParser()
    parser.add_argument("--dataset-dir", type=str, required=True)
    parser.add_argument("--save-dir", type=str, required=True)
    parser.add_argument("--num-workers", type=int, default=8)

    args = parser.parse_args()
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



quality_comparison/extract_mp3d_real.py [23:48]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
def extract_rgb_images(pano_path: str, save_prefix: str) -> None:
    pano = imageio.imread(pano_path)
    # Convert pano to images
    list_of_images = []
    locs = np.linspace(0, 1.0, num=10)[:-1]
    np.random.shuffle(locs)
    for loc in locs[:NUM_IMAGES_PER_PANO]:
        pimg = e2p(pano, (FOV, FOV), (loc - 0.5) * 360.0, 0.0, (HEIGHT, WIDTH))
        list_of_images.append(pimg)
    # Save images
    for idx, image in enumerate(list_of_images):
        path = save_prefix + f"_img_{idx:03d}.jpg"
        imageio.imwrite(path, image)


def _aux_fn(args):
    extract_rgb_images(*args)


if __name__ == "__main__":
    parser = argparse.ArgumentParser()
    parser.add_argument("--dataset-dir", type=str, required=True)
    parser.add_argument("--save-dir", type=str, required=True)
    parser.add_argument("--num-workers", type=int, default=8)

    args = parser.parse_args()
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



