mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-12-04 06:49:13 +08:00
rename alphas mult to alphas loss mult
This commit is contained in:
1 parent
eee05195c0
commit
b3dca69ddb
3 files changed
+1
-20
No files matched your search
@@ -53,11 +53,8 @@ CLIP_SOURCE = "openai/clip-vit-large-patch14"
|
|||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
class UNet2DConditionOutput:
|
class UNet2DConditionOutput:
|
||||||
<<<<<<< HEAD
|
|
||||||
=======
|
|
||||||
"""Class to hold traced model"""
|
"""Class to hold traced model"""
|
||||||
|
|
||||||
>>>>>>> df784e96e7979aaa4320284c087d7036dce67c28
|
|
||||||
sample: torch.FloatTensor
|
sample: torch.FloatTensor
|
||||||
|
|
||||||
|
|
||||||
@@ -92,11 +89,7 @@ class StableDiffusion(nn.Module):
|
|||||||
pipe.enable_attention_slicing()
|
pipe.enable_attention_slicing()
|
||||||
|
|
||||||
# use jitted unet
|
# use jitted unet
|
||||||
<<<<<<< HEAD
|
|
||||||
unet_traced_filename = Path(appdirs.user_data_dir("nerfstudio")) / "unet_traced.pt"
|
|
||||||
=======
|
|
||||||
unet_traced_filename = Path(appdirs.user_data_dir("nerfstudio")) / "sd_unet_traced.pt"
|
unet_traced_filename = Path(appdirs.user_data_dir("nerfstudio")) / "sd_unet_traced.pt"
|
||||||
>>>>>>> df784e96e7979aaa4320284c087d7036dce67c28
|
|
||||||
if unet_traced_filename.exists():
|
if unet_traced_filename.exists():
|
||||||
CONSOLE.print("Loading traced UNet.")
|
CONSOLE.print("Loading traced UNet.")
|
||||||
unet_traced = torch.jit.load(unet_traced_filename)
|
unet_traced = torch.jit.load(unet_traced_filename)
|
||||||
@@ -109,26 +102,16 @@ class StableDiffusion(nn.Module):
|
|||||||
self.in_channels = pipe.unet.in_channels
|
self.in_channels = pipe.unet.in_channels
|
||||||
self.device = pipe.unet.device
|
self.device = pipe.unet.device
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
def forward(self, latent_model_input, t, encoder_hidden_states):
|
|
||||||
=======
|
|
||||||
def forward(self, latent_model_input, t, encoder_hidden_states): # pylint: disable=no-self-use
|
def forward(self, latent_model_input, t, encoder_hidden_states): # pylint: disable=no-self-use
|
||||||
"""Forward pass"""
|
"""Forward pass"""
|
||||||
>>>>>>> df784e96e7979aaa4320284c087d7036dce67c28
|
|
||||||
sample = unet_traced(latent_model_input, t, encoder_hidden_states)[0]
|
sample = unet_traced(latent_model_input, t, encoder_hidden_states)[0]
|
||||||
return UNet2DConditionOutput(sample=sample)
|
return UNet2DConditionOutput(sample=sample)
|
||||||
|
|
||||||
self.unet = TracedUNet()
|
self.unet = TracedUNet()
|
||||||
del pipe.unet
|
del pipe.unet
|
||||||
else:
|
else:
|
||||||
<<<<<<< HEAD
|
|
||||||
CONSOLE.print(
|
|
||||||
"Warning: Loading UNet without JIT acceleration. Run trace_stablediff.py in the scripts folder for a speedup!"
|
|
||||||
)
|
|
||||||
=======
|
|
||||||
CONSOLE.print("[bold yellow] Warning: Loading UNet without JIT acceleration.")
|
CONSOLE.print("[bold yellow] Warning: Loading UNet without JIT acceleration.")
|
||||||
CONSOLE.print(r"Run [yellow]python scripts/generative/trace_stable_diffusion.py[/yellow] for a speedup!")
|
CONSOLE.print(r"Run [yellow]python scripts/generative/trace_stable_diffusion.py[/yellow] for a speedup!")
|
||||||
>>>>>>> df784e96e7979aaa4320284c087d7036dce67c28
|
|
||||||
self.unet = pipe.unet
|
self.unet = pipe.unet
|
||||||
self.unet.to(memory_format=torch.channels_last)
|
self.unet.to(memory_format=torch.channels_last)
|
||||||
|
|
||||||
|
|||||||
@@ -61,8 +61,6 @@ class DreamFusionModelConfig(ModelConfig):
|
|||||||
_target: Type = field(default_factory=lambda: DreamFusionModel)
|
_target: Type = field(default_factory=lambda: DreamFusionModel)
|
||||||
"""target class to instantiate"""
|
"""target class to instantiate"""
|
||||||
|
|
||||||
# num_samples: int = 128
|
|
||||||
# """Number of samples in field evaluation"""
|
|
||||||
orientation_loss_mult: float = 0.01
|
orientation_loss_mult: float = 0.01
|
||||||
"""Orientation loss multipier on computed normals."""
|
"""Orientation loss multipier on computed normals."""
|
||||||
pred_normal_loss_mult: float = 0.001
|
pred_normal_loss_mult: float = 0.001
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ class DreamfusionPipelineConfig(VanillaPipelineConfig):
|
|||||||
"""appended to prompt for back view"""
|
"""appended to prompt for back view"""
|
||||||
alphas_penalty: bool = True
|
alphas_penalty: bool = True
|
||||||
"""enables penalty to encourage sparse weights (penalizing for uniform density along ray)"""
|
"""enables penalty to encourage sparse weights (penalizing for uniform density along ray)"""
|
||||||
alphas_scale: float = 1
|
alphas_loss_mult: float = 1
|
||||||
"""scale for alphas penalty"""
|
"""scale for alphas penalty"""
|
||||||
opacity_penalty: bool = True
|
opacity_penalty: bool = True
|
||||||
"""enables penalty to encourage transparent scenes, as in "dreamfields" paper"""
|
"""enables penalty to encourage transparent scenes, as in "dreamfields" paper"""
|
||||||
|
|||||||
Reference in new issue
Block a user