Update demo.py
Browse files
demo.py
CHANGED
@@ -80,7 +80,8 @@ def experiment_to_dict(experiment, skip=False):
|
|
80 |
return info
|
81 |
|
82 |
def generate_new_experiment() -> Experiment:
|
83 |
-
|
|
|
84 |
image_id = random.choice(list(corruption.glob("*")))
|
85 |
imgs_to_sample = (NUMBER_OF_IMAGES_PER_ROW * NUMBER_OF_ROWS) // 2
|
86 |
|
|
|
80 |
return info
|
81 |
|
82 |
def generate_new_experiment() -> Experiment:
|
83 |
+
wanted_corruptions = ["spatter", "impulse_noise", "speckle_noise", "gaussian_noise", "pixelate", "jpeg_compression"]
|
84 |
+
corruption = random.choice([f for f in list(Path(f"./images/{DATASET}").glob("*/*")) if f.is_dir() and f.name in wanted_corruptions)
|
85 |
image_id = random.choice(list(corruption.glob("*")))
|
86 |
imgs_to_sample = (NUMBER_OF_IMAGES_PER_ROW * NUMBER_OF_ROWS) // 2
|
87 |
|