tobyperrett / trx

Temporal-Relational CrossTransformers (CVPR 2021)
108 stars 23 forks source link

the number of frames chosen #15

Open Liu-arch opened 1 year ago

Liu-arch commented 1 year ago

Hello, I would like to ask how many frame rates are set to capture a picture for the 4 different datasets of video data when building the dataset. Thank you very much!

tobyperrett commented 1 year ago

I think I just did 8 frames per instance to save space.

On Fri, 2 Dec 2022 at 09:30, Liu-arch @.***> wrote:

Hello, I would like to ask how many frame rates are set to capture a picture for the 4 different datasets of video data when building the dataset. Thank you very much!

— Reply to this email directly, view it on GitHub https://github.com/tobyperrett/trx/issues/15, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHLHB77RBSBGZTAP3NRBU73WLG6RTANCNFSM6AAAAAASRWXIBE . You are receiving this because you are subscribed to this thread.Message ID: @.***>

Liu-arch commented 1 year ago

Thank you for your answer! But I think you missed my point. What I mean is, when extracting an image from a video sequence, how many frames apart does it save an image? For example, one image per 20 frames or one image per 30 frames for every dataset (HMDB51/Kinetics/UCF101/SSv2)?

tobyperrett commented 1 year ago

Uniformly sample 8 frames per instance, so it’s not a fixed frame rate. Different instances are different lengths, but the method only takes in a fixed number of frames. You could do 30fps extraction or whatever and then select 8 frames from that if you wanted, but it will take up more space.

On Sun, 4 Dec 2022 at 16:10, Liu-arch @.***> wrote:

Thank you for your answer! But I think you missed my point. What I mean is, when extracting an image from a video sequence, how many frames apart does it save an image? For example, one image per 20 frames or one image per 30 frames for every dataset (HMDB51/Kinetics/UCF101/SSv2)?

— Reply to this email directly, view it on GitHub https://github.com/tobyperrett/trx/issues/15#issuecomment-1336453558, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHLHB75532Y3EXWBXK4AE23WLS65TANCNFSM6AAAAAASRWXIBE . You are receiving this because you commented.Message ID: @.***>

Liu-arch commented 1 year ago

Reading through your code, I see that in video_reader it reads jpg format, so if you are not first using 30fps extraction and then select 8 frames from that. then how are you extracting the images from each video? Simply extract the first 8 frames of each video and put them in a folder as jpg?

tobyperrett commented 1 year ago

Using the first 8 frames will obviously not work as most of the action will be missing. The functionality you want is in the shrink dataset script. It uniformly samples from all the extracted frames.

On Sun, 4 Dec 2022 at 16:24, Liu-arch @.***> wrote:

Reading through your code, I see that in video_reader it reads jpg format, so if you are not first using 30fps extraction and then select 8 frames from that. then how are you extracting the images from each video? Simply extract the first 8 frames of each video and put them in a folder as jpg?

— Reply to this email directly, view it on GitHub https://github.com/tobyperrett/trx/issues/15#issuecomment-1336456845, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHLHB76OSHZRDRIQ3PEV7N3WLTAU3ANCNFSM6AAAAAASRWXIBE . You are receiving this because you commented.Message ID: @.***>

Liu-arch commented 1 year ago

Sorry, I don't see where the hlink dataset script is . Can you point me in the right direction? Thank you very much!!!

tobyperrett commented 1 year ago

Use my few-shot repo instead of the trx one. It’s easier to use and has additional baselines etc.

On Sun, 4 Dec 2022 at 16:41, Liu-arch @.***> wrote:

Sorry, I don't see where the hlink dataset script is . Can you point me in the right direction? Thank you very much!!!

— Reply to this email directly, view it on GitHub https://github.com/tobyperrett/trx/issues/15#issuecomment-1336463579, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHLHB77T522BO6JKIOHN3DDWLTCTLANCNFSM6AAAAAASRWXIBE . You are receiving this because you commented.Message ID: @.***>

Liu-arch commented 1 year ago

Thank you very much. I will look into your new git project.

Liu-arch commented 1 year ago

I just looked at your hlink dataset script and it still manipulates jpg images. But the downloaded dataset is video data and my question now is how you extracted the jpg images from the raw video data. Instead of already getting jpg images how do you select 8 frames. Thank you very much.

tobyperrett commented 1 year ago

That repo has scripts for extracting data and for shrinking it down to 8 frames.

On Sun, 4 Dec 2022 at 17:19, Liu-arch @.***> wrote:

I just looked at your hlink dataset script and it still manipulates jpg images. But the downloaded dataset is video data and my question now is how you extracted the jpg images from the raw video data. Instead of already getting jpg images how do you select 8 frames. Thank you very much.

— Reply to this email directly, view it on GitHub https://github.com/tobyperrett/trx/issues/15#issuecomment-1336471272, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHLHB73XWDY3I3SQ5QIPO43WLTHALANCNFSM6AAAAAASRWXIBE . You are receiving this because you commented.Message ID: @.***>

Liu-arch commented 1 year ago

my bad! Thank you

Liu-arch commented 1 year ago

In few-shot repo, extract_hmdb.py get the empty folder without jpg in the folder. I think there is something wrong with this code, but I don't know how to change it. try: cmd = ['ffmpeg', '-i', source_vid, '-vf', scale_string, '-q:v', '5', out_wc]

cmds.append((cmd, extract_dir))
subprocess.call(cmd)
bulijiojiodblido commented 7 months ago

Hello, Have you solved this problem yet?