File size: 1,584 Bytes
0adea73
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
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.getenv('HF_TOKEN')
         except FileNotFoundError as e:
             self.token = True
             logger.warning(