Datasets:
Modalities:
3D
Size:
10K<n<100K
commit files to HF hub
Browse files- windtunnel_dataset.py +23 -8
windtunnel_dataset.py
CHANGED
@@ -35,14 +35,29 @@ class WindtunnelDataset(datasets.GeneratorBasedBuilder):
|
|
35 |
def _generate_examples(self, metadata):
|
36 |
"""Generate examples for each split."""
|
37 |
for sim_id, files in metadata.items():
|
38 |
-
yield
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46 |
|
47 |
def _load_json(self, file_path):
|
48 |
"""Load a JSON file and return it as a dictionary."""
|
|
|
35 |
def _generate_examples(self, metadata):
|
36 |
"""Generate examples for each split."""
|
37 |
for sim_id, files in metadata.items():
|
38 |
+
yield (
|
39 |
+
sim_id,
|
40 |
+
{
|
41 |
+
"coeff": self._load_json(files["coeff"]),
|
42 |
+
# 'input': self._load_json(files['input']),
|
43 |
+
"input_mesh": self._load_binary(
|
44 |
+
os.path.join(self.config.data_dir, sim_id, "input_mesh.obj")
|
45 |
+
),
|
46 |
+
"openfoam_mesh": self._load_binary(
|
47 |
+
os.path.join(self.config.data_dir, sim_id, "openfoam_mesh.obj")
|
48 |
+
),
|
49 |
+
"pressure_field_mesh": self._load_binary(
|
50 |
+
os.path.join(
|
51 |
+
self.config.data_dir, sim_id, "pressure_field_mesh.vtk"
|
52 |
+
)
|
53 |
+
),
|
54 |
+
"streamlines_mesh": self._load_binary(
|
55 |
+
os.path.join(
|
56 |
+
self.config.data_dir, sim_id, "streamlines_mesh.ply"
|
57 |
+
)
|
58 |
+
),
|
59 |
+
},
|
60 |
+
)
|
61 |
|
62 |
def _load_json(self, file_path):
|
63 |
"""Load a JSON file and return it as a dictionary."""
|