AndrewLam489 commited on
Commit
3691888
·
verified ·
1 Parent(s): b2efa3a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -9
app.py CHANGED
@@ -1,6 +1,6 @@
1
  import cv2
2
  import streamlit as st
3
- from streamlit_webrtc import webrtc_streamer, WebRtcMode, VideoHTMLAttributes
4
  import numpy as np
5
  import av
6
 
@@ -52,18 +52,10 @@ with col6:
52
  if st.button("Invert"):
53
  filter = "invert"
54
 
55
- # WebRTC constraints for video resolution (optional)
56
- video_constraints = {
57
- "facing_mode": "user", # Use the front camera
58
- "width": {"ideal": 1280},
59
- "height": {"ideal": 720}
60
- }
61
-
62
  # Display the video stream
63
  webrtc_streamer(
64
  key="streamer",
65
  video_frame_callback=transform,
66
  sendback_audio=False,
67
- video_constraints=video_constraints, # Optional: set constraints
68
  mode=WebRtcMode.SENDRECV # Ensure bidirectional communication (send/receive video)
69
  )
 
1
  import cv2
2
  import streamlit as st
3
+ from streamlit_webrtc import webrtc_streamer, WebRtcMode
4
  import numpy as np
5
  import av
6
 
 
52
  if st.button("Invert"):
53
  filter = "invert"
54
 
 
 
 
 
 
 
 
55
  # Display the video stream
56
  webrtc_streamer(
57
  key="streamer",
58
  video_frame_callback=transform,
59
  sendback_audio=False,
 
60
  mode=WebRtcMode.SENDRECV # Ensure bidirectional communication (send/receive video)
61
  )