58. Leitura de vídeo multithread em Python e uso tensorrt Batchsize = 4 para processar o vídeo

Ideia básica: registrar o ambiente experimental rtx3050 cuda11.1 cudn11.3 tesorRT8.6

Link: https://pan.baidu.com/s/1zC_wgTJiDzThVU9FxOrvrg?pwd=95y9 Código de extração: 95y9 
--Compartilhamento do Baidu Netdisk Super Member v1

1. Leia quatro vídeos ao mesmo tempo para reprodução e exibição

# -*- 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 =

Acho que você gosta

Origin blog.csdn.net/sxj731533730/article/details/130706436
Recomendado
Clasificación