Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -9,7 +9,6 @@ from PIL import Image
|
|
9 |
from torchmetrics.functional.image import structural_similarity_index_measure as ssim
|
10 |
from transformers import CLIPModel, CLIPProcessor
|
11 |
|
12 |
-
|
13 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
14 |
model_path = "czl/stable-diffusion-v1-5"
|
15 |
clip_model = CLIPModel.from_pretrained("openai/clip-vit-large-patch14").to(device)
|
@@ -32,7 +31,6 @@ else:
|
|
32 |
MAX_SEED = np.iinfo(np.int32).max
|
33 |
MAX_IMAGE_SIZE = 1024
|
34 |
|
35 |
-
|
36 |
@spaces.GPU
|
37 |
def infer(
|
38 |
input_image,
|
@@ -163,7 +161,7 @@ with gr.Blocks(title="Generative Date Augmentation Demo") as demo:
|
|
163 |
label="Prompt for the image to synthesize. (Actual class)",
|
164 |
show_label=True,
|
165 |
max_lines=1,
|
166 |
-
placeholder="Enter
|
167 |
container=False,
|
168 |
)
|
169 |
with gr.Row():
|
@@ -171,7 +169,7 @@ with gr.Blocks(title="Generative Date Augmentation Demo") as demo:
|
|
171 |
label="Prompt to augment against. (Confusing class)",
|
172 |
show_label=True,
|
173 |
max_lines=1,
|
174 |
-
placeholder="Enter
|
175 |
container=False,
|
176 |
)
|
177 |
with gr.Row():
|
|
|
9 |
from torchmetrics.functional.image import structural_similarity_index_measure as ssim
|
10 |
from transformers import CLIPModel, CLIPProcessor
|
11 |
|
|
|
12 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
13 |
model_path = "czl/stable-diffusion-v1-5"
|
14 |
clip_model = CLIPModel.from_pretrained("openai/clip-vit-large-patch14").to(device)
|
|
|
31 |
MAX_SEED = np.iinfo(np.int32).max
|
32 |
MAX_IMAGE_SIZE = 1024
|
33 |
|
|
|
34 |
@spaces.GPU
|
35 |
def infer(
|
36 |
input_image,
|
|
|
161 |
label="Prompt for the image to synthesize. (Actual class)",
|
162 |
show_label=True,
|
163 |
max_lines=1,
|
164 |
+
placeholder="Enter actual class",
|
165 |
container=False,
|
166 |
)
|
167 |
with gr.Row():
|
|
|
169 |
label="Prompt to augment against. (Confusing class)",
|
170 |
show_label=True,
|
171 |
max_lines=1,
|
172 |
+
placeholder="Enter confusing class",
|
173 |
container=False,
|
174 |
)
|
175 |
with gr.Row():
|