graspnet-infinite-objects / load_example.py
lipeize's picture
Add files using upload-large-folder tool
8245141 verified
Raw History Blame Contribute Delete
474 Bytes
"""Load a few objects, scale them to metres and print their extents. Run after unzipping objects/*.zip into this folder."""
import csv, itertools, trimesh
for rec in itertools.islice(csv.DictReader(open("manifest.csv")), 5):
m = trimesh.load(rec["file"], force="mesh")
m.apply_scale(float(rec["scale_to_metres"]))
print(rec["lvis_category"], rec["uid"], "extent m:", [round(float(e), 3) for e in m.extents], "faces", len(m.faces), "watertight", m.is_watertight)