Skip to content

Commit

Permalink
Package core utils
Browse files Browse the repository at this point in the history
Signed-off-by: Krishna Murthy <[email protected]>
  • Loading branch information
Krishna Murthy committed Apr 15, 2020
1 parent a1406c9 commit deae4a8
Show file tree
Hide file tree
Showing 13 changed files with 28 additions and 20 deletions.
6 changes: 3 additions & 3 deletions cache_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
import torch
from tqdm import tqdm

from load_blender import load_blender_data
from load_llff import load_llff_data
from nerf_helpers import get_ray_bundle, meshgrid_xy
from nerf import load_blender_data
from nerf import load_llff_data
from nerf import get_ray_bundle, meshgrid_xy


def cache_nerf_dataset(args):
Expand Down
12 changes: 6 additions & 6 deletions eval_nerf.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
import yaml
from tqdm import tqdm

import models
from cfgnode import CfgNode
from load_blender import load_blender_data
from load_llff import load_llff_data
from nerf_helpers import get_ray_bundle, positional_encoding
from train_utils import run_one_iter_of_nerf
from nerf import models
from nerf import CfgNode
from nerf import load_blender_data
from nerf import load_llff_data
from nerf import get_ray_bundle, positional_encoding
from nerf import run_one_iter_of_nerf


def cast_to_image(tensor):
Expand Down
8 changes: 8 additions & 0 deletions nerf/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from .cfgnode import CfgNode
from .load_blender import load_blender_data
from .load_llff import load_llff_data
from .models import *
from .nerf_helpers import *
from .train_utils import *
from .volume_rendering_utils import *

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions train_utils.py → nerf/train_utils.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import torch

from nerf_helpers import get_minibatches, ndc_rays
from nerf_helpers import sample_pdf_2 as sample_pdf
from volume_rendering_utils import volume_render_radiance_field
from .nerf_helpers import get_minibatches, ndc_rays
from .nerf_helpers import sample_pdf_2 as sample_pdf
from .volume_rendering_utils import volume_render_radiance_field


def run_network(network_fn, pts, ray_batch, chunksize, embed_fn, embeddirs_fn):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import torch

from nerf_helpers import cumprod_exclusive
from .nerf_helpers import cumprod_exclusive


def volume_render_radiance_field(
Expand Down
2 changes: 1 addition & 1 deletion tiny_nerf.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import torch
from tqdm import tqdm, trange

from nerf_helpers import (
from nerf import (
cumprod_exclusive,
get_minibatches,
get_ray_bundle,
Expand Down
12 changes: 6 additions & 6 deletions train_nerf.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@
from torch.utils.tensorboard import SummaryWriter
from tqdm import tqdm, trange

import models
from cfgnode import CfgNode
from load_blender import load_blender_data
from load_llff import load_llff_data
from nerf_helpers import (
from nerf import models
from nerf import CfgNode
from nerf import load_blender_data
from nerf import load_llff_data
from nerf import (
get_ray_bundle,
img2mse,
meshgrid_xy,
mse2psnr,
positional_encoding,
)
from train_utils import run_one_iter_of_nerf
from nerf import run_one_iter_of_nerf


def main():
Expand Down

0 comments on commit deae4a8

Please sign in to comment.