Datasets:
File size: 474 Bytes
8245141 | 1 2 3 4 5 6 7 | """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)
|