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
# Copyright (c) Meta Platforms, Inc. and affiliates. | |
# All rights reserved. | |
# | |
# This source code is licensed under the license found in the | |
# LICENSE file in the root directory of this source tree. | |
""" | |
Contains helper functions (`fetch_plucker` and `fetch_spatial_anchor`) originally used in Pippo to create: | |
- Plucker Rays from camera KRT | |
- Spatial Anchor Image from camera KRT and headpose (provided in head-only Ava-256) or 3d keypoints (provided in full-body Goliath) |
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
[ | |
"[tdv] a white Ford F-150 King Ranch pickup truck.", | |
"[tdv] a small white robot with blue eyes and a white sphere.", | |
"[tdv] A black and gold vase with geometric patterns.", | |
"[tdv] a blue and yellow fish from Finding Dory with a mask.", | |
"[tdv] a futuristic, large concrete building with a triangular roof, featuring a circular structure with a hole in the middle and a circular ceiling light fixture.", | |
"[tdv] White hot air balloon", | |
"[tdv] a gun", | |
"[tdv] a tool with a red and blue handle.", | |
"[tdv] a knight's armored metal helmet with gold trim and holes.", |
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
{ | |
"DF400": [ | |
"a 20-sided die made out of glass", | |
"a bald eagle carved out of wood", | |
"a banana peeling itself", | |
"a beagle in a detective's outfit", | |
"a beautiful dress made out of fruit, on a mannequin. Studio lighting, high quality, high resolution", | |
"a beautiful dress made out of garbage bags, on a mannequin. Studio lighting, high quality, high resolution", | |
"a beautiful rainbow fish", | |
"a bichon frise wearing academic regalia", |
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
import numpy as np | |
import torch | |
import time | |
import imageio | |
import cv2 | |
from tqdm import tqdm | |
import torch.nn.functional as Fu | |
from pytorch3d.implicitron.tools.point_cloud_utils import get_rgbd_point_cloud | |
from pytorch3d.renderer import (AlphaCompositor, MultinomialRaysampler, | |
NDCMultinomialRaysampler, |
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
import pytorch_lightning as pl | |
class FFCVDataModule(pl.LightningDataModule): | |
def __init__(self, batch_size, train=None, reg = None, validation=None, test=None, predict=None, | |
wrap=False, num_workers=None, shuffle_test_loader=False, use_worker_init_fn=False, | |
shuffle_val_dataloader=False, beton_path=None, **kwargs): | |
super().__init__() | |
self.batch_size = batch_size | |
self.num_workers = num_workers if num_workers is not None else batch_size * 2 |
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
import numpy as np | |
import torch | |
import time | |
import imageio | |
import cv2 | |
from tqdm import tqdm | |
import torch.nn.functional as Fu | |
from pytorch3d.implicitron.tools.point_cloud_utils import get_rgbd_point_cloud | |
from pytorch3d.renderer import (AlphaCompositor, MultinomialRaysampler, | |
NDCMultinomialRaysampler, |
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
import cv2 | |
import argparse | |
import glob | |
from torchvision.io import write_video | |
import numpy as np | |
import os | |
""" | |
A quick piece of code I put together to join some video samples I had for creating visualizations. |