updated to use jpeg decoding

This commit is contained in:
Nickiel12 2024-06-22 12:53:45 -07:00
parent 4fa94a647d
commit d7d5887fb1
2 changed files with 5 additions and 1 deletions

View file

@ -2,6 +2,7 @@ import websockets
import asyncio
import numpy as np
from ultralytics import YOLO
import time
import cv2
classNames = ["person", "bicycle", "car", "motorbike", "aeroplane", "bus", "train", "truck", "boat",
@ -28,6 +29,7 @@ async def handle_connection(websocket, path):
# frame = cv2.imdecode(nparr, cv2.IMREAD_COLOR)
frame = cv2.cvtColor(nparr, cv2.COLOR_BGR2RGB)
cv2.imshow("from_remote", frame)
# Perform object detection
results = model.track(frame, persist=True)
@ -73,6 +75,8 @@ async def handle_connection(websocket, path):
ret = lines.encode('utf-8')
cv2.waitKey(80)
await websocket.send(ret)
except websockets.exceptions.ConnectionClosed:

@ -1 +1 @@
Subproject commit 66acd4698fcc997099ebc1ddc6f8e5ddd0e3579c
Subproject commit a3d8a6fd064c0a194dc0815e7f19c900937921d9