Datasets:
Convert dataset to Parquet (#2)
Browse files- Convert dataset to Parquet (c650355549d47a8a8f51b3ccea68bc002c75ad68)
- Delete loading script (4e8b5f69675fbc1e615e3541cf60932dcb11495f)
- Delete data file (9a333eb1b7625b3337fa2ecb9ed1e8e11e57f2e3)
- Delete data file (1032864a38c150b92458d43a300bd6805b00c202)
- MyoQuant-SDH-Data.py +0 -130
- README.md +35 -25
- SDH_16k/metadata.jsonl +0 -0
- SDH_16k/{SDH_16k.zip → test-00000-of-00001.parquet} +2 -2
- SDH_16k/train-00000-of-00003.parquet +3 -0
- SDH_16k/train-00001-of-00003.parquet +3 -0
- SDH_16k/train-00002-of-00003.parquet +3 -0
- SDH_16k/validation-00000-of-00001.parquet +3 -0
MyoQuant-SDH-Data.py
DELETED
@@ -1,130 +0,0 @@
|
|
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 |
-
"""MyoQuant-SDH-Data: The MyoQuant SDH Model Data."""
|
15 |
-
|
16 |
-
|
17 |
-
import csv
|
18 |
-
import json
|
19 |
-
import os
|
20 |
-
|
21 |
-
import datasets
|
22 |
-
|
23 |
-
|
24 |
-
_CITATION = """\
|
25 |
-
@InProceedings{Meyer,
|
26 |
-
title = {MyoQuant SDH Data},
|
27 |
-
author={Corentin Meyer},
|
28 |
-
year={2022}
|
29 |
-
}
|
30 |
-
"""
|
31 |
-
_NAMES = ["control", "sick"]
|
32 |
-
|
33 |
-
_DESCRIPTION = """\
|
34 |
-
This dataset is used to train the SDH model of MyoQuant to detect and quantify anomaly in the mitochondria repartition in SDH stained muscle fiber with myopathy disorders.
|
35 |
-
"""
|
36 |
-
|
37 |
-
_HOMEPAGE = "https://huggingface.co/datasets/corentinm7/MyoQuant-SDH-Data"
|
38 |
-
|
39 |
-
_LICENSE = "agpl-3.0"
|
40 |
-
|
41 |
-
_URLS = {
|
42 |
-
"SDH_16k": "https://huggingface.co/datasets/corentinm7/MyoQuant-SDH-Data/resolve/main/SDH_16k/SDH_16k.zip"
|
43 |
-
}
|
44 |
-
_METADATA_URL = {
|
45 |
-
"SDH_16k_metadata": "https://huggingface.co/datasets/corentinm7/MyoQuant-SDH-Data/resolve/main/SDH_16k/metadata.jsonl"
|
46 |
-
}
|
47 |
-
|
48 |
-
|
49 |
-
class SDH_16k(datasets.GeneratorBasedBuilder):
|
50 |
-
"""This dataset is used to train the SDH model of MyoQuant to detect and quantify anomaly in the mitochondria repartition in SDH stained muscle fiber with myopathy disorders."""
|
51 |
-
|
52 |
-
VERSION = datasets.Version("1.0.0")
|
53 |
-
|
54 |
-
# This is an example of a dataset with multiple configurations.
|
55 |
-
# If you don't want/need to define several sub-sets in your dataset,
|
56 |
-
# just remove the BUILDER_CONFIG_CLASS and the BUILDER_CONFIGS attributes.
|
57 |
-
|
58 |
-
# If you need to make complex sub-parts in the datasets with configurable options
|
59 |
-
# You can create your own builder configuration class to store attribute, inheriting from datasets.BuilderConfig
|
60 |
-
# BUILDER_CONFIG_CLASS = MyBuilderConfig
|
61 |
-
|
62 |
-
# You will be able to load one or the other configurations in the following list with
|
63 |
-
# data = datasets.load_dataset('my_dataset', 'first_domain')
|
64 |
-
# data = datasets.load_dataset('my_dataset', 'second_domain')
|
65 |
-
|
66 |
-
DEFAULT_CONFIG_NAME = "SDH_16k" # It's not mandatory to have a default configuration. Just use one if it make sense.
|
67 |
-
|
68 |
-
def _info(self):
|
69 |
-
return datasets.DatasetInfo(
|
70 |
-
description=_DESCRIPTION,
|
71 |
-
features=datasets.Features(
|
72 |
-
{
|
73 |
-
"image": datasets.Image(),
|
74 |
-
"label": datasets.ClassLabel(num_classes=2, names=_NAMES),
|
75 |
-
}
|
76 |
-
),
|
77 |
-
supervised_keys=("image", "label"),
|
78 |
-
homepage=_HOMEPAGE,
|
79 |
-
citation=_CITATION,
|
80 |
-
license=_LICENSE,
|
81 |
-
)
|
82 |
-
|
83 |
-
def _split_generators(self, dl_manager):
|
84 |
-
archive_path = dl_manager.download(_URLS)
|
85 |
-
split_metadata_path = dl_manager.download(_METADATA_URL)
|
86 |
-
files_metadata = {}
|
87 |
-
with open(split_metadata_path["SDH_16k_metadata"], encoding="utf-8") as f:
|
88 |
-
for lines in f.read().splitlines():
|
89 |
-
file_json_metdata = json.loads(lines)
|
90 |
-
files_metadata.setdefault(file_json_metdata["split"], []).append(
|
91 |
-
file_json_metdata
|
92 |
-
)
|
93 |
-
downloaded_files = dl_manager.download_and_extract(archive_path)
|
94 |
-
return [
|
95 |
-
datasets.SplitGenerator(
|
96 |
-
name=datasets.Split.TRAIN,
|
97 |
-
gen_kwargs={
|
98 |
-
"download_path": downloaded_files["SDH_16k"],
|
99 |
-
"metadata": files_metadata["train"],
|
100 |
-
},
|
101 |
-
),
|
102 |
-
datasets.SplitGenerator(
|
103 |
-
name=datasets.Split.VALIDATION,
|
104 |
-
gen_kwargs={
|
105 |
-
"download_path": downloaded_files["SDH_16k"],
|
106 |
-
"metadata": files_metadata["validation"],
|
107 |
-
},
|
108 |
-
),
|
109 |
-
datasets.SplitGenerator(
|
110 |
-
name=datasets.Split.TEST,
|
111 |
-
gen_kwargs={
|
112 |
-
"download_path": downloaded_files["SDH_16k"],
|
113 |
-
"metadata": files_metadata["test"],
|
114 |
-
},
|
115 |
-
),
|
116 |
-
]
|
117 |
-
|
118 |
-
def _generate_examples(self, download_path, metadata):
|
119 |
-
"""Generate images and labels for splits."""
|
120 |
-
for i, single_metdata in enumerate(metadata):
|
121 |
-
img_path = os.path.join(
|
122 |
-
download_path,
|
123 |
-
single_metdata["split"],
|
124 |
-
single_metdata["label"],
|
125 |
-
single_metdata["file_name"],
|
126 |
-
)
|
127 |
-
yield i, {
|
128 |
-
"image": img_path,
|
129 |
-
"label": single_metdata["label"],
|
130 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
README.md
CHANGED
@@ -1,5 +1,6 @@
|
|
1 |
---
|
2 |
dataset_info:
|
|
|
3 |
features:
|
4 |
- name: image
|
5 |
dtype: image
|
@@ -7,46 +8,55 @@ dataset_info:
|
|
7 |
dtype:
|
8 |
class_label:
|
9 |
names:
|
10 |
-
0: control
|
11 |
-
1: sick
|
12 |
-
config_name: SDH_16k
|
13 |
splits:
|
14 |
-
- name: test
|
15 |
-
num_bytes: 683067
|
16 |
-
num_examples: 3358
|
17 |
- name: train
|
18 |
-
num_bytes:
|
19 |
num_examples: 12085
|
20 |
- name: validation
|
21 |
-
num_bytes:
|
22 |
num_examples: 1344
|
23 |
-
|
24 |
-
|
|
|
|
|
|
|
25 |
annotations_creators:
|
26 |
-
|
27 |
language: []
|
28 |
language_creators:
|
29 |
-
|
30 |
license:
|
31 |
-
|
32 |
multilinguality: []
|
33 |
pretty_name: SDH staining muscle fiber histology images used to train MyoQuant model.
|
34 |
size_categories:
|
35 |
-
|
36 |
source_datasets:
|
37 |
-
|
38 |
tags:
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
task_categories:
|
49 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
50 |
---
|
51 |
|
52 |
# Dataset Card for MyoQuant SDH Data
|
|
|
1 |
---
|
2 |
dataset_info:
|
3 |
+
config_name: SDH_16k
|
4 |
features:
|
5 |
- name: image
|
6 |
dtype: image
|
|
|
8 |
dtype:
|
9 |
class_label:
|
10 |
names:
|
11 |
+
'0': control
|
12 |
+
'1': sick
|
|
|
13 |
splits:
|
|
|
|
|
|
|
14 |
- name: train
|
15 |
+
num_bytes: 1400462101.57
|
16 |
num_examples: 12085
|
17 |
- name: validation
|
18 |
+
num_bytes: 161799668.032
|
19 |
num_examples: 1344
|
20 |
+
- name: test
|
21 |
+
num_bytes: 411212294.084
|
22 |
+
num_examples: 3358
|
23 |
+
download_size: 1411281481
|
24 |
+
dataset_size: 1973474063.6859999
|
25 |
annotations_creators:
|
26 |
+
- expert-generated
|
27 |
language: []
|
28 |
language_creators:
|
29 |
+
- expert-generated
|
30 |
license:
|
31 |
+
- agpl-3.0
|
32 |
multilinguality: []
|
33 |
pretty_name: SDH staining muscle fiber histology images used to train MyoQuant model.
|
34 |
size_categories:
|
35 |
+
- 10K<n<100K
|
36 |
source_datasets:
|
37 |
+
- original
|
38 |
tags:
|
39 |
+
- myology
|
40 |
+
- biology
|
41 |
+
- histology
|
42 |
+
- muscle
|
43 |
+
- cells
|
44 |
+
- fibers
|
45 |
+
- myopathy
|
46 |
+
- SDH
|
47 |
+
- myoquant
|
48 |
task_categories:
|
49 |
+
- image-classification
|
50 |
+
configs:
|
51 |
+
- config_name: SDH_16k
|
52 |
+
data_files:
|
53 |
+
- split: train
|
54 |
+
path: SDH_16k/train-*
|
55 |
+
- split: validation
|
56 |
+
path: SDH_16k/validation-*
|
57 |
+
- split: test
|
58 |
+
path: SDH_16k/test-*
|
59 |
+
default: true
|
60 |
---
|
61 |
|
62 |
# Dataset Card for MyoQuant SDH Data
|
SDH_16k/metadata.jsonl
DELETED
The diff for this file is too large to render.
See raw diff
|
|
SDH_16k/{SDH_16k.zip → test-00000-of-00001.parquet}
RENAMED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:d87c02a0b62d71682605870bc4feb337c639f901f1eb2d4c75e80fe3d42c26ed
|
3 |
+
size 281330348
|
SDH_16k/train-00000-of-00003.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:3e5690ada20952202da39381d690965c2006e7167f83813065f7e1005883c324
|
3 |
+
size 336464906
|
SDH_16k/train-00001-of-00003.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:cfd4745ed4c677c60ccbb7ebc116b5bc786ee2681fbd38e3fbf24691952fc3dd
|
3 |
+
size 340970471
|
SDH_16k/train-00002-of-00003.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:a38fd18c2e749c5d5eb8c1d9d0854536bc5a9c6e4b1f9e1ad5fa8a5bd10bc58d
|
3 |
+
size 339377396
|
SDH_16k/validation-00000-of-00001.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:55e9f37c91aca86463308252d4f1cb037f585ba9844ef437c8d7344946ea0f0a
|
3 |
+
size 113138360
|