wusize commited on
Commit
e01f5f5
·
verified ·
1 Parent(s): c72d7b0

Upload folder using huggingface_hub

Browse files
Files changed (2) hide show
  1. .idea/workspace.xml +1 -1
  2. app.py +11 -3
.idea/workspace.xml CHANGED
@@ -54,7 +54,7 @@
54
  <option name="number" value="Default" />
55
  <option name="presentableId" value="Default" />
56
  <updated>1760056680813</updated>
57
- <workItem from="1760056681869" duration="2244000" />
58
  </task>
59
  <servers />
60
  </component>
 
54
  <option name="number" value="Default" />
55
  <option name="presentableId" value="Default" />
56
  <updated>1760056680813</updated>
57
+ <workItem from="1760056681869" duration="2999000" />
58
  </task>
59
  <servers />
60
  </component>
app.py CHANGED
@@ -19,7 +19,7 @@ from scripts.camera.visualization.visualize_batch import make_perspective_figure
19
 
20
  from huggingface_hub import snapshot_download
21
  import os
22
- local_path = snapshot_download(
23
  repo_id="KangLiao/Puffin",
24
  repo_type="model",
25
  #filename="Puffin-Base.pth",
@@ -27,7 +27,14 @@ local_path = snapshot_download(
27
  local_dir_use_symlinks=False,
28
  revision="main",
29
  )
30
-
 
 
 
 
 
 
 
31
 
32
  NUM = r"[+-]?(?:\d+(?:\.\d+)?|\.\d+)(?:[eE][+-]?\d+)?"
33
  CAM_PATTERN = re.compile(r"(?:camera parameters.*?:|roll.*?:)\s*("+NUM+r")\s*,\s*("+NUM+r")\s*,\s*("+NUM+r")", re.IGNORECASE|re.DOTALL)
@@ -46,7 +53,8 @@ config = Config.fromfile(config)
46
  model = BUILDER.build(config.model).cuda().bfloat16().eval()
47
  checkpoint_path = "checkpoints/Puffin-Base.pth"
48
  checkpoint = torch.load(checkpoint_path)
49
- info = model.load_state_dict(checkpoint, strict=False)
 
50
 
51
  def fig_to_image(fig):
52
  buf = io.BytesIO()
 
19
 
20
  from huggingface_hub import snapshot_download
21
  import os
22
+ _ = snapshot_download(
23
  repo_id="KangLiao/Puffin",
24
  repo_type="model",
25
  #filename="Puffin-Base.pth",
 
27
  local_dir_use_symlinks=False,
28
  revision="main",
29
  )
30
+ _ = snapshot_download(
31
+ repo_id="wusize/Puffin",
32
+ repo_type="model",
33
+ #filename="Puffin-Base.pth",
34
+ local_dir="checkpoints/",
35
+ local_dir_use_symlinks=False,
36
+ revision="main",
37
+ )
38
 
39
  NUM = r"[+-]?(?:\d+(?:\.\d+)?|\.\d+)(?:[eE][+-]?\d+)?"
40
  CAM_PATTERN = re.compile(r"(?:camera parameters.*?:|roll.*?:)\s*("+NUM+r")\s*,\s*("+NUM+r")\s*,\s*("+NUM+r")", re.IGNORECASE|re.DOTALL)
 
53
  model = BUILDER.build(config.model).cuda().bfloat16().eval()
54
  checkpoint_path = "checkpoints/Puffin-Base.pth"
55
  checkpoint = torch.load(checkpoint_path)
56
+ _ = model.load_state_dict(checkpoint, strict=False)
57
+ _ = model.vae.load_state_dict(torch.load('checkpoints/vae.pth'), strict=True)
58
 
59
  def fig_to_image(fig):
60
  buf = io.BytesIO()