mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-12-05 23:38:42 +08:00
hydra config and starting trainer class
This commit is contained in:
1 parent
387d817358
commit
a9c0d5b97f
17 files changed
+125
-3
No files matched your search
@@ -158,3 +158,7 @@ cython_debug/
|
|||||||
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
||||||
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
||||||
#.idea/
|
#.idea/
|
||||||
|
|
||||||
|
# Experiments and outputs
|
||||||
|
runs/
|
||||||
|
outputs/
|
||||||
Vendored
+16
@@ -0,0 +1,16 @@
|
|||||||
|
{
|
||||||
|
// Use IntelliSense to learn about possible attributes.
|
||||||
|
// Hover to view descriptions of existing attributes.
|
||||||
|
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
||||||
|
"version": "0.2.0",
|
||||||
|
"configurations": [
|
||||||
|
{
|
||||||
|
"name": "Python: run_train_nerf",
|
||||||
|
"type": "python",
|
||||||
|
"request": "launch",
|
||||||
|
"program": "scripts/run_train_nerf.py",
|
||||||
|
"console": "integratedTerminal",
|
||||||
|
"args": []
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
Vendored
+5
@@ -13,4 +13,9 @@
|
|||||||
"python.linting.pylintEnabled": true,
|
"python.linting.pylintEnabled": true,
|
||||||
"python.linting.flake8Enabled": false,
|
"python.linting.flake8Enabled": false,
|
||||||
"python.linting.enabled": true,
|
"python.linting.enabled": true,
|
||||||
|
"python.testing.pytestArgs": [
|
||||||
|
"tests"
|
||||||
|
],
|
||||||
|
"python.testing.unittestEnabled": false,
|
||||||
|
"python.testing.pytestEnabled": true,
|
||||||
}
|
}
|
||||||
@@ -15,10 +15,20 @@ pip install -r environment/requirements.txt
|
|||||||
# Install helper library
|
# Install helper library
|
||||||
cd external/goat
|
cd external/goat
|
||||||
python setup.py develop
|
python setup.py develop
|
||||||
|
# then go back, i.e., `cd /path/to/mattport`
|
||||||
|
|
||||||
# For using with Jupyter
|
# For using with Jupyter
|
||||||
python -m ipykernel install --user --name mattport --display-name "mattport"
|
python -m ipykernel install --user --name mattport --display-name "mattport"
|
||||||
|
|
||||||
# Install mattport as a library
|
# Install mattport as a library
|
||||||
python setup.py develop
|
python setup.py develop
|
||||||
|
|
||||||
|
# Running the test cases
|
||||||
|
pytest tests
|
||||||
|
```
|
||||||
|
|
||||||
|
# Training a model
|
||||||
|
|
||||||
|
```
|
||||||
|
python scripts/run_train_nerf.py
|
||||||
```
|
```
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
defaults:
|
||||||
|
- experiment: lego_bulldozer
|
||||||
|
- dataset: blender
|
||||||
|
batch_size: 10
|
||||||
|
optimizer:
|
||||||
|
- lr: 1e-4
|
||||||
Whitespace-only changes.
Whitespace-only changes.
Whitespace-only changes.
@@ -0,0 +1,2 @@
|
|||||||
|
name: lego_bulldozer
|
||||||
|
feature_size: 5
|
||||||
Whitespace-only changes.
Whitespace-only changes.
@@ -1,5 +1,8 @@
|
|||||||
|
hydra-core
|
||||||
pylint==2.13.4
|
pylint==2.13.4
|
||||||
|
pytest
|
||||||
torch==1.11.0
|
torch==1.11.0
|
||||||
|
torchtyping
|
||||||
torchvision==0.12.0
|
torchvision==0.12.0
|
||||||
torchaudio==0.11.0
|
torchaudio==0.11.0
|
||||||
black
|
black
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
import torch.optim as optim
|
||||||
|
|
||||||
|
|
||||||
|
class Optimizer:
|
||||||
|
"""_summary_"""
|
||||||
|
|
||||||
|
def __init__(self, params: dict) -> None:
|
||||||
|
self.optimizer = optim.Adam(params)
|
||||||
|
|
||||||
|
def test(self):
|
||||||
|
raise NotImplementedError
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
import logging
|
||||||
|
import torch
|
||||||
|
|
||||||
|
|
||||||
|
class Trainer(object):
|
||||||
|
def __init__(self, config: None):
|
||||||
|
self.config = config
|
||||||
|
self.optimizer = None
|
||||||
|
|
||||||
|
def load_checkpoint(self):
|
||||||
|
"""_summary_
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
NotImplementedError: _description_
|
||||||
|
"""
|
||||||
|
raise NotImplementedError()
|
||||||
|
|
||||||
|
def save_checkpoint(self):
|
||||||
|
"""_summary_
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
NotImplementedError: _description_
|
||||||
|
"""
|
||||||
|
raise NotImplementedError()
|
||||||
|
|
||||||
|
def load_dataset(self):
|
||||||
|
"""_summary_
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
NotImplementedError: _description_
|
||||||
|
"""
|
||||||
|
raise NotImplementedError()
|
||||||
|
|
||||||
|
def train(self):
|
||||||
|
"""_summary_"""
|
||||||
|
# TODO(ethan): replace print statements with something more proper
|
||||||
|
logging.info("train function")
|
||||||
@@ -6,4 +6,5 @@ The backend viewer code (python, websockets, ...).
|
|||||||
|
|
||||||
```
|
```
|
||||||
https://github.com/lp-research/openvslam/tree/main/viewer
|
https://github.com/lp-research/openvslam/tree/main/viewer
|
||||||
|
https://github.com/rdeits/meshcat
|
||||||
```
|
```
|
||||||
@@ -1,5 +1,26 @@
|
|||||||
import os
|
import os
|
||||||
import mattport.nerf as nerf
|
from typing import Dict
|
||||||
|
from mattport.nerf.trainer import Trainer
|
||||||
|
import logging
|
||||||
|
import hydra
|
||||||
|
from omegaconf import DictConfig
|
||||||
|
|
||||||
|
logging.basicConfig(format="[%(filename)s:%(lineno)d] %(message)s", level=logging.DEBUG)
|
||||||
|
|
||||||
|
|
||||||
|
@hydra.main(config_path="../configs", config_name="config.yaml")
|
||||||
|
def main(cfg: DictConfig):
|
||||||
|
print(cfg)
|
||||||
|
|
||||||
|
print("hello mattport")
|
||||||
|
|
||||||
|
# TODO(ethan): add some sort of config script
|
||||||
|
|
||||||
|
config = {}
|
||||||
|
trainer = Trainer(config)
|
||||||
|
print("trainer!")
|
||||||
|
trainer.train()
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
print("hello mattport")
|
main()
|
||||||
@@ -2,4 +2,8 @@ import pytest
|
|||||||
|
|
||||||
|
|
||||||
def test_positional_encoding():
|
def test_positional_encoding():
|
||||||
raise NotImplementedError()
|
assert True
|
||||||
|
|
||||||
|
|
||||||
|
def test_lower_case():
|
||||||
|
assert "MATTPORT".lower() == "mattport"
|
||||||
Reference in new issue
Block a user