osheina commited on
Commit
977c6e8
·
verified ·
1 Parent(s): d837ce1

Update pages/Camera.py

Browse files
Files changed (1) hide show
  1. pages/Camera.py +5 -6
pages/Camera.py CHANGED
@@ -2,11 +2,11 @@ import logging
2
  import queue
3
  from collections import deque
4
  import asyncio
5
- import av
6
- import cv2
7
- import numpy as np
8
  import streamlit as st
9
  from streamlit_webrtc import WebRtcMode, webrtc_streamer
 
 
10
  from utils import SLInference
11
 
12
  logger = logging.getLogger(__name__)
@@ -23,7 +23,6 @@ def main(config_path):
23
  # Set up Streamlit interface
24
  st.set_page_config(page_title="Gesture Recognition", layout="wide")
25
  st.title("Sign Language Recognition Demo")
26
- image_place = st.empty()
27
  text_output = st.empty()
28
  last_5_gestures = st.empty()
29
  st.markdown(
@@ -55,8 +54,8 @@ def main(config_path):
55
 
56
  if not result_queue.empty():
57
  img_rgb = result_queue.get()
 
58
 
59
- image_place.image(img_rgb)
60
  inference_thread.input_queue.append(cv2.resize(img_rgb, (224, 224)))
61
 
62
  gesture = inference_thread.pred
@@ -74,4 +73,4 @@ def main(config_path):
74
 
75
  if __name__ == "__main__":
76
  asyncio.set_event_loop(asyncio.new_event_loop())
77
- main("configs/config.json")
 
2
  import queue
3
  from collections import deque
4
  import asyncio
5
+
 
 
6
  import streamlit as st
7
  from streamlit_webrtc import WebRtcMode, webrtc_streamer
8
+ import av
9
+
10
  from utils import SLInference
11
 
12
  logger = logging.getLogger(__name__)
 
23
  # Set up Streamlit interface
24
  st.set_page_config(page_title="Gesture Recognition", layout="wide")
25
  st.title("Sign Language Recognition Demo")
 
26
  text_output = st.empty()
27
  last_5_gestures = st.empty()
28
  st.markdown(
 
54
 
55
  if not result_queue.empty():
56
  img_rgb = result_queue.get()
57
+ st.image(img_rgb, caption='Webcam Image', use_column_width=True)
58
 
 
59
  inference_thread.input_queue.append(cv2.resize(img_rgb, (224, 224)))
60
 
61
  gesture = inference_thread.pred
 
73
 
74
  if __name__ == "__main__":
75
  asyncio.set_event_loop(asyncio.new_event_loop())
76
+ main("configs/config.json")