mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-12-03 22:38:48 +08:00
Occupancy grid (#79)
* occupancy grid in progress * visualizing occupancy grid. currently restructing field and renderer head outputs * black and pylint. broke nerfw and semantic nerf but it's okay * get_project_root
This commit is contained in:
1 parent
5c2d8c2a0b
commit
fb440fedf3
23 files changed
+423
-217
No files matched your search
+12
-3
@@ -4,6 +4,8 @@ Input/output utils.
|
||||
import json
|
||||
import os
|
||||
|
||||
import logging
|
||||
|
||||
|
||||
def load_from_json(filename: str):
|
||||
"""_summary_
|
||||
@@ -51,16 +53,23 @@ def get_git_root(path, dirs=(".git",), default=None):
|
||||
return default
|
||||
|
||||
|
||||
def get_project_root():
|
||||
def get_project_root(path):
|
||||
"""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."
|
||||
if project_root is None:
|
||||
logging.info(
|
||||
(
|
||||
"Please set PROJECT_ROOT to the root directory of this repo. "
|
||||
"Going to try calling get_git_root(path) instead."
|
||||
)
|
||||
)
|
||||
project_root = get_git_root(path)
|
||||
return project_root
|
||||
|
||||
|
||||
def get_absolute_path(path, proj_root_func=get_git_root):
|
||||
def get_absolute_path(path, proj_root_func=get_project_root):
|
||||
"""
|
||||
Returns the full, absolute path.
|
||||
Relative paths are assumed to start at the repo directory.
|
||||
|
||||
@@ -157,13 +157,13 @@ class StatsTracker:
|
||||
v = f"{v:0.4f}"
|
||||
curr_mssg += f"{v:<20} "
|
||||
# update the history buffer
|
||||
if len(self.past_stats) >= self.max_history:
|
||||
self.past_stats.pop(0)
|
||||
cursorup(len(self.past_stats) + 1)
|
||||
for mssg in self.past_stats:
|
||||
print(mssg)
|
||||
# if len(self.past_stats) >= self.max_history:
|
||||
# self.past_stats.pop(0)
|
||||
# cursorup(len(self.past_stats) + 1)
|
||||
# for mssg in self.past_stats:
|
||||
# print(mssg)
|
||||
print(curr_mssg)
|
||||
self.past_stats.append(curr_mssg)
|
||||
# self.past_stats.append(curr_mssg)
|
||||
|
||||
@check_print_stats_step
|
||||
def print_stats(self, fraction_done: float):
|
||||
@@ -173,7 +173,7 @@ class StatsTracker:
|
||||
fraction_done (float): fraction of steps executed in training iterations
|
||||
"""
|
||||
# print a new header line if there is a new key added
|
||||
self.handle_header()
|
||||
# self.handle_header()
|
||||
|
||||
# generate a new stats reporting message
|
||||
self.handle_stats(fraction_done)
|
||||
|
||||
Reference in new issue
Block a user