Open
Description
Not really a feature request, but a quick example to get local AI on the wyze stream with yolov5 using 14 lines of code!
yolov5 requirements: pip install -r https://raw.githubusercontent.com/ultralytics/yolov5/master/requirements.txt
import os
import cv2
import wyzecam
import torch
model = torch.hub.load('ultralytics/yolov5', 'yolov5s')
auth_info = wyzecam.login(os.environ["WYZE_EMAIL"], os.environ["WYZE_PASSWORD"])
account = wyzecam.get_user_info(auth_info)
camera = wyzecam.get_camera_list(auth_info)[0]
with wyzecam.WyzeIOTC() as wyze_iotc:
with wyze_iotc.connect_and_auth(account, camera) as sess:
for (frame, frame_info) in sess.recv_video_frame_ndarray():
results = model(frame)
cv2.imshow("Video Feed", results.render()[0].copy())
cv2.waitKey(1)