Files changed (2) hide show
  1. TID2008.py +0 -86
  2. data.zip +0 -3
TID2008.py DELETED
@@ -1,86 +0,0 @@
1
- import os
2
-
3
- import pandas as pd
4
- import datasets
5
-
6
- _CITATION = """\
7
- @article{ponomarenko_tid2008_2009,
8
- author = {Ponomarenko, Nikolay and Lukin, Vladimir and Zelensky, Alexander and Egiazarian, Karen and Astola, Jaakko and Carli, Marco and Battisti, Federica},
9
- title = {{TID2008} -- {A} {Database} for {Evaluation} of {Full}- {Reference} {Visual} {Quality} {Assessment} {Metrics}},
10
- year = {2009}
11
- }
12
- """
13
-
14
-
15
- _DESCRIPTION = """\
16
- Image Quality Assessment Dataset consisting of 25 reference images, 17 different distortions and 4 intensities per distortion.
17
- In total there are 1700 (reference, distortion, MOS) tuples.
18
- """
19
-
20
- _HOMEPAGE = "https://www.ponomarenko.info/tid2008.htm"
21
-
22
- # _LICENSE = ""
23
-
24
-
25
- class TID2008(datasets.GeneratorBasedBuilder):
26
- """TID2008 Image Quality Dataset"""
27
-
28
- VERSION = datasets.Version("1.0.0")
29
-
30
- def _info(self):
31
- # TODO: This method specifies the datasets.DatasetInfo object which contains informations and typings for the dataset
32
- features = datasets.Features(
33
- {
34
- "reference": datasets.Image(),
35
- "distorted": datasets.Image(),
36
- "mos": datasets.Value("float"),
37
- }
38
- )
39
- return datasets.DatasetInfo(
40
- description=_DESCRIPTION,
41
- features=features,
42
- # supervised_keys=("reference", "distorted", "mos"),
43
- homepage=_HOMEPAGE,
44
- # license=_LICENSE,
45
- citation=_CITATION,
46
- )
47
-
48
- def _split_generators(self, dl_manager):
49
- data_path = dl_manager.download("data.zip")
50
-
51
- return [
52
- datasets.SplitGenerator(
53
- name=datasets.Split.TRAIN,
54
- gen_kwargs={
55
- "data": dl_manager.download_and_extract(data_path),
56
- "split": "train",
57
- },
58
- )
59
- ]
60
-
61
- # method parameters are unpacked from `gen_kwargs` as given in `_split_generators`
62
- def _generate_examples(self, data, split):
63
- df = pd.read_csv(os.path.join(data, "image_pairs_mos.csv"), index_col=0)
64
- reference_paths = (
65
- df["Reference"]
66
- .apply(lambda x: os.path.join(data, "reference_images", x))
67
- .to_list()
68
- )
69
- distorted_paths = (
70
- df["Distorted"]
71
- .apply(lambda x: os.path.join(data, "distorted_images", x))
72
- .to_list()
73
- )
74
-
75
- for key, (ref, dist, m) in enumerate(
76
- zip(reference_paths, distorted_paths, df["MOS"])
77
- ):
78
- yield (
79
- key,
80
- {
81
- "reference": ref,
82
- "distorted": dist,
83
- "mos": m,
84
- },
85
- )
86
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
data.zip DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:c048c69418cb0146fe8363f637a35e16623ca6ce25a8b6bfcdd9fb47e85ecaf6
3
- size 704640392