Closed Nastu-Ho closed 4 days ago
@mmaaz60 , hi, can I sample more than 100 frames to infer on my own dataset?
from https://github.com/mbzuai-oryx/Video-ChatGPT/issues/14, I know how to change the code, but how to change the code to extract the 1 frame or 2 frames per second? I think this implementation makes sense for long videos.
Hi @onlyonewater,
It would be something similar to below,
sample_fps = 1
vr = VideoReader(video_path, ctx=cpu(0))
fps = vreader.get_avg_fps()
f_start = 0
f_end = len(vr) - 1
t_stride = int(round(float(fps) / sample_fps))
all_pos = list(range(f_start, f_end + 1, t_stride))
img_array = vr.get_batch(all_pos).asnumpy()
I hope this will be helpful. Thank YOu
ok, I got it, thanks @mmaaz60
Hi @Nastu-Ho,
Thank you for your interest in our work. We sample 100 frames uniformly during both training and testing. Thank you