linoyts HF Staff commited on
Commit
e96f400
·
verified ·
1 Parent(s): 47154ea
Files changed (1) hide show
  1. app.py +18 -25
app.py CHANGED
@@ -34,7 +34,7 @@ clip_model.to(device)
34
 
35
  CONCEPTS_MAP={
36
  "age": "age_descriptions.npy",
37
- "animal_fur": "fur_descriptions.npy",
38
  "dogs": "dog_descriptions.npy",
39
  "emotions": "emotion_descriptions.npy",
40
  "flowers": "flower_descriptions.npy",
@@ -197,27 +197,21 @@ following the algorithm proposed in [*IP-Composer: Semantic Composition of Visua
197
  with gr.Row():
198
  with gr.Column():
199
  base_image = gr.Image(label="Base Image (Required)", type="numpy")
200
-
201
- with gr.Row():
202
- with gr.Column(scale=2):
203
- concept_image1 = gr.Image(label="Concept Image 1 (Required)", type="numpy")
204
- with gr.Row():
205
- concept_name1 = gr.Dropdown(concept_options, label="concept 1", value=None, info="concept type")
206
- rank1 = gr.Slider(minimum=1, maximum=50, value=30, step=1, label="Rank 1")
207
-
208
- with gr.Row():
209
- with gr.Column(scale=2):
210
- concept_image2 = gr.Image(label="Concept Image 2 (Optional)", type="numpy")
211
- with gr.Row():
212
- concept_name2 = gr.Dropdown(concept_options, label="concept 2", value=None, info="concept type")
213
- rank2 = gr.Slider(minimum=1, maximum=50, value=30, step=1, label="Rank 2")
214
-
215
- with gr.Row():
216
- with gr.Column(scale=2):
217
- concept_image3 = gr.Image(label="Concept Image 3 (Optional)", type="numpy")
218
- with gr.Row():
219
- concept_name3 = gr.Dropdown(concept_options, label="concept 3", value= None, info="concept type")
220
- rank3 = gr.Slider(minimum=1, maximum=50, value=30, step=1, label="Rank 3")
221
 
222
  submit_btn = gr.Button("Generate")
223
 
@@ -226,13 +220,12 @@ following the algorithm proposed in [*IP-Composer: Semantic Composition of Visua
226
  with gr.Row():
227
  scale = gr.Slider(minimum=0.1, maximum=2.0, value=1.0, step=0.1, label="Scale")
228
  randomize_seed = gr.Checkbox(value=True, label="Randomize seed")
229
- seed = gr.Number(value=0, label="Seed", precision=0)
230
-
231
-
232
 
233
  with gr.Column():
234
  output_image = gr.Image(label="composed output", show_label=True)
235
 
 
236
  submit_btn.click(
237
  fn=randomize_seed_fn,
238
  inputs=[seed, randomize_seed],
 
34
 
35
  CONCEPTS_MAP={
36
  "age": "age_descriptions.npy",
37
+ "animal fur": "fur_descriptions.npy",
38
  "dogs": "dog_descriptions.npy",
39
  "emotions": "emotion_descriptions.npy",
40
  "flowers": "flower_descriptions.npy",
 
197
  with gr.Row():
198
  with gr.Column():
199
  base_image = gr.Image(label="Base Image (Required)", type="numpy")
200
+ with gr.Tab("concepts"):
201
+ with gr.Row():
202
+ with gr.Group():
203
+ concept_image1 = gr.Image(label="Concept Image 1 (Required)", type="numpy")
204
+ concept_name1 = gr.Dropdown(concept_options, label="concept 1", value=None, info="concept type")
205
+ rank1 = gr.Slider(minimum=1, maximum=50, value=30, step=1, label="Rank 1")
206
+ with gr.Group():
207
+ concept_image2 = gr.Image(label="Concept Image 2 (Optional)", type="numpy")
208
+ concept_name2 = gr.Dropdown(concept_options, label="concept 2", value=None, info="concept type")
209
+ rank2 = gr.Slider(minimum=1, maximum=50, value=30, step=1, label="Rank 2")
210
+ with gr.Tab("optional - 3rd concept"):
211
+ with gr.Group():
212
+ concept_image3 = gr.Image(label="Concept Image 3 (Optional)", type="numpy")
213
+ concept_name3 = gr.Dropdown(concept_options, label="concept 3", value= None, info="concept type")
214
+ rank3 = gr.Slider(minimum=1, maximum=50, value=30, step=1, label="Rank 3")
 
 
 
 
 
 
215
 
216
  submit_btn = gr.Button("Generate")
217
 
 
220
  with gr.Row():
221
  scale = gr.Slider(minimum=0.1, maximum=2.0, value=1.0, step=0.1, label="Scale")
222
  randomize_seed = gr.Checkbox(value=True, label="Randomize seed")
223
+ seed = gr.Number(value=0, label="Seed", precision=0)
 
 
224
 
225
  with gr.Column():
226
  output_image = gr.Image(label="composed output", show_label=True)
227
 
228
+
229
  submit_btn.click(
230
  fn=randomize_seed_fn,
231
  inputs=[seed, randomize_seed],