tid13 mode
#7
by
Rietta5
- opened
Databases_IlluminantChanges.py
CHANGED
|
@@ -54,9 +54,9 @@ class Databases_IlluminantChanges(datasets.GeneratorBasedBuilder):
|
|
| 54 |
data_url=f"./Imagenet.zip",
|
| 55 |
),
|
| 56 |
IlluminantConfig(
|
| 57 |
-
name="
|
| 58 |
-
description="
|
| 59 |
-
data_url=f"./
|
| 60 |
),
|
| 61 |
]
|
| 62 |
|
|
@@ -82,7 +82,7 @@ class Databases_IlluminantChanges(datasets.GeneratorBasedBuilder):
|
|
| 82 |
def _split_generators(self, dl_manager):
|
| 83 |
|
| 84 |
archive_path = dl_manager.download(self.config.data_url)
|
| 85 |
-
|
| 86 |
return [
|
| 87 |
datasets.SplitGenerator(
|
| 88 |
name=datasets.Split.TRAIN,
|
|
@@ -100,10 +100,10 @@ class Databases_IlluminantChanges(datasets.GeneratorBasedBuilder):
|
|
| 100 |
illum_paths = [os.path.join(illum_path, p) for p in os.listdir(illum_path)]
|
| 101 |
|
| 102 |
## Get the correct desat image for each illum image
|
| 103 |
-
img_numbers = [re.findall("
|
| 104 |
desat_paths = [os.path.join(desat_path, f"im_orig_desat{n}.png") for n in img_numbers]
|
| 105 |
|
| 106 |
-
|
| 107 |
for key, (desat, illum) in enumerate(zip(desat_paths, illum_paths)):
|
| 108 |
yield key, {
|
| 109 |
"reference": desat,
|
|
|
|
| 54 |
data_url=f"./Imagenet.zip",
|
| 55 |
),
|
| 56 |
IlluminantConfig(
|
| 57 |
+
name="TID2013",
|
| 58 |
+
description="TID2013 data",
|
| 59 |
+
data_url=f"./TID2013.zip",
|
| 60 |
),
|
| 61 |
]
|
| 62 |
|
|
|
|
| 82 |
def _split_generators(self, dl_manager):
|
| 83 |
|
| 84 |
archive_path = dl_manager.download(self.config.data_url)
|
| 85 |
+
print(f"Data url: {self.config.data_url} | {archive_path}")
|
| 86 |
return [
|
| 87 |
datasets.SplitGenerator(
|
| 88 |
name=datasets.Split.TRAIN,
|
|
|
|
| 100 |
illum_paths = [os.path.join(illum_path, p) for p in os.listdir(illum_path)]
|
| 101 |
|
| 102 |
## Get the correct desat image for each illum image
|
| 103 |
+
img_numbers = [re.findall("\d+", p)[0] for p in illum_paths]
|
| 104 |
desat_paths = [os.path.join(desat_path, f"im_orig_desat{n}.png") for n in img_numbers]
|
| 105 |
|
| 106 |
+
print(desat_paths[0], illum_paths[0])
|
| 107 |
for key, (desat, illum) in enumerate(zip(desat_paths, illum_paths)):
|
| 108 |
yield key, {
|
| 109 |
"reference": desat,
|