Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion test/test_datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -854,7 +854,7 @@ def _annotation_file_name(self, fold, train):

def _create_annotation_file(self, root, name, video_files):
with open(pathlib.Path(root) / name, "w") as fh:
fh.writelines(f"{file}\n" for file in sorted(video_files))
fh.writelines(f"{str(file).replace(os.sep, '/')}\n" for file in sorted(video_files))


class LSUNTestCase(datasets_utils.ImageDatasetTestCase):
Expand Down
2 changes: 1 addition & 1 deletion torchvision/datasets/ucf101.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def _select_fold(self, video_list: List[str], annotation_path: str, fold: int, t
with open(f) as fid:
data = fid.readlines()
data = [x.strip().split(" ")[0] for x in data]
data = [os.path.join(self.root, x) for x in data]
data = [os.path.join(self.root, *x.split("/")) for x in data]
selected_files.update(data)
indices = [i for i in range(len(video_list)) if video_list[i] in selected_files]
return indices
Expand Down