fcernafukuzaki commited on
Commit
3ba8c33
·
verified ·
1 Parent(s): 875b82f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +23 -12
app.py CHANGED
@@ -1,13 +1,24 @@
1
- import streamlit as st
 
 
 
 
2
 
3
- def hola():
4
- st.write("HOLA")
5
-
6
- img_file_buffer = st.camera_input("Take a picture", label_visibility="hidden", on_change=hola)
7
-
8
- #if img_file_buffer is not None:
9
- # To read image file buffer as bytes:
10
- bytes_data = img_file_buffer.getvalue()
11
- # Check the type of bytes_data:
12
- # Should output: <class 'bytes'>
13
- st.write(type(bytes_data))
 
 
 
 
 
 
 
 
1
+ import cv2
2
+ import numpy as np
3
+ import av
4
+ import mediapipe as mp
5
+ from streamlit_webrtc import webrtc_streamer, WebRtcMode, RTCConfiguration
6
 
7
+ mp_drawing = mp.solutions.drawing_utils
8
+ mp_drawing_styles = mp.solutions.drawing_styles
9
+ mp_hands = mp.solutions.hands
10
+ hands = mp_hands.Hands(
11
+ model_complexity=0,
12
+ min_detection_confidence=0.5,
13
+ min_tracking_confidence=0.5
14
+ )
15
+ RTC_CONFIGURATION = RTCConfiguration(
16
+ {"iceServers": [{"urls": ["stun:stun.l.google.com:19302"]}]}
17
+ )
18
+ webrtc_ctx = webrtc_streamer(
19
+ key="TEST",
20
+ mode=WebRtcMode.SENDRECV,
21
+ rtc_configuration=RTC_CONFIGURATION,
22
+ media_stream_constraints={"video": True, "audio": False},
23
+ async_processing=True,
24
+ )