doleron / yolov5-opencv-cpp-python

Example of using ultralytics YOLO V5 with OpenCV 4.5.4, C++ and Python
MIT License
328 stars 103 forks source link

on windows 11 #5

Closed manuelddahmen closed 2 years ago

manuelddahmen commented 2 years ago

it works very well on windows too. just need to change cv2 to opencv-python

would it be possible to grab a live camera instead of mp4 files?

doleron commented 2 years ago

For webcam you may try:

def load_capture():
    capture = cv2.VideoCapture(0)
    return capture

or

def load_capture():
    capture = cv2.VideoCapture(1)
    return capture

see https://docs.opencv.org/4.x/dd/d43/tutorial_py_video_display.html