tomerk commited on
Commit
4e3189d
·
verified ·
1 Parent(s): 72440bc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -10
app.py CHANGED
@@ -180,9 +180,10 @@ def process_clip_from_file(prompt, frames, chatbot, fps, video_path, id):
180
  return chatbot
181
 
182
  # Function to capture video frames
183
- def analyze_stream(prompt, stream, chatbot):
184
  global stop_capture
185
  stop_capture = False
 
186
 
187
 
188
  cap = cv2.VideoCapture(stream or WEBCAM)
@@ -255,14 +256,11 @@ def stop_capture_func():
255
 
256
  # Gradio interface
257
  with gr.Blocks(title="Conntour", fill_height=True) as demo:
258
- with gr.Row():
259
- stream = "https://streamapi2.eu.loclx.io/video_feed/101"
260
- with gr.Column():
261
- chatbot = gr.Chatbot(label="Events", bubble_full_width=False, avatar_images=AVATARS)
262
- prompt = gr.Textbox(label="Enter your prompt alert")
263
- start_btn = gr.Button("Start")
264
- stop_btn = gr.Button("Stop")
265
- start_btn.click(analyze_stream, inputs=[prompt, stream, chatbot], outputs=[chatbot], queue=True)
266
- stop_btn.click(stop_capture_func)
267
 
268
  demo.launch(favicon_path='favicon.ico', auth=(user_name, password))
 
180
  return chatbot
181
 
182
  # Function to capture video frames
183
+ def analyze_stream(prompt, chatbot):
184
  global stop_capture
185
  stop_capture = False
186
+ stream = "https://streamapi2.eu.loclx.io/video_feed/101"
187
 
188
 
189
  cap = cv2.VideoCapture(stream or WEBCAM)
 
256
 
257
  # Gradio interface
258
  with gr.Blocks(title="Conntour", fill_height=True) as demo:
259
+ chatbot = gr.Chatbot(label="Events", bubble_full_width=False, avatar_images=AVATARS)
260
+ prompt = gr.Textbox(label="Enter your prompt alert")
261
+ start_btn = gr.Button("Start")
262
+ stop_btn = gr.Button("Stop")
263
+ start_btn.click(analyze_stream, inputs=[prompt, chatbot], outputs=[chatbot], queue=True)
264
+ stop_btn.click(stop_capture_func)
 
 
 
265
 
266
  demo.launch(favicon_path='favicon.ico', auth=(user_name, password))