2023-04-11 14:00:54 +00:00
|
|
|
import datasets
|
2023-04-12 15:19:12 +00:00
|
|
|
import numpy as np
|
2023-04-13 07:58:42 +00:00
|
|
|
from rotor37_data import MEAN, STD
|
2023-04-11 14:00:54 +00:00
|
|
|
|
|
|
|
test_ds = datasets.load_dataset("dataset/rotor37_data.py", split="test")
|
|
|
|
test_ds = test_ds.with_format("torch")
|
|
|
|
print(test_ds)
|
|
|
|
|
2023-04-11 15:32:30 +00:00
|
|
|
train_ds = datasets.load_dataset("dataset/rotor37_data.py", split="train")
|
|
|
|
train_ds = train_ds.with_format("torch")
|
|
|
|
print(train_ds)
|
|
|
|
|
2023-04-12 15:19:12 +00:00
|
|
|
# save pointcloud to txt for paraview viz
|
|
|
|
for idx, blade in enumerate(test_ds):
|
|
|
|
pc = blade["positions"]
|
|
|
|
|
|
|
|
# unnormalize
|
2023-04-13 07:58:42 +00:00
|
|
|
pc = pc * STD + MEAN
|
2023-04-12 15:19:12 +00:00
|
|
|
|
|
|
|
print(f"Saving point cloud {idx}...")
|
|
|
|
np.savetxt(f"pc_{idx}.txt", pc)
|
|
|
|
|
|
|
|
if idx >= 10:
|
|
|
|
break
|