PierreBrunelle commited on
Commit
258f1d6
·
verified ·
1 Parent(s): cd1a88f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -6
app.py CHANGED
@@ -10,7 +10,7 @@ install("pixeltable==0.2.20")
10
  install("git+https://github.com/Megvii-BaseDetection/YOLOX.git")
11
 
12
  import gradio as gr
13
- from gradio.themes import Soft
14
  import pixeltable as pxt
15
  from pixeltable.iterators import FrameIterator
16
  from pixeltable.ext.functions.yolox import yolox
@@ -79,7 +79,7 @@ def process_video(video_file, model_id, threshold, progress=gr.Progress()):
79
  return output_video, frame_gallery
80
 
81
  # Gradio interface
82
- with gr.Blocks(theme=Soft()) as demo:
83
  gr.Markdown(
84
  """
85
  <div max-width: 800px; margin: 0 auto;">
@@ -140,12 +140,15 @@ with gr.Blocks(theme=Soft()) as demo:
140
 
141
  # Button to trigger file processing
142
  process_button = gr.Button("Process Video")
143
-
144
- with gr.Row():
145
- output_video = gr.Video(label="Processed Video with Detections")
146
 
147
  with gr.Row():
148
- frame_gallery = gr.Gallery(label="Frame Gallery", show_label=True, elem_id="gallery")
 
 
 
 
 
 
149
 
150
  process_button.click(
151
  process_video,
 
10
  install("git+https://github.com/Megvii-BaseDetection/YOLOX.git")
11
 
12
  import gradio as gr
13
+ from gradio.themes import Glass
14
  import pixeltable as pxt
15
  from pixeltable.iterators import FrameIterator
16
  from pixeltable.ext.functions.yolox import yolox
 
79
  return output_video, frame_gallery
80
 
81
  # Gradio interface
82
+ with gr.Blocks(theme=Glass()) as demo:
83
  gr.Markdown(
84
  """
85
  <div max-width: 800px; margin: 0 auto;">
 
140
 
141
  # Button to trigger file processing
142
  process_button = gr.Button("Process Video")
 
 
 
143
 
144
  with gr.Row():
145
+ # Left column for video output
146
+ with gr.Column(scale=1):
147
+ output_video = gr.Video(label="Processed Video with Detections")
148
+
149
+ # Right column for frame gallery
150
+ with gr.Column(scale=1):
151
+ frame_gallery = gr.Gallery(label="Frame Gallery", show_label=True, elem_id="gallery").style(grid=[2], height="auto")
152
 
153
  process_button.click(
154
  process_video,