Pratyush101 commited on
Commit
404f107
·
verified ·
1 Parent(s): 278c7fd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -0
app.py CHANGED
@@ -57,6 +57,18 @@ webrtc_ctx = webrtc_streamer(
57
  media_stream_constraints={"video": True, "audio": False},
58
  async_processing=True,
59
  )
 
 
 
 
 
 
 
 
 
 
 
 
60
 
61
  # Output text display
62
  st.subheader("Output Text")
 
57
  media_stream_constraints={"video": True, "audio": False},
58
  async_processing=True,
59
  )
60
+ if st.checkbox("Show the detected labels", value=True):
61
+ if webrtc_ctx.state.playing:
62
+ labels_placeholder = st.empty()
63
+ # NOTE: The video transformation with object detection and
64
+ # this loop displaying the result labels are running
65
+ # in different threads asynchronously.
66
+ # Then the rendered video frames and the labels displayed here
67
+ # are not strictly synchronized.
68
+ while True:
69
+ result = result_queue.get()
70
+ labels_placeholder.table(result)
71
+
72
 
73
  # Output text display
74
  st.subheader("Output Text")