Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

How many frames are sampled per video for the training and testing process? #99

Open
Nastu-Ho opened this issue Apr 22, 2024 · 5 comments

Comments

@Nastu-Ho
Copy link

No description provided.

@mmaaz60
Copy link
Member

mmaaz60 commented Apr 22, 2024

Hi @Nastu-Ho,

Thank you for your interest in our work. We sample 100 frames uniformly during both training and testing. Thank you

@onlyonewater
Copy link

@mmaaz60 , hi, can I sample more than 100 frames to infer on my own dataset?

@onlyonewater
Copy link

from #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.

@mmaaz60
Copy link
Member

mmaaz60 commented May 3, 2024

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

@onlyonewater
Copy link

ok, I got it, thanks @mmaaz60

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants