yejunliang23 commited on
Commit
ad9acf3
·
verified ·
1 Parent(s): 63abbd3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -260,12 +260,11 @@ def add_text(history, task_history, text,task_new):
260
  def add_file(history, task_history, file, task_new, fig, query):
261
  if file.name.endswith(('.obj', '.glb')):
262
  position_recon = load_vertices(file.name)#(N,3)
263
- print(position_recon)
264
  coords = ((torch.from_numpy(position_recon) + 0.5) * 64).int().contiguous()
265
- print(coords)
266
- print(coords.shape)
267
  ss = torch.zeros(1, 64, 64, 64, dtype=torch.long)
268
  ss[:, coords[:, 0], coords[:, 1], coords[:, 2]] = 1
 
 
269
  token = vqvae.Encode(ss.to(dtype=torch.float32).unsqueeze(0))
270
  token = token[0].cpu().numpy().tolist()
271
  words = token_to_words(token)
 
260
  def add_file(history, task_history, file, task_new, fig, query):
261
  if file.name.endswith(('.obj', '.glb')):
262
  position_recon = load_vertices(file.name)#(N,3)
 
263
  coords = ((torch.from_numpy(position_recon) + 0.5) * 64).int().contiguous()
 
 
264
  ss = torch.zeros(1, 64, 64, 64, dtype=torch.long)
265
  ss[:, coords[:, 0], coords[:, 1], coords[:, 2]] = 1
266
+ print(ss)
267
+ print(ss.max(),ss.min())
268
  token = vqvae.Encode(ss.to(dtype=torch.float32).unsqueeze(0))
269
  token = token[0].cpu().numpy().tolist()
270
  words = token_to_words(token)