Pratyush101 commited on
Commit
8eb542c
·
verified ·
1 Parent(s): ec28794

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -3
app.py CHANGED
@@ -55,7 +55,6 @@ def video_frame_callback(frame: av.VideoFrame) -> av.VideoFrame:
55
  global indexImg, output_text
56
 
57
  img = frame.to_ndarray(format="bgr24")
58
- img = cv2.resize(img, (640, 480)) # Ensure fixed size
59
  result = hands.process(cv2.cvtColor(img, cv2.COLOR_BGR2RGB))
60
 
61
  # Create the keyboard buttons
@@ -139,12 +138,18 @@ st.text_area("Typed Text", st.session_state["output_text"], height=150)
139
 
140
  st.write(st.session_state["output_text"])
141
 
142
- # WebRTC Streamer
143
  webrtc_streamer(
144
  key="virtual-keyboard",
145
  mode=WebRtcMode.SENDRECV,
146
  rtc_configuration={"iceServers": get_ice_servers(), "iceTransportPolicy": "relay"},
147
- media_stream_constraints={"video": True, "audio": False},
 
 
 
 
 
 
 
148
  video_frame_callback=video_frame_callback,
149
  async_processing=True,
150
  )
 
55
  global indexImg, output_text
56
 
57
  img = frame.to_ndarray(format="bgr24")
 
58
  result = hands.process(cv2.cvtColor(img, cv2.COLOR_BGR2RGB))
59
 
60
  # Create the keyboard buttons
 
138
 
139
  st.write(st.session_state["output_text"])
140
 
 
141
  webrtc_streamer(
142
  key="virtual-keyboard",
143
  mode=WebRtcMode.SENDRECV,
144
  rtc_configuration={"iceServers": get_ice_servers(), "iceTransportPolicy": "relay"},
145
+ media_stream_constraints={
146
+ "video": {
147
+ "width": {"exact": 640},
148
+ "height": {"exact": 480},
149
+ "frameRate": {"ideal": 30}
150
+ },
151
+ "audio": False,
152
+ },
153
  video_frame_callback=video_frame_callback,
154
  async_processing=True,
155
  )