ppak10 commited on
Commit
7fd6461
1 Parent(s): 3dca0f9

Adds `nist_lpbf_scan_tracks.py` file.

Browse files
Files changed (2) hide show
  1. README.md +3 -7
  2. nist_lpbf_scan_tracks.py +195 -0
README.md CHANGED
@@ -5,11 +5,9 @@ language:
5
  tags:
6
  - NIST
7
  ---
8
- # Dataset Card for Dataset Name
9
 
10
- <!-- Provide a quick summary of the dataset. -->
11
-
12
- This dataset card aims to be a base template for new datasets. It has been generated using [this raw template](https://github.com/huggingface/huggingface_hub/blob/main/src/huggingface_hub/templates/datasetcard_template.md?plain=1).
13
 
14
  ## Dataset Details
15
 
@@ -17,8 +15,6 @@ This dataset card aims to be a base template for new datasets. It has been gener
17
 
18
  <!-- Provide a longer summary of what this dataset is. -->
19
 
20
-
21
-
22
  - **Curated by:** [More Information Needed]
23
  - **Funded by [optional]:** [More Information Needed]
24
  - **Shared by [optional]:** [More Information Needed]
@@ -30,7 +26,7 @@ This dataset card aims to be a base template for new datasets. It has been gener
30
  <!-- Provide the basic links for the dataset. -->
31
 
32
  - **Repository:** [More Information Needed]
33
- - **Paper [optional]:** [More Information Needed]
34
  - **Demo [optional]:** [More Information Needed]
35
 
36
  ## Uses
 
5
  tags:
6
  - NIST
7
  ---
8
+ # NIST LPBF Scan Tracks
9
 
10
+ 2 single and 2 multiple lpbf scan tracks on nickel alloy 625.
 
 
11
 
12
  ## Dataset Details
13
 
 
15
 
16
  <!-- Provide a longer summary of what this dataset is. -->
17
 
 
 
18
  - **Curated by:** [More Information Needed]
19
  - **Funded by [optional]:** [More Information Needed]
20
  - **Shared by [optional]:** [More Information Needed]
 
26
  <!-- Provide the basic links for the dataset. -->
27
 
28
  - **Repository:** [More Information Needed]
29
+ - **Paper [optional]:** [Thermographic measurements of single and multiple scan tracks on nickel alloy 625 substrates with and without a powder layer in a commercial laser powder bed fusion process (an additive manufacturing technology)](https://data.nist.gov/od/id/5887178FE62C46F8E0531A57068103631858)
30
  - **Demo [optional]:** [More Information Needed]
31
 
32
  ## Uses
nist_lpbf_scan_tracks.py ADDED
@@ -0,0 +1,195 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Copyright 2020 The HuggingFace Datasets Authors and the current dataset script contributor.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+ # TODO: Address all TODOs and remove all explanatory comments
15
+ """NIST LPBF Scan Tracks"""
16
+
17
+ import os
18
+
19
+ import datasets
20
+
21
+
22
+ # # TODO: Add BibTeX citation
23
+ # # Find for instance the citation on arxiv or on the dataset repo/website
24
+ # _CITATION = """\
25
+ # @InProceedings{huggingface:dataset,
26
+ # title = {A great new dataset},
27
+ # author={huggingface, Inc.
28
+ # },
29
+ # year={2020}
30
+ # }
31
+ # """
32
+
33
+ # TODO: Add description of the dataset here
34
+ # You can copy an official description
35
+ _DESCRIPTION = """\
36
+ Dataset from https://doi.org/10.18434/M3C37Q
37
+ """
38
+
39
+ # TODO: Add a link to an official homepage for the dataset here
40
+ _HOMEPAGE = ""
41
+
42
+ # TODO: Add the licence for the dataset here if you can find it
43
+ _LICENSE = "MIT"
44
+
45
+ # TODO: Add link to the official dataset URLs here
46
+ # The HuggingFace Datasets library doesn't host the datasets but only points to the original files.
47
+ # This can be an arbitrary nested dict/list of URLs (see below in `_split_generators` method)
48
+ _URLS = {
49
+ "powder_single_track_radiant_temperature": "https://huggingface.co/datasets/ppak10/NIST-LPBF-Scan-Tracks/resolve/main/data/powder_plate_1_single_line/radiant_temperature.pkl",
50
+ "powder_single_track_camera_signal": "https://huggingface.co/datasets/ppak10/NIST-LPBF-Scan-Tracks/resolve/main/data/powder_plate_1_single_line/camera_signal.pkl",
51
+ "powder_multiple_track_radiant_temperature": "https://huggingface.co/datasets/ppak10/NIST-LPBF-Scan-Tracks/resolve/main/data/powder_plate_2_pad/radiant_temperature.pkl",
52
+ "powder_multiple_track_camera_signal": "https://huggingface.co/datasets/ppak10/NIST-LPBF-Scan-Tracks/resolve/main/data/powder_plate_2_pad/camera_signal.pkl",
53
+ "bare_single_track_radiant_temperature": "https://huggingface.co/datasets/ppak10/NIST-LPBF-Scan-Tracks/resolve/main/data/powder_plate_6_bare_single_line_195_w_800_mm_s/radiant_temperature.pkl",
54
+ "bare_single_track_camera_signal": "https://huggingface.co/datasets/ppak10/NIST-LPBF-Scan-Tracks/resolve/main/data/powder_plate_6_bare_single_line_195_w_800_mm_s/camera_signal.pkl",
55
+ "bare_multiple_track_radiant_temperature": "https://huggingface.co/datasets/ppak10/NIST-LPBF-Scan-Tracks/resolve/main/data/powder_plate_7_bare_pad_195_w_800_mm_s/radiant_temperature.pkl",
56
+ "bare_multiple_track_camera_signal": "https://huggingface.co/datasets/ppak10/NIST-LPBF-Scan-Tracks/resolve/main/data/powder_plate_7_bare_pad_195_w_800_mm_s/camera_signal.pkl",
57
+ }
58
+
59
+
60
+ # TODO: Name of the dataset usually matches the script name with CamelCase instead of snake_case
61
+ class AMDataset(datasets.GeneratorBasedBuilder):
62
+ """TODO: Short description of my dataset."""
63
+
64
+ VERSION = datasets.Version("0.0.1")
65
+
66
+ # This is an example of a dataset with multiple configurations.
67
+ # If you don't want/need to define several sub-sets in your dataset,
68
+ # just remove the BUILDER_CONFIG_CLASS and the BUILDER_CONFIGS attributes.
69
+
70
+ # If you need to make complex sub-parts in the datasets with configurable options
71
+ # You can create your own builder configuration class to store attribute, inheriting from datasets.BuilderConfig
72
+ # BUILDER_CONFIG_CLASS = MyBuilderConfig
73
+
74
+ # You will be able to load one or the other configurations in the following list with
75
+ # data = datasets.load_dataset('my_dataset', 'first_domain')
76
+ # data = datasets.load_dataset('my_dataset', 'second_domain')
77
+ BUILDER_CONFIGS = [
78
+ datasets.BuilderConfig(
79
+ name="powder_single_track_radiant_temperature",
80
+ version=VERSION,
81
+ description="Radiant temperature from single track raster with powder"
82
+ ),
83
+ datasets.BuilderConfig(
84
+ name="powder_single_track_camera_signal",
85
+ version=VERSION,
86
+ description="Camera signal from single track raster with powder"
87
+ ),
88
+ datasets.BuilderConfig(
89
+ name="powder_multiple_track_radiant_temperature",
90
+ version=VERSION,
91
+ description="Radiant temperature from multiple track raster with powder"
92
+ ),
93
+ datasets.BuilderConfig(
94
+ name="powder_multiple_track_camera_signal",
95
+ version=VERSION,
96
+ description="Camera signal from multiple track raster with powder"
97
+ ),
98
+ datasets.BuilderConfig(
99
+ name="bare_single_track_radiant_temperature",
100
+ version=VERSION,
101
+ description="Radiant temperature from single track raster without powder"
102
+ ),
103
+ datasets.BuilderConfig(
104
+ name="bare_single_track_camera_signal",
105
+ version=VERSION,
106
+ description="Camera signal from single track raster without powder"
107
+ ),
108
+ datasets.BuilderConfig(
109
+ name="bare_multiple_track_radiant_temperature",
110
+ version=VERSION,
111
+ description="Radiant temperature from multiple track raster without powder"
112
+ ),
113
+ datasets.BuilderConfig(
114
+ name="bare_multiple_track_camera_signal",
115
+ version=VERSION,
116
+ description="Camera signal from multiple track raster without powder"
117
+ ),
118
+ ]
119
+
120
+ DEFAULT_CONFIG_NAME = "train" # It's not mandatory to have a default configuration. Just use one if it make sense.
121
+
122
+ def _info(self):
123
+ return datasets.DatasetInfo(
124
+ # This is the description that will appear on the datasets page.
125
+ description=_DESCRIPTION,
126
+ # This defines the different columns of the dataset and their types
127
+ features = datasets.Features({ "i": datasets.Image() }),
128
+ # If there's a common (input, target) tuple from the features, uncomment supervised_keys line below and
129
+ # specify them. They'll be used if as_supervised=True in builder.as_dataset.
130
+ # supervised_keys=("sentence", "label"),
131
+ # Homepage of the dataset for documentation
132
+ homepage=_HOMEPAGE,
133
+ # License for the dataset if available
134
+ license=_LICENSE,
135
+ # Citation for the dataset
136
+ # citation=_CITATION,
137
+ )
138
+
139
+ def _split_generators(self, dl_manager):
140
+ # TODO: This method is tasked with downloading/extracting the data and defining the splits depending on the configuration
141
+ # If several configurations are possible (listed in BUILDER_CONFIGS), the configuration selected by the user is in self.config.name
142
+
143
+ # dl_manager is a datasets.download.DownloadManager that can be used to download and extract URLS
144
+ # It can accept any type or nested list/dict and will give back the same structure with the url replaced with path to local files.
145
+ # By default the archives will be extracted and a path to a cached folder where they are extracted is returned instead of the archive
146
+ # urls = _URLS[self.config.name]
147
+ downloaded_files = dl_manager.download_and_extract(_URLS)
148
+ return [
149
+ datasets.SplitGenerator(
150
+ name=datasets.Split.TRAIN,
151
+ # These kwargs will be passed to _generate_examples
152
+ gen_kwargs={
153
+ # "filepath": os.path.join(data_dir, "train.jsonl"),
154
+ # "split": "train",
155
+ "files": downloaded_files
156
+ },
157
+ ),
158
+ # datasets.SplitGenerator(
159
+ # name=datasets.Split.VALIDATION,
160
+ # # These kwargs will be passed to _generate_examples
161
+ # # gen_kwargs={
162
+ # # "filepath": os.path.join(data_dir, "dev.jsonl"),
163
+ # # "split": "dev",
164
+ # # },
165
+ # ),
166
+ # datasets.SplitGenerator(
167
+ # name=datasets.Split.TEST,
168
+ # # These kwargs will be passed to _generate_examples
169
+ # # gen_kwargs={
170
+ # # "filepath": os.path.join(data_dir, "test.jsonl"),
171
+ # # "split": "test"
172
+ # # },
173
+ # ),
174
+ ]
175
+
176
+ # method parameters are unpacked from `gen_kwargs` as given in `_split_generators`
177
+ # def _generate_examples(self, filepath, split):
178
+ # # TODO: This method handles input defined in _split_generators to yield (key, example) tuples from the dataset.
179
+ # # The `key` is for legacy reasons (tfds) and is not important in itself, but must be unique for each example.
180
+ # with open(filepath, encoding="utf-8") as f:
181
+ # for key, row in enumerate(f):
182
+ # data = json.loads(row)
183
+ # if self.config.name == "raw":
184
+ # # Yields examples as (key, example) tuples
185
+ # yield key, {
186
+ # "sentence": data["sentence"],
187
+ # "option1": data["option1"],
188
+ # "answer": "" if split == "test" else data["answer"],
189
+ # }
190
+ # else:
191
+ # yield key, {
192
+ # "sentence": data["sentence"],
193
+ # "option2": data["option2"],
194
+ # "second_domain_answer": "" if split == "test" else data["second_domain_answer"],
195
+ # }