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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug report on the dataset preprocessing script #48

Open
zjumsj opened this issue Nov 28, 2024 · 0 comments
Open

Bug report on the dataset preprocessing script #48

zjumsj opened this issue Nov 28, 2024 · 0 comments

Comments

@zjumsj
Copy link

zjumsj commented Nov 28, 2024

Thanks to the author for the great work! There may be some minor issues in the dataset preprocessing code.
The suspected bug is near line 168 in scripts/transforms.py

with Pool(processes=8) as pool:
    params = [(frames[i], src, output) for i in range(len(frames))]
    for task in tqdm(pool.imap_unordered(dump_frame, params), total=len(frames)):
        if task is not None:
            data['frames'].append(task)

Negtive impact: The order returned by imap_unordered is randomized, so the final 350 frames obtained may not correspond to the last 350 frames of the video. When comparing with other works (which also take the last 350 frames of the video), alignment issues may be observed.

Bugfix: Here is the fixed version

data['frames'] = [None] * len(frames)
with Pool(processes=8) as pool:
    params = [(frames[i], src, output) for i in range(len(frames))]
    for task in tqdm(pool.imap_unordered(dump_frame, params), total=len(frames)):
        if task is not None:
            id = int(os.path.basename(task['file_path'])[:5])
            data['frames'][id] = task

See also my attached patch.

transforms.patch

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

1 participant