Datasets:
Modalities:
3D
Size:
10K<n<100K
Delete windtunnel.py with huggingface_hub
Browse files- windtunnel.py +0 -58
windtunnel.py
DELETED
@@ -1,58 +0,0 @@
|
|
1 |
-
import json
|
2 |
-
import os
|
3 |
-
import datasets
|
4 |
-
|
5 |
-
|
6 |
-
class WindtunnelDataset(datasets.GeneratorBasedBuilder):
|
7 |
-
"""Dataset for loading simulation data with JSON and mesh files"""
|
8 |
-
|
9 |
-
def _info(self):
|
10 |
-
return datasets.DatasetInfo(
|
11 |
-
features=datasets.Features(
|
12 |
-
{
|
13 |
-
"coeff": datasets.Value("binary"), # JSON file as a dictionary
|
14 |
-
"input": datasets.Value("binary"), # JSON file as a dictionary
|
15 |
-
"input_mesh": datasets.Value("binary"), # OBJ mesh file as binary
|
16 |
-
"openfoam_mesh": datasets.Value(
|
17 |
-
"binary"
|
18 |
-
), # OBJ mesh file as binary
|
19 |
-
"pressure_field_mesh": datasets.Value(
|
20 |
-
"binary"
|
21 |
-
), # VTK file as binary
|
22 |
-
"streamlines_mesh": datasets.Value("binary"), # PLY file as binary
|
23 |
-
}
|
24 |
-
),
|
25 |
-
homepage="https://inductiva.ai",
|
26 |
-
)
|
27 |
-
|
28 |
-
def _split_generators(self, dl_manager):
|
29 |
-
"""Define the splits for the dataset."""
|
30 |
-
train_dir = "train"
|
31 |
-
val_dir = "validation"
|
32 |
-
test_dir = "test"
|
33 |
-
return [
|
34 |
-
datasets.SplitGenerator(
|
35 |
-
name=datasets.Split.TRAIN, gen_kwargs={"path": train_dir}
|
36 |
-
),
|
37 |
-
datasets.SplitGenerator(
|
38 |
-
name=datasets.Split.VALIDATION,
|
39 |
-
gen_kwargs={"path": val_dir},
|
40 |
-
),
|
41 |
-
datasets.SplitGenerator(
|
42 |
-
name=datasets.Split.TEST,
|
43 |
-
gen_kwargs={"path": test_dir},
|
44 |
-
),
|
45 |
-
]
|
46 |
-
|
47 |
-
def _generate_examples(self, path):
|
48 |
-
"""Generate examples for each split."""
|
49 |
-
id = 0
|
50 |
-
for root, dirs, files in os.walk(path):
|
51 |
-
for file in files:
|
52 |
-
yield (
|
53 |
-
id,
|
54 |
-
{
|
55 |
-
"label": id,
|
56 |
-
},
|
57 |
-
)
|
58 |
-
id += 1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|