I’m trying to classify video frames, and for that i need to create a batch from a sequence of frames and pass it to the model. currently am classifying frame by frame as following:
> cap = cv2.VideoCapture(video_path) > _, frame= cap.read() > frame = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB) > img_t = pil2tensor(frame, np.float32) > img_t.div_(255.0) > image = Image(img_t) > pred = model.predict(image)
is there a way to create batch directly form frames, or to add them to a dataset and get the batch from it?
Thanks in advance