Skip to content

Commit

Permalink
Merge pull request #5 from orperel/operel/imports_docs_cleanups
Browse files Browse the repository at this point in the history
import cleanups, some missing core docs
  • Loading branch information
orperel authored Aug 3, 2022
2 parents 10ed35e + 1c6353b commit 812713d
Show file tree
Hide file tree
Showing 108 changed files with 2,393 additions and 1,963 deletions.
2 changes: 1 addition & 1 deletion app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from wisp.trainers import *
from wisp.config_parser import parse_options, argparse_to_str, get_modules_from_config, \
get_optimizer_from_config
from wisp.framework.state import WispState
from wisp.framework import WispState

# Usual boilerplate
parser = parse_options(return_parser=True)
Expand Down
6 changes: 3 additions & 3 deletions app/main_interactive.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from wisp.trainers import *
from wisp.config_parser import parse_options, argparse_to_str, get_modules_from_config, \
get_optimizer_from_config
from wisp.framework.state import WispState
from wisp.framework import WispState

# Usual boilerplate
parser = parse_options(return_parser=True)
Expand All @@ -38,9 +38,9 @@
scene_state=scene_state)

if not os.environ.get('WISP_HEADLESS') == '1':
from wisp.renderer.app.optimizer_renderer import OptimizationRenderer
from wisp.renderer.app.optimization_app import OptimizationApp
scene_state.renderer.device = trainer.device # Use same device for trainer and renderer
renderer = OptimizationRenderer(wisp_state=scene_state,
renderer = OptimizationApp(wisp_state=scene_state,
trainer_step_func=trainer.iterate,
experiment_name="wisp trainer")
renderer.run()
Expand Down
2 changes: 1 addition & 1 deletion configs/ngp_nerf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ optimizer:

dataset:
dataset_type: 'multiview'
multiview_dataset_format: 'rtmv'
multiview_dataset_format: 'standard'
num_rays_sampled_per_img: 4096
mip: 2
bg_color: 'white'
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
from torch.utils.cpp_extension import BuildExtension, CppExtension, CUDAExtension, CUDA_HOME

PACKAGE_NAME = 'wisp'
DESCRIPTION = 'neural fields research'
URL = 'https://gitlab-master.nvidia.com/ttakikawa/solr'
DESCRIPTION = 'Kaolin-Wisp: A PyTorch library for performing research on neural fields'
URL = 'https://github.com/NVIDIAGameWorks/kaolin-wisp'
AUTHOR = 'Towaki Takikawa'
LICENSE = 'NVIDIA Source Code License'
version = '0.1.0'
Expand Down
19 changes: 7 additions & 12 deletions wisp/accelstructs/octree_as.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,16 @@
# license agreement from NVIDIA CORPORATION & AFFILIATES is strictly prohibited.

import torch
import torch.nn.functional as F
import torch.nn as nn
import numpy as np
import logging as log

import wisp.ops.mesh as mesh_ops

from wisp.ops.perf import PerfTimer
from wisp.ops.debug import PsDebugger

from wisp.utils import PsDebugger, PerfTimer
import wisp.ops.spc as wisp_spc_ops
import kaolin.ops.spc as spc_ops
import kaolin.render.spc as spc_render


class OctreeAS(object):
"""Octree accelstruct class implemented using Kaolin SPC.
"""Octree bottom-level acceleration structure class implemented using Kaolin SPC.
Can be used to to quickly query cells occupancy, and trace rays against the volume.
"""

def __init__(self):
Expand Down Expand Up @@ -126,8 +120,9 @@ def query(self, coords, level=None, with_parents=False):
return spc_ops.unbatched_query(self.octree, self.prefix, coords, level, with_parents)

def raytrace(self, rays, level=None, with_exit=False):
"""Traces rays against the SPC structure.
"""Traces rays against the SPC structure, returning all intersections along the ray with the SPC points
(SPC points are quantized, and can be interpreted as octree cell centers or corners).
Args:
rays (wisp.core.Rays): Ray origins and directions of shape [batch, 3].
level (int) : The level of the octree to raytrace. If None, traces the highest level.
Expand Down
7 changes: 3 additions & 4 deletions wisp/config_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,17 @@
import argparse
import pprint
import yaml

import torch

from wisp.datasets import *
from wisp.core import Pipeline
from wisp.models import Pipeline
from wisp.models.nefs import *
from wisp.models.grids import *
from wisp.tracers import *
from wisp.ops.ray import *
from wisp.datasets.transforms import *

str2optim = {m.lower(): getattr(torch.optim, m) for m in dir(torch.optim) if m[0].isupper()}


def parse_options(return_parser=False):
"""Function used to parse options.
Expand Down
3 changes: 1 addition & 2 deletions wisp/core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@
# license agreement from NVIDIA CORPORATION & AFFILIATES is strictly prohibited.

from .primitives import PrimitivesPack
from .render_buffer import RenderBuffer
from .rays import Rays
from .pipeline import Pipeline
from .channels import *
from .channel_fn import *
from .colors import *
from .render_buffer import RenderBuffer
Loading

0 comments on commit 812713d

Please sign in to comment.