TEXTure / patch
hysts
Add files
fc8860f
raw
history blame
1.59 kB
diff --git a/src/models/textured_mesh.py b/src/models/textured_mesh.py
index 75ffb6d..40d30e6 100644
--- a/src/models/textured_mesh.py
+++ b/src/models/textured_mesh.py
@@ -122,7 +122,7 @@ class TexturedMeshModel(nn.Module):
self.renderer = Renderer(device=self.device, dim=(render_grid_size, render_grid_size),
interpolation_mode=self.opt.texture_interpolation_mode)
- self.env_sphere, self.mesh = self.init_meshes()
+ self.env_sphere, self.mesh = self.init_meshes(opt.shape_path)
self.default_color = [0.8, 0.1, 0.8]
self.background_sphere_colors, self.texture_img = self.init_paint()
self.meta_texture_img = nn.Parameter(torch.zeros_like(self.texture_img))
diff --git a/src/stable_diffusion_depth.py b/src/stable_diffusion_depth.py
index 610d2de..e172080 100644
--- a/src/stable_diffusion_depth.py
+++ b/src/stable_diffusion_depth.py
@@ -1,3 +1,5 @@
+import os
+
from diffusers import AutoencoderKL, UNet2DConditionModel, PNDMScheduler
from huggingface_hub import hf_hub_download
from transformers import CLIPTextModel, CLIPTokenizer, logging
@@ -24,9 +26,7 @@ class StableDiffusion(nn.Module):
super().__init__()
try:
- with open('./TOKEN', 'r') as f:
- self.token = f.read().replace('\n', '') # remove the last \n!
- logger.info(f'loaded hugging face access token from ./TOKEN!')
+ self.token = os.environ['HF_TOKEN']
except FileNotFoundError as e:
self.token = True
logger.warning(