[vv2.VideoCapture()for IP webcam andriod

问题描述 投票:0回答:1

如何在ImageAI视频对象检测中提供IP网络摄像头视频?我的代码看起来像这样,

detector = VideoObjectDetection()
detector.setModelTypeAsYOLOv3()
detector.setModelPath(os.path.join(execution_path , "yolo.h5"))
detector.loadModel()
print('Model loaded')

capture = cv2.VideoCapture("http://10.10.1.223:8080/shot.jpg")

video_path = detector.detectObjectsFromVideo(camera_input=capture,
                            output_file_path=os.path.join(execution_path, "captured")
                            , frames_per_second=5, log_progress=True, detection_timeout=120)

[当我将cv2.VideoCapture(0)用于笔记本电脑的网络摄像头时,连续的帧会在检测器中传递并创建一个新的视频,但是,每当我通过IP网络摄像头链接时,它只会处理一帧然后结束。] >

如何在ImageAI视频对象检测中提供IP网络摄像头视频?我的代码如下所示:detector = VideoObjectDetection()detector.setModelTypeAsYOLOv3()detector.setModelPath(os.path.join(...

python object-detection cv2 opencv-python
1个回答
0
投票

嗯,要回答我自己的问题,我只是将URL中的shot.jpg替换为视频。就是这样!

© www.soinside.com 2019 - 2024. All rights reserved.