Setting near and far with scene bounds collider. Also LR schedules. (#74)

* some initial cuda code as I learn. using git to save progress.

* first cuda kernel for ray sampling that mostly works

* cleaning up code. working on lr. structs for scene bounds aabb

* added scene bounds collider code

* updated setup

* setup

* setup

* black

* including some files

* exporting env variable

* new file

* git workflows

* github actions

* github actions

* github actions

* removing env var
This commit is contained in:
Ethan Weber authored and GitHub committed 2022-05-16 14:03:19 -07:00
1 parent 752df417ce
commit 676beebb14
45 files changed
+803 -8354

No files matched your search

+9
View File
@@ -51,6 +51,15 @@ def get_git_root(path, dirs=(".git",), default=None):
return default
def get_project_root():
"""Return the project root directory from an environment variable.
# TODO: handle this better and report user error
"""
project_root = os.getenv("PROJECT_ROOT")
assert project_root is not None, "Please set PROJECT_ROOT to the root directory of this repo."
return project_root
def get_absolute_path(path, proj_root_func=get_git_root):
"""
Returns the full, absolute path.
+14
View File
@@ -37,3 +37,17 @@ def get_dict_to_cpu(stuff):
if isinstance(stuff, torch.Tensor):
return stuff.detach().cpu()
return stuff
def is_not_none(var):
"""Return True if the variable var is None."""
return not isinstance(var, type(None))
def get_masked_dict(d, mask):
"""Return a masked dictionary.
TODO(ethan): add more asserts/checks so this doesn't have unpredictable behavior."""
masked_dict = {}
for key, value in d.items():
masked_dict[key] = value[mask]
return masked_dict
+1 -6
View File
@@ -2,7 +2,6 @@
Profiler base class and functionality
"""
import logging
import sys
import time
from typing import Callable
@@ -21,11 +20,7 @@ def time_function(func: Callable) -> Callable:
start = time.time()
ret = func(*args, **kwargs)
if PROFILER:
vals = vars(sys.modules[func.__module__])
class_str = ""
for attr in func.__qualname__.split(".")[:-1]:
class_str += f"{vals[attr].__qualname__}_"
class_str += func.__name__
class_str = func.__qualname__
PROFILER[0].update_time(class_str, start, time.time())
return ret