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 time | |
import logging | |
from contextlib import ContextDecorator | |
from functools import wraps | |
logger = logging.getLogger(__name__) | |
class profiler(ContextDecorator): | |
def __init__(self, name=None, profiler_logger=None): | |
self.name = name |
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
# https://github.com/nerfstudio-project/nerfstudio/issues/2438 | |
conda create --name nerfstudio -y python=3.8 | |
conda activate nerfstudio | |
python -m pip install --upgrade pip | |
pip uninstall torch torchvision functorch tinycudann | |
pip install torch==2.0.1 torchvision==0.15.2 | |
git clone https://github.com/nerfstudio-project/nerfstudio.git | |
cd nerfstudio |
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
from typing import Union | |
import matplotlib.pyplot as plt | |
import numpy as np | |
import torch | |
from PIL import Image | |
from torchvision.transforms import ToPILImage | |
def show_image(img: Union[torch.Tensor, np.ndarray, Image.Image]): |
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 torch | |
import torchvision.transforms as T | |
from PIL import Image | |
from einops import rearrange | |
# input path here | |
img = Image.open("input/view0.png") | |
class GridDecompose: |
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 inspect | |
from functools import wraps | |
from typing import Any, Callable, Tuple | |
def mutually_exclusive_arg_groups(*arg_groups: Tuple[str, ...], must_match_one_group=False) -> Callable: | |
""" | |
Validate specified keyword arg group are mutually exclusive. | |
Args: | |
*arg_groups: Tuple[str, ...] |
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
/* | |
* @Date: 2022-03-21 13:47:22 | |
* @LastEditors: Lcf | |
* @LastEditTime: 2022-03-24 04:14:16 | |
* @FilePath: /socket_programming/include/debug.h | |
*/ | |
#ifndef __DEBUG_H__ | |
#define __DEBUG_H__ |