File size: 442 Bytes
7e5c89f
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
from streamlit_webrtc import VideoProcessorBase

class VideoProcessor(VideoProcessorBase):
    def __init__(self, model, label_map, byte_tracker, box_annotator):
        self.model = model
        self.label_map = label_map
        self.byte_tracker = byte_tracker
        self.box_annotator = box_annotator
        self.frame = None

    def recv(self, frame):
        self.frame = frame.to_ndarray(format="bgr24")
        return self.frame