atnikos commited on
Commit
0d73e2a
·
1 Parent(s): b51fddd

layout changes

Browse files
Files changed (2) hide show
  1. app.py +61 -39
  2. style.css +22 -1
app.py CHANGED
@@ -227,61 +227,83 @@ def retrieve_video(retrieve_text):
227
  text_annot = all_mots[top_mot]['annotation']
228
  return curvid, text_annot
229
 
230
-
231
- with gr.Blocks(css="style.css") as demo:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
232
  gr.Markdown(WEBSITE)
233
 
234
- with gr.Row():
235
- with gr.Column(scale=7):
236
  gr.Markdown(WEB_source)
237
- with gr.Row():
238
- iterative_button = gr.Button("Iterative", scale=0)
239
- retrieve_button = gr.Button("TMRetrieve", scale=0)
240
- random_button = gr.Button("Random", scale=0)
241
- clear_button_retrieval = gr.Button("Clear",
242
- scale=0)
243
-
244
- with gr.Row():
245
- retrieve_text = gr.Textbox(placeholder="Type the text for the motion you want to Retrieve:",
246
- show_label=True, label="Retrieval Text",
247
- value=DEFAULT_TEXT, scale=5)
248
- # clear_button_retrieval = gr.Button("Clear Retrieval Text",
249
- # scale=1)
250
-
251
- with gr.Row():
252
  suggested_edit_text = gr.Textbox(placeholder="Texts likely to edit the motion:",
253
- show_label=True, label="Suggested Edit Text",
254
- value='', scale=1)
 
255
  xxx = 'https://motion-editing.s3.eu-central-1.amazonaws.com/collection_wo_walks_runs/rendered_pairs/011327_120_240-002682_120_240.mp4'
256
  set_to_pick = gr.Radio(['all', 'train', 'test'],
257
  value='all',
258
  label="Set to pick from",
259
  info="Motion will be picked from whole dataset or test or train data.")
260
- # Number of videos to retrieve --> Not Supported YET.
261
- # how_many_videos = gr.Radio([1, 3, 5, 7],
262
- # value=3,
263
- # label="# Videos",
264
- # info="# Videos to be retrieved in each case.")
265
 
266
  retrieved_video_output = gr.Video(label="Retrieved Motion",
267
  value=xxx,
268
  height=360, width=480)
269
 
270
- with gr.Column(scale=5):
271
  gr.Markdown(WEB_target)
272
- with gr.Row():
273
-
274
- input_text = gr.Textbox(placeholder="Type the edit text you want:",
275
- show_label=False, label="Input Text",
276
- value=DEFAULT_TEXT, scale=1)
277
- # with gr.Column(scale=1):
278
- edit_button = gr.Button("Edit", scale=0)
279
  clear_button_edit = gr.Button("Clear", scale=0)
280
- # input_text = gr.Textbox(placeholder="Type the edit text you want:",
281
- # show_label=False, label="Input Text",
282
- # value=DEFAULT_TEXT, scale=10)
283
- # edit_button = gr.Button("Edit")
284
- # clear_button_edit = gr.Button("Clear Edit Text")
 
 
285
  video_output = gr.Video(label="Generated Video", height=360,
286
  width=480)
287
 
 
227
  text_annot = all_mots[top_mot]['annotation']
228
  return curvid, text_annot
229
 
230
+ with gr.Blocks(css="""
231
+ .gradio-row {
232
+ display: flex;
233
+ gap: 20px;
234
+ }
235
+ .gradio-column {
236
+ flex: 1;
237
+ }
238
+ .gradio-container {
239
+ display: flex;
240
+ flex-direction: column;
241
+ gap: 10px;
242
+ }
243
+ .gradio-button-row {
244
+ display: flex;
245
+ gap: 10px;
246
+ }
247
+ .gradio-textbox-row {
248
+ display: flex;
249
+ gap: 10px;
250
+ align-items: center;
251
+ }
252
+ .gradio-edit-row {
253
+ gap: 10px;
254
+ align-items: center;
255
+ }
256
+ .gradio-textbox-with-button {
257
+ display: flex;
258
+ align-items: center;
259
+ }
260
+ .gradio-textbox-with-button input {
261
+ flex-grow: 1;
262
+ }
263
+ """) as demo:
264
  gr.Markdown(WEBSITE)
265
 
266
+ with gr.Row(elem_id="gradio-row"):
267
+ with gr.Column(scale=7, elem_id="gradio-column"):
268
  gr.Markdown(WEB_source)
269
+ with gr.Row(elem_id="gradio-button-row"):
270
+ iterative_button = gr.Button("Iterative")
271
+ retrieve_button = gr.Button("TMRetrieve")
272
+ random_button = gr.Button("Random")
273
+
274
+ with gr.Row(elem_id="gradio-textbox-row"):
275
+ with gr.Column(scale=5, elem_id="gradio-textbox-with-button"):
276
+ retrieve_text = gr.Textbox(placeholder="Type the text for the motion you want to Retrieve:",
277
+ show_label=True, label="Retrieval Text",
278
+ value=DEFAULT_TEXT)
279
+ clear_button_retrieval = gr.Button("Clear", scale=0)
280
+
281
+ with gr.Row(elem_id="gradio-textbox-row"):
 
 
282
  suggested_edit_text = gr.Textbox(placeholder="Texts likely to edit the motion:",
283
+ show_label=True, label="Suggested Edit Text",
284
+ value='')
285
+
286
  xxx = 'https://motion-editing.s3.eu-central-1.amazonaws.com/collection_wo_walks_runs/rendered_pairs/011327_120_240-002682_120_240.mp4'
287
  set_to_pick = gr.Radio(['all', 'train', 'test'],
288
  value='all',
289
  label="Set to pick from",
290
  info="Motion will be picked from whole dataset or test or train data.")
 
 
 
 
 
291
 
292
  retrieved_video_output = gr.Video(label="Retrieved Motion",
293
  value=xxx,
294
  height=360, width=480)
295
 
296
+ with gr.Column(scale=5, elem_id="gradio-column"):
297
  gr.Markdown(WEB_target)
298
+ with gr.Row(elem_id="gradio-edit-row"):
 
 
 
 
 
 
299
  clear_button_edit = gr.Button("Clear", scale=0)
300
+ edit_button = gr.Button("Edit", scale=0)
301
+
302
+ with gr.Row(elem_id="gradio-textbox-row"):
303
+ input_text = gr.Textbox(placeholder="Type the edit text you want:",
304
+ show_label=False, label="Input Text",
305
+ value=DEFAULT_TEXT)
306
+
307
  video_output = gr.Video(label="Generated Video", height=360,
308
  width=480)
309
 
style.css CHANGED
@@ -2,4 +2,25 @@
2
  #center-column {
3
  display: flex;
4
  justify-content: center;
5
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  #center-column {
3
  display: flex;
4
  justify-content: center;
5
+ }
6
+ .gradio-row {
7
+ display: flex;
8
+ gap: 20px;
9
+ }
10
+ .gradio-column {
11
+ flex: 1;
12
+ }
13
+ .gradio-container {
14
+ display: flex;
15
+ flex-direction: column;
16
+ gap: 10px;
17
+ }
18
+ .gradio-button-row {
19
+ display: flex;
20
+ gap: 10px;
21
+ }
22
+ .gradio-textbox-row {
23
+ display: flex;
24
+ gap: 10px;
25
+ align-items: center;
26
+ }