daerduoCarey / structurenet

StructureNet: Hierarchical Graph Networks for 3D Shape Generation
https://cs.stanford.edu/~kaichun/structurenet/
Other
258 stars 45 forks source link

Loading .npz on Pytorch3D Poinclouds structure gives - KeyError: 'verts is not a file in the archive' #8

Closed albertotono closed 3 years ago

albertotono commented 3 years ago

Awesome project, thank you so much

KeyError                                  Traceback (most recent call last)
<ipython-input-20-1daf13c71fa1> in <module>()
----> 1 verts = torch.Tensor(pointcloud['verts']).to(device)
      2 rgb = torch.Tensor(pointcloud['rgb']).to(device)
      3 
      4 point_cloud = Pointclouds(points=[verts], features=[rgb])

/usr/local/lib/python3.6/dist-packages/numpy/lib/npyio.py in __getitem__(self, key)
    264                 return self.zip.read(key)
    265         else:
--> 266             raise KeyError("%s is not a file in the archive" % key)
    267 
    268 

**KeyError: 'verts is not a file in the archive'**

I am creating Pytorch3d datastructure Pointclouds

from pytorch3d.structures import Pointclouds
#import all the others

# Set paths
DATA_DIR = "./data"
obj_filename = os.path.join(DATA_DIR, "/content/drive/My Drive/Datasets/StructureNET/partnethiergeo/chair_geo/173.npz")

# Load point cloud
pointcloud = np.load(obj_filename)
verts = torch.Tensor(pointcloud['verts']).to(device)     
rgb = torch.Tensor(pointcloud['rgb']).to(device)

point_cloud = Pointclouds(points=[verts], features=[rgb])

I was wondering if the file .npz are normal pointclouds or they are different, and why I am receiving that error? any suggestions how to visualize that pointcloud in Colab?

daerduoCarey commented 3 years ago

i'm closing this as this is old and the questions are not relevant to the StrucutreNet project.