Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -262,14 +262,12 @@ def add_file(history, task_history, file, task_new, fig, query):
|
|
| 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 |
ss = torch.zeros(1, 64, 64, 64, dtype=torch.long)
|
| 266 |
ss[:, coords[:, 0], coords[:, 1], coords[:, 2]] = 1
|
| 267 |
-
print(ss.shape)
|
| 268 |
-
print(ss)
|
| 269 |
token = vqvae.Encode(ss.to(dtype=torch.float32).unsqueeze(0))
|
| 270 |
-
print(token.shape)
|
| 271 |
token = token[0].cpu().numpy().tolist()
|
| 272 |
-
print(token)
|
| 273 |
words = token_to_words(token)
|
| 274 |
fig = make_pointcloud_figure(position_recon,rotate=True)
|
| 275 |
return history, task_history,file.name,task_new,fig,gr.update(
|
|
|
|
| 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)
|
| 272 |
fig = make_pointcloud_figure(position_recon,rotate=True)
|
| 273 |
return history, task_history,file.name,task_new,fig,gr.update(
|