-
Notifications
You must be signed in to change notification settings - Fork 27.5k
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
Video Classification Task Guide Using Undeclared Variables #29817
Comments
Thanks for reporting, would you be able to open a PR to fix this? |
Sure, I'd be happy to help. |
Hi @amyeroberts , the main version of video classification notebook seems to define the all_video_file_paths. Should this issue be considered fixed? |
Hi @manju-rangam - the issue is referencing the examples in the docs, which should still be updated. |
Video Classification Task Guide Using Undeclared Variables
@amyeroberts, I've created a PR related to this |
Video Classification Task Guide Using Undeclared Variables
Add line space following PR comments
updated based on review comments @amyeroberts |
…riables (#30457) * Fix issue #29817 Video Classification Task Guide Using Undeclared Variables * Update docs/source/en/tasks/video_classification.md updated with review comments Co-authored-by: amyeroberts <[email protected]> * Fix issue #29817 Add line space following PR comments --------- Co-authored-by: manju-rangam <Manju1@Git> Co-authored-by: amyeroberts <[email protected]>
Hey @amyeroberts new to open source community can i be considered to work on this issue if its not fixed? |
The PR above has been merged, so will close this issue. @anirudh2781998 feel free to take a look at other issues labeled with "good first issue" or "good first documentation issue" |
…riables (#30457) * Fix issue #29817 Video Classification Task Guide Using Undeclared Variables * Update docs/source/en/tasks/video_classification.md updated with review comments Co-authored-by: amyeroberts <[email protected]> * Fix issue #29817 Add line space following PR comments --------- Co-authored-by: manju-rangam <Manju1@Git> Co-authored-by: amyeroberts <[email protected]>
System Info
transformers
version: 4.32.1Who can help?
@amyeroberts
Information
Tasks
examples
folder (such as GLUE/SQuAD, ...)Reproduction
Follow the Video Classification example in the HuggingFace docs:
https://huggingface.co/docs/transformers/tasks/video_classification
When Reaching the step
`class_labels = sorted({str(path).split("/")[2] for path in all_video_file_paths})
label2id = {label: i for i, label in enumerate(class_labels)}
id2label = {i: label for label, i in label2id.items()}
print(f"Unique classes: {list(label2id.keys())}.")
`
The variable
all_video_file_paths
is not previously defined in the example docs. I had to write a function to retrieve the video file paths myself, as seen below:`import os
dataset_path = "UCF101_subset"
all_video_file_paths = []
for split in ["train", "val", "test"]:
split_path = os.path.join(dataset_path, split)
for category in os.listdir(split_path):
category_path = os.path.join(split_path, category)
for video_file in os.listdir(category_path):
video_file_path = os.path.join(category_path, video_file)
all_video_file_paths.append(video_file_path)`
dataset_root_path
is not previously defined.Expected behavior
I assume that these variables should have been previously defined to not cause errors for people following the example docs.
The text was updated successfully, but these errors were encountered: