update
Browse files
primitive_anything/primitive_transformer.py
CHANGED
|
@@ -11,6 +11,7 @@ from einops import rearrange, repeat, reduce, pack
|
|
| 11 |
from gateloop_transformer import SimpleGateLoopLayer
|
| 12 |
from huggingface_hub import PyTorchModelHubMixin
|
| 13 |
import numpy as np
|
|
|
|
| 14 |
from tqdm import tqdm
|
| 15 |
import torch
|
| 16 |
from torch import nn, Tensor
|
|
@@ -322,8 +323,8 @@ class PrimitiveTransformerDiscrete(Module, PyTorchModelHubMixin):
|
|
| 322 |
|
| 323 |
bs_pc_map = {}
|
| 324 |
for bs_name, type_code in SHAPE_CODE.items():
|
| 325 |
-
pc =
|
| 326 |
-
bs_pc_map[type_code] = torch.from_numpy(np.asarray(pc.
|
| 327 |
bs_pc_list = []
|
| 328 |
for i in range(len(bs_pc_map)):
|
| 329 |
bs_pc_list.append(bs_pc_map[i])
|
|
|
|
| 11 |
from gateloop_transformer import SimpleGateLoopLayer
|
| 12 |
from huggingface_hub import PyTorchModelHubMixin
|
| 13 |
import numpy as np
|
| 14 |
+
import trimesh
|
| 15 |
from tqdm import tqdm
|
| 16 |
import torch
|
| 17 |
from torch import nn, Tensor
|
|
|
|
| 323 |
|
| 324 |
bs_pc_map = {}
|
| 325 |
for bs_name, type_code in SHAPE_CODE.items():
|
| 326 |
+
pc = trimesh.load(os.path.join(bs_pc_dir, f'SM_GR_BS_{bs_name}_001.ply'))
|
| 327 |
+
bs_pc_map[type_code] = torch.from_numpy(np.asarray(pc.vertices)).float()
|
| 328 |
bs_pc_list = []
|
| 329 |
for i in range(len(bs_pc_map)):
|
| 330 |
bs_pc_list.append(bs_pc_map[i])
|