58 、python多线程读取视频,以及使用tensorrt Batchsize=4处理视频

基本思想:记录一下,实验环境rtx3050 cuda11.1 cudn11.3 tesorRT8.6

链接: https://pan.baidu.com/s/1zC_wgTJiDzThVU9FxOrvrg?pwd=95y9 提取码: 95y9 
--来自百度网盘超级会员v1的分享

一 、同时读四个视频进行播放显示

# -*- coding: utf-8 -*-

import cv2
import threading
from queue import Queue

class ReadCameraThread(threading.Thread):
    def __init__(self, video_queue,video_queue_flag):
        super(ReadCameraThread).__init__()
        threading.Thread.__init__(self)

        #self.read_capture = cv2.VideoCapture(0)
        self.cap3 = cv2.VideoCapture("/home/ubuntu/YOLOv7_Tensorrt/test_video/test0.mp4")
        self.cap0 = cv2.VideoCapture("/home/ubuntu/YOLOv7_Tensorrt/test_video/test1.mp4")
        self.cap1 = cv2.VideoCapture("/home/ubuntu/YOLOv7_Tensorrt/test_video/test2.mp4")
        self.cap2 = cv2.VideoCapture("/home/ubuntu/YOLOv7_Tensorrt/test_video/test3.mp4")
        self.video_queue = video_queue
        self.video_queue_flag =

猜你喜欢

转载自blog.csdn.net/sxj731533730/article/details/130706436
58