24 lines
579 B
Python
24 lines
579 B
Python
import datasets
|
|
import numpy as np
|
|
|
|
test_ds = datasets.load_dataset("dataset/rotor37_data.py", split="test")
|
|
test_ds = test_ds.with_format("torch")
|
|
print(test_ds)
|
|
|
|
train_ds = datasets.load_dataset("dataset/rotor37_data.py", split="train")
|
|
train_ds = train_ds.with_format("torch")
|
|
print(train_ds)
|
|
|
|
# save pointcloud to txt for paraview viz
|
|
for idx, blade in enumerate(test_ds):
|
|
pc = blade["positions"]
|
|
|
|
# unnormalize
|
|
pc = pc * blade["std"] + blade["mean"]
|
|
|
|
print(f"Saving point cloud {idx}...")
|
|
np.savetxt(f"pc_{idx}.txt", pc)
|
|
|
|
if idx >= 10:
|
|
break
|