首页 > 解决方案 > 在视频数据集上训练?

问题描述

我正在使用由带注释的视频组成的 Standford Drone 数据集,我正在接受培训以了解如何进行培训。你可以只训练视频吗?我假设您必须将视频剪切成帧,如果是这样,有人知道自动化的示例吗?

标签: videodataset

解决方案


You will have to extract the video frames for training purpose.

import cv2
video = cv2.VideoCapture(path) 
success = 1  
while success: 
    success, image = video.read() 
    #Here you can either save the frame or directly use it in training.
    cv2.imwrite("frame.png",image) #This will save the image/frame to file named frma.png

As shown in above code, you can either save the frames one by one to your training data folder or can just provide it as input to your CNN (Will save time as well as memory to save the files).

Also you can have a look on python's opencv library.


推荐阅读