downloading imgs
Browse files- TID2008.py +17 -6
TID2008.py
CHANGED
|
@@ -68,17 +68,28 @@ class TID2008(datasets.GeneratorBasedBuilder):
|
|
| 68 |
# print(kk)
|
| 69 |
|
| 70 |
root_path = "/".join(data_path.split("/")[:-1])
|
| 71 |
-
reference_path = dl_manager.download("reference_images")
|
| 72 |
-
distorted_path = dl_manager.download("distorted_images")
|
| 73 |
|
| 74 |
-
|
| 75 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 76 |
return [
|
| 77 |
datasets.SplitGenerator(
|
| 78 |
name=datasets.Split.TRAIN,
|
| 79 |
gen_kwargs={
|
| 80 |
-
"reference": data["Reference"],
|
| 81 |
-
"distorted": data["Distorted"],
|
|
|
|
|
|
|
| 82 |
"mos": data["MOS"],
|
| 83 |
"split": "train",
|
| 84 |
},
|
|
|
|
| 68 |
# print(kk)
|
| 69 |
|
| 70 |
root_path = "/".join(data_path.split("/")[:-1])
|
| 71 |
+
# reference_path = dl_manager.download("reference_images")
|
| 72 |
+
# distorted_path = dl_manager.download("distorted_images")
|
| 73 |
|
| 74 |
+
reference_paths = data["Reference"].apply(lambda x: os.path.join("reference_images", x))
|
| 75 |
+
distorted_paths = data["Distorted"].apply(lambda x: os.path.join("distorted_images", x))
|
| 76 |
+
|
| 77 |
+
reference_paths = dl_manager.download(reference_paths)
|
| 78 |
+
distorted_paths = dl_manager.download(distorted_paths)
|
| 79 |
+
|
| 80 |
+
# dl_manager.download(data["Reference"])
|
| 81 |
+
|
| 82 |
+
# data["Reference"] = data["Reference"].apply(lambda x: os.path.join(reference_path, x))
|
| 83 |
+
# data["Distorted"] = data["Distorted"].apply(lambda x: os.path.join(distorted_path, x))
|
| 84 |
+
|
| 85 |
return [
|
| 86 |
datasets.SplitGenerator(
|
| 87 |
name=datasets.Split.TRAIN,
|
| 88 |
gen_kwargs={
|
| 89 |
+
# "reference": data["Reference"],
|
| 90 |
+
# "distorted": data["Distorted"],
|
| 91 |
+
"reference": reference_paths,
|
| 92 |
+
"distorted": distorted_paths,
|
| 93 |
"mos": data["MOS"],
|
| 94 |
"split": "train",
|
| 95 |
},
|