So I am trying to build a real-time object tracking algorithm.
My current pipeline is for each frame:

Use OpenCV to obtain webcam frame
frame -> pytorch model -> output
applying object track algorithm

But I think doing this would be faster, for each frame:

Use OpenCV to obtain webcam frame
stack 30 frames
frame -> pytorch model -> output
apply object track algorithm

However I am not sure how to batch 30 frames together? Can anyone give me some guidance?