use literal instead of list for --vis (#628)

use literal instead of list
This commit is contained in:
Ethan Weber authored and GitHub committed 2022-10-03 09:58:42 -07:00
1 parent 3efd3c3298
commit 75866f3a8f
4 files changed
+13 -21

No files matched your search

+5 -5
View File
@@ -19,7 +19,7 @@
from __future__ import annotations
import logging
from dataclasses import dataclass, field
from dataclasses import dataclass
from datetime import datetime
from pathlib import Path
from typing import Any, Dict, List, Literal, Optional, Tuple, Type
@@ -205,19 +205,19 @@ class Config(PrintableConfig):
}
)
"""optionally specify a pre-defined config to load from"""
vis: List[Literal["viewer", "wandb", "tensorboard"]] = field(default_factory=lambda: ["wandb"])
vis: Literal["viewer", "wandb", "tensorboard"] = "wandb"
def is_viewer_enabled(self) -> bool:
"""Checks if a viewer is enabled."""
return "viewer" in self.vis
return "viewer" == self.vis
def is_wandb_enabled(self) -> bool:
"""Checks if wandb is enabled."""
return "wandb" in self.vis
return "wandb" == self.vis
def is_tensorboard_enabled(self) -> bool:
"""Checks if tensorboard is enabled."""
return "tensorboard" in self.vis
return "tensorboard" == self.vis
def set_timestamp(self) -> None:
"""Dynamically set the experiment timestamp"""
+2 -2
View File
@@ -74,7 +74,7 @@ model_configs["nerfacto"] = Config(
},
},
viewer=ViewerConfig(num_rays_per_chunk=1 << 16),
vis=["viewer"],
vis="viewer",
)
model_configs["instant-ngp"] = Config(
@@ -91,7 +91,7 @@ model_configs["instant-ngp"] = Config(
}
},
viewer=ViewerConfig(num_rays_per_chunk=64000),
vis=["viewer"],
vis="viewer",
)
model_configs["mipnerf-360"] = Config(