fixed websocket image piepline

This commit is contained in:
2026-05-29 18:11:22 +02:00
parent 315e92989c
commit 90e86d6f48
2 changed files with 27 additions and 40 deletions
+4
View File
@@ -107,6 +107,10 @@ async def predict_face(websocket: WebSocket):
np_arr = np.frombuffer(jpg_bytes, np.uint8)
frame = cv2.imdecode(np_arr, cv2.IMREAD_COLOR)
frame = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)
image = Image.fromarray(frame)
H, W, _ = frame.shape
scale_w = W / IMAGE_SIZE_YOLO
scale_h = H / IMAGE_SIZE_YOLO