Pratyush101 commited on
Commit
152f317
·
verified ·
1 Parent(s): 47fd153

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -0
app.py CHANGED
@@ -15,6 +15,19 @@ from cvzone.SelfiSegmentationModule import SelfiSegmentation
15
  import time
16
  import os
17
 
 
 
 
 
 
 
 
 
 
 
 
 
 
18
  HERE = Path(__file__).parent
19
  ROOT = HERE
20
 
 
15
  import time
16
  import os
17
 
18
+ import asyncio
19
+ import aioice
20
+
21
+ def ensure_event_loop():
22
+ loop = asyncio.get_event_loop()
23
+ if loop.is_closed():
24
+ loop = asyncio.new_event_loop()
25
+ asyncio.set_event_loop(loop)
26
+
27
+ # Ensure loop is running before WebRTC setup
28
+ ensure_event_loop()
29
+
30
+
31
  HERE = Path(__file__).parent
32
  ROOT = HERE
33