8000 Local AI with YOLOv5 · Issue #53 · kroo/wyzecam · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content 8000
Local AI with YOLOv5 #53
Open
Open
@mrlt8

Description

@mrlt8

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0