liuhui0401 commited on
Commit
a675789
·
verified ·
1 Parent(s): cc5a032

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -0
app.py CHANGED
@@ -12,6 +12,21 @@ def detection(image, conf_threshold=0.3):
12
  new_image = model.detect_objects(image, conf_threshold)
13
  return new_image
14
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
15
  import gradio as gr
16
  from gradio_webrtc import WebRTC
17
 
 
12
  new_image = model.detect_objects(image, conf_threshold)
13
  return new_image
14
 
15
+ account_sid = os.environ.get("TWILIO_ACCOUNT_SID")
16
+ auth_token = os.environ.get("TWILIO_AUTH_TOKEN")
17
+
18
+ if account_sid and auth_token:
19
+ client = Client(account_sid, auth_token)
20
+
21
+ token = client.tokens.create()
22
+
23
+ rtc_configuration = {
24
+ "iceServers": token.ice_servers,
25
+ "iceTransportPolicy": "relay",
26
+ }
27
+ else:
28
+ rtc_configuration = None
29
+
30
  import gradio as gr
31
  from gradio_webrtc import WebRTC
32