added send intervall of 2 fps

This commit is contained in:
2026-06-04 15:10:57 +02:00
parent 9dcc5915aa
commit 8a3d6319d3
2 changed files with 17 additions and 7 deletions
+4 -4
View File
@@ -97,16 +97,16 @@ async def predict(file: UploadFile = File(...)):
async def predict_face(websocket: WebSocket):
await websocket.accept()
#last = time.time()
last = time.time()
try:
while True:
jpg_bytes = await websocket.receive_bytes()
#if time.time() - last < 1:
#continue
if time.time() - last < 1 / 2:
continue
#last = time.time()
last = time.time()
with sem_ai:
np_arr = np.frombuffer(jpg_bytes, np.uint8)