Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -173,6 +173,15 @@ def get_concat(ims):
|
|
173 |
return dst
|
174 |
|
175 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
176 |
def generate(unet, vae, tokenizer, text_encoder, language_instruction, grounding_texts, sketch_pad,
|
177 |
loss_threshold, guidance_scale, batch_size, rand_seed, max_step, loss_scale, max_iter,
|
178 |
state):
|
@@ -507,7 +516,7 @@ def main():
|
|
507 |
queue=False)
|
508 |
|
509 |
gen_btn.click(
|
510 |
-
fn=partial(
|
511 |
inputs=[
|
512 |
language_instruction, grounding_instruction, sketch_pad,
|
513 |
loss_threshold, guidance_scale, batch_size, rand_seed,
|
|
|
173 |
return dst
|
174 |
|
175 |
|
176 |
+
def click_on_display(state):
|
177 |
+
if 'boxes' not in state:
|
178 |
+
state['boxes'] = []
|
179 |
+
boxes = state['boxes']
|
180 |
+
x = Image.open('./images/dog.png')
|
181 |
+
gen_images = [gr.Image.update(value=x, visible=True)]
|
182 |
+
|
183 |
+
return gen_images, state
|
184 |
+
|
185 |
def generate(unet, vae, tokenizer, text_encoder, language_instruction, grounding_texts, sketch_pad,
|
186 |
loss_threshold, guidance_scale, batch_size, rand_seed, max_step, loss_scale, max_iter,
|
187 |
state):
|
|
|
516 |
queue=False)
|
517 |
|
518 |
gen_btn.click(
|
519 |
+
fn=partial(click_on_display),
|
520 |
inputs=[
|
521 |
language_instruction, grounding_instruction, sketch_pad,
|
522 |
loss_threshold, guidance_scale, batch_size, rand_seed,
|