mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-12-04 23:08:44 +08:00
Respect wandb environment variables (#1738)
This commit is contained in:
1 parent
8126d47d8c
commit
6c8739ece2
1 file changed
+7
-1
@@ -18,6 +18,7 @@ Generic Writer class
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import enum
|
import enum
|
||||||
|
import os
|
||||||
from abc import abstractmethod
|
from abc import abstractmethod
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from time import time
|
from time import time
|
||||||
@@ -283,7 +284,12 @@ class WandbWriter(Writer):
|
|||||||
"""WandDB Writer Class"""
|
"""WandDB Writer Class"""
|
||||||
|
|
||||||
def __init__(self, log_dir: Path):
|
def __init__(self, log_dir: Path):
|
||||||
wandb.init(project="nerfstudio-project", dir=str(log_dir), reinit=True, name=log_dir.name)
|
wandb.init(
|
||||||
|
project=os.environ.get("WANDB_PROJECT", "nerfstudio-project"),
|
||||||
|
dir=os.environ.get("WANDB_DIR", str(log_dir)),
|
||||||
|
name=os.environ.get("WANDB_NAME", log_dir.name),
|
||||||
|
reinit=True,
|
||||||
|
)
|
||||||
|
|
||||||
def write_image(self, name: str, image: TensorType["H", "W", "C"], step: int) -> None:
|
def write_image(self, name: str, image: TensorType["H", "W", "C"], step: int) -> None:
|
||||||
image = torch.permute(image, (2, 0, 1))
|
image = torch.permute(image, (2, 0, 1))
|
||||||
|
|||||||
Reference in new issue
Block a user