linoyts HF Staff commited on
Commit
cd99776
Β·
verified Β·
1 Parent(s): 0fdc043

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +32 -6
app.py CHANGED
@@ -275,7 +275,22 @@ css = """
275
  max-width: 960px;
276
  }
277
  """
278
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
279
  with gr.Blocks(css=css) as demo:
280
  gr.Markdown(f"""# IP Composer πŸŒ…βœšπŸ–ŒοΈ
281
  ### compose new images with visual concepts
@@ -292,19 +307,26 @@ following the algorithm proposed in [*IP-Composer: Semantic Composition of Visua
292
  with gr.Row():
293
  with gr.Column():
294
  base_image = gr.Image(label="Base Image (Required)", type="numpy")
295
- with gr.Tab("concept 1"):
296
- with gr.Row():
297
  with gr.Group():
298
  concept_image1 = gr.Image(label="Concept Image 1", type="numpy")
299
  concept_name1 = gr.Dropdown(concept_options, label="concept 1", value=None, info="concept type")
300
- gr.Markdown("πŸ’‘ you can use a new concept by uploading a txt/csv file with text variations of your concept")
 
 
 
 
301
  concept_file_1 = gr.File(label="concept variations", file_types=["text"])
302
 
303
  with gr.Tab("concept 2 - optional"):
304
  with gr.Group():
305
  concept_image2 = gr.Image(label="Concept Image 2", type="numpy")
306
  concept_name2 = gr.Dropdown(concept_options, label="concept 2", value=None, info="concept type")
307
- gr.Markdown("πŸ’‘ you can use a new concept by uploading a txt/csv file with text variations of your concept")
 
 
 
 
308
  concept_file_2 = gr.File(label="concept variations", file_types=["text"])
309
 
310
 
@@ -312,7 +334,11 @@ following the algorithm proposed in [*IP-Composer: Semantic Composition of Visua
312
  with gr.Group():
313
  concept_image3 = gr.Image(label="Concept Image 3", type="numpy")
314
  concept_name3 = gr.Dropdown(concept_options, label="concept 3", value= None, info="concept type")
315
- gr.Markdown("πŸ’‘ you can use a new concept by uploading a txt/csv file with text variations of your concept")
 
 
 
 
316
  concept_file_3 = gr.File(label="concept variations", file_types=["text"])
317
 
318
 
 
275
  max-width: 960px;
276
  }
277
  """
278
+ example = """
279
+ Emotion Description
280
+ a photo of a person feeling joyful
281
+ a photo of a person feeling sorrowful
282
+ a photo of a person feeling enraged
283
+ a photo of a person feeling astonished
284
+ a photo of a person feeling disgusted
285
+ a photo of a person feeling terrified
286
+ a photo of a person feeling thrilled
287
+ a photo of a person feeling nervous
288
+ a photo of a person feeling tranquil
289
+ a photo of a person feeling perplexed
290
+ a photo of a person feeling resolute
291
+ ...
292
+
293
+ """
294
  with gr.Blocks(css=css) as demo:
295
  gr.Markdown(f"""# IP Composer πŸŒ…βœšπŸ–ŒοΈ
296
  ### compose new images with visual concepts
 
307
  with gr.Row():
308
  with gr.Column():
309
  base_image = gr.Image(label="Base Image (Required)", type="numpy")
310
+ with gr.Tab("concept 1"):
 
311
  with gr.Group():
312
  concept_image1 = gr.Image(label="Concept Image 1", type="numpy")
313
  concept_name1 = gr.Dropdown(concept_options, label="concept 1", value=None, info="concept type")
314
+ gr.Markdown("πŸ’‘ add a new concept πŸ‘‡")
315
+ with gr.Accordion("example + instrcutions", open=False):
316
+ gr.Markdown("1. upload a file with text variations of your concept (e.g. ask an LLM)")
317
+ gr.Markdown("2. prefereably with > 100 variations. see file example for the concept 'emotions': ")
318
+ gr.Markdown(example)
319
  concept_file_1 = gr.File(label="concept variations", file_types=["text"])
320
 
321
  with gr.Tab("concept 2 - optional"):
322
  with gr.Group():
323
  concept_image2 = gr.Image(label="Concept Image 2", type="numpy")
324
  concept_name2 = gr.Dropdown(concept_options, label="concept 2", value=None, info="concept type")
325
+ gr.Markdown("πŸ’‘ add a new concept πŸ‘‡")
326
+ with gr.Accordion("example + instrcutions", open=False):
327
+ gr.Markdown("1. upload a file with text variations of your concept (e.g. ask an LLM)")
328
+ gr.Markdown("2. prefereably with > 100 variations. see file example for the concept 'emotions': ")
329
+ gr.Markdown(example)
330
  concept_file_2 = gr.File(label="concept variations", file_types=["text"])
331
 
332
 
 
334
  with gr.Group():
335
  concept_image3 = gr.Image(label="Concept Image 3", type="numpy")
336
  concept_name3 = gr.Dropdown(concept_options, label="concept 3", value= None, info="concept type")
337
+ gr.Markdown("πŸ’‘ add a new concept πŸ‘‡")
338
+ with gr.Accordion("example + instrcutions", open=False):
339
+ gr.Markdown("1. upload a file with text variations of your concept (e.g. ask an LLM)")
340
+ gr.Markdown("2. prefereably with > 100 variations. see file example for the concept 'emotions': ")
341
+ gr.Markdown(example)
342
  concept_file_3 = gr.File(label="concept variations", file_types=["text"])
343
 
344