SS8297 commited on
Commit
a2c3c48
·
1 Parent(s): 94d1b6f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +20 -3
app.py CHANGED
@@ -1,7 +1,24 @@
1
  import streamlit as st
 
 
2
 
3
- from camera_input_live import camera_input_live
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
 
5
- image = camera_input_live()
6
 
7
- st.image(image)
 
1
  import streamlit as st
2
+ from streamlit_webrtc import webrtc_streamer
3
+ import av
4
 
5
+ flip = st.checkbox("Flip")
6
+
7
+
8
+ def video_frame_callback(frame):
9
+ img = frame.to_ndarray(format="bgr24")
10
+
11
+ flipped = img[::-1,:,:] if flip else img
12
+
13
+ return av.VideoFrame.from_ndarray(flipped, format="bgr24")
14
+
15
+
16
+ webrtc_streamer(
17
+ key="example",
18
+ video_frame_callback=video_frame_callback,
19
+ rtc_configuration={ # Add this config
20
+ "iceServers": [{"urls": ["stun:stun.l.google.com:19302"]}]
21
+ }
22
+ )
23
 
 
24