mirror of
https://git.roussel.pro/telecom-paris/pact.git
synced 2026-02-09 10:30:17 +01:00
add mediapipehands exemple
This commit is contained in:
@@ -3,6 +3,7 @@ import json
|
||||
import websockets
|
||||
import random
|
||||
import os
|
||||
import hands
|
||||
|
||||
class WebsocketServer:
|
||||
def __init__(self,getEffects,port=os.getenv("PORT"),host=os.getenv("HOST")) -> None:
|
||||
@@ -18,6 +19,7 @@ class WebsocketServer:
|
||||
async def handler(self,websocket):
|
||||
while True:
|
||||
messages = self.getEffects()
|
||||
hands.frame()
|
||||
await websocket.send(json.dumps(messages))
|
||||
await asyncio.sleep(1/30)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user