VIVEK JAYARAM
commited on
Commit
·
83e40e0
1
Parent(s):
235a140
Added lsun church
Browse files
app.py
CHANGED
@@ -43,6 +43,7 @@ def process_image(image_choice, noise_sigma, operator_key, T, K):
|
|
43 |
global model, ddim_scheduler, model_type
|
44 |
if model is None:
|
45 |
model_type = "diffusers"
|
|
|
46 |
model = DiffusionPipeline.from_pretrained("google/ddpm-celebahq-256").to(device).unet
|
47 |
ddim_scheduler = DDIMScheduler(
|
48 |
num_train_timesteps=1000,
|
@@ -54,7 +55,8 @@ def process_image(image_choice, noise_sigma, operator_key, T, K):
|
|
54 |
image_paths = {
|
55 |
"CelebA HQ 1": "sample_images/celebhq_29999.jpg",
|
56 |
"CelebA HQ 2": "sample_images/celebhq_00001.jpg",
|
57 |
-
"CelebA HQ 3": "sample_images/celebhq_00000.jpg"
|
|
|
58 |
}
|
59 |
|
60 |
config_paths = {
|
@@ -99,7 +101,7 @@ with gr.Blocks() as demo:
|
|
99 |
noise_sigma = gr.Slider(0, 0.6, value=0.05, step=0.01, label="Noise Sigma")
|
100 |
|
101 |
image_select = gr.Dropdown(
|
102 |
-
choices=["CelebA HQ 1", "CelebA HQ 2", "CelebA HQ 3"],
|
103 |
value="CelebA HQ 1",
|
104 |
label="Select Input Image"
|
105 |
)
|
|
|
43 |
global model, ddim_scheduler, model_type
|
44 |
if model is None:
|
45 |
model_type = "diffusers"
|
46 |
+
model_name = "google/ddpm-celebahq-256" if "Celeb" in image_choice else "google/ddpm-curch-256"
|
47 |
model = DiffusionPipeline.from_pretrained("google/ddpm-celebahq-256").to(device).unet
|
48 |
ddim_scheduler = DDIMScheduler(
|
49 |
num_train_timesteps=1000,
|
|
|
55 |
image_paths = {
|
56 |
"CelebA HQ 1": "sample_images/celebhq_29999.jpg",
|
57 |
"CelebA HQ 2": "sample_images/celebhq_00001.jpg",
|
58 |
+
"CelebA HQ 3": "sample_images/celebhq_00000.jpg",
|
59 |
+
"LSUN Church": "sample_images/lsun_church.png"
|
60 |
}
|
61 |
|
62 |
config_paths = {
|
|
|
101 |
noise_sigma = gr.Slider(0, 0.6, value=0.05, step=0.01, label="Noise Sigma")
|
102 |
|
103 |
image_select = gr.Dropdown(
|
104 |
+
choices=["CelebA HQ 1", "CelebA HQ 2", "CelebA HQ 3", "LSUN Church"],
|
105 |
value="CelebA HQ 1",
|
106 |
label="Select Input Image"
|
107 |
)
|