import logging import queue from collections import deque import json import tempfile import streamlit as st from streamlit_webrtc import WebRtcMode, webrtc_streamer, RTCConfiguration from utils import SLInference logger = logging.getLogger(__name__) RTC_CONFIGURATION = RTCConfiguration({ "iceServers": [{"urls": ["stun:stun.l.google.com:19302"]}] }) def main(): """ Main function of the app. """ config = { "path_to_model": "S3D.onnx", "threshold": 0.3, "topk": 5, "path_to_class_list": "RSL_class_list.txt", "window_size": 32, "provider": "OpenVINOExecutionProvider" } # Сохранение конфигурации во временный файл with tempfile.NamedTemporaryFile(delete=False, mode='w', suffix='.json') as config_file: json.dump(config, config_file) config_file_path = config_file.name inference_thread = SLInference(config_file_path) inference_thread.start() # --- СТИЛЬНЫЙ БЛОК С ОПИСАНИЕМ --- st.markdown("""
This application is designed to recognize sign language using a webcam feed.
The model has been trained to recognize various sign language gestures and display the corresponding text in real-time.
The project is open for collaboration. If you have any suggestions or want to contribute, please feel free to reach out.
🖐️ Current gesture: {gesture}
', unsafe_allow_html=True ) last_5_gestures.markdown( f'🧠 Last 5 gestures: {" | ".join(gestures_deque)}
', unsafe_allow_html=True ) if __name__ == "__main__": main()