mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-12-01 13:28:59 +08:00
Config restructure (#283)
* starting docs for pipelines * working on an example * clearing output * starting to implement config changes and add documentation * wip: removed cicular imports; porting basic config into python; todo: get python setups workin * circular imports again * wip: pausing at dataloader sort of working * break for today * running vanilla * wip need to get all the config docs working * laptop about to die * instant ngp working * added all configs for all methods; not tested yet: [mipnerf360, nerfw, semantic_nerf] * unpacking later * done with pylinting * mostly done. just need to do docs and one test * added import order to docs * fixing near/far plane and other config things * making loggers also instantiable via configs * docs * lint * making --help work with dcargs * moving configs back into flat * convert list to tuples; fixed post init function with mutable params * lint * made run_eval and benchmarking scripts compatible with new config/dcargs * lint * added option to load configs from presaved config Co-authored-by: evonneng <evonne_ng@berkeley.edu>
This commit is contained in:
1 parent
e0856e3afc
commit
7e9a56fac4
46 files changed
+987
-916
No files matched your search
@@ -15,12 +15,14 @@
|
||||
"""
|
||||
Profiler base class and functionality
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import logging
|
||||
import time
|
||||
from typing import Callable
|
||||
|
||||
from nerfactory.configs import base as cfg
|
||||
from nerfactory.utils import comms
|
||||
from nerfactory.utils.config import LoggingConfig
|
||||
from nerfactory.utils.decorators import (
|
||||
check_main_thread,
|
||||
check_profiler_enabled,
|
||||
@@ -44,13 +46,13 @@ def time_function(func: Callable) -> Callable:
|
||||
return wrapper
|
||||
|
||||
|
||||
def flush_profiler(config: LoggingConfig):
|
||||
def flush_profiler(config: cfg.LoggingConfig):
|
||||
"""Method that checks if profiler is enabled before flushing"""
|
||||
if config.enable_profiler and PROFILER:
|
||||
PROFILER[0].print_profile()
|
||||
|
||||
|
||||
def setup_profiler(config: LoggingConfig):
|
||||
def setup_profiler(config: cfg.LoggingConfig):
|
||||
"""Initialization of profilers"""
|
||||
if comms.is_main_process():
|
||||
PROFILER.append(Profiler(config))
|
||||
@@ -60,7 +62,7 @@ def setup_profiler(config: LoggingConfig):
|
||||
class Profiler:
|
||||
"""Profiler class"""
|
||||
|
||||
def __init__(self, config: LoggingConfig):
|
||||
def __init__(self, config: cfg.LoggingConfig):
|
||||
self.config = config
|
||||
self.profiler_dict = {}
|
||||
|
||||
|
||||
Reference in new issue
Block a user