Unverified Commit f01b533e authored by Philip Meier's avatar Philip Meier Committed by GitHub
Browse files

fix UCF101 on Windows (#5129)

parent b5aa0915
...@@ -854,7 +854,7 @@ class UCF101TestCase(datasets_utils.VideoDatasetTestCase): ...@@ -854,7 +854,7 @@ class UCF101TestCase(datasets_utils.VideoDatasetTestCase):
def _create_annotation_file(self, root, name, video_files): def _create_annotation_file(self, root, name, video_files):
with open(pathlib.Path(root) / name, "w") as fh: 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): class LSUNTestCase(datasets_utils.ImageDatasetTestCase):
......
...@@ -108,7 +108,7 @@ class UCF101(VisionDataset): ...@@ -108,7 +108,7 @@ class UCF101(VisionDataset):
with open(f) as fid: with open(f) as fid:
data = fid.readlines() data = fid.readlines()
data = [x.strip().split(" ")[0] for x in data] 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) selected_files.update(data)
indices = [i for i in range(len(video_list)) if video_list[i] in selected_files] indices = [i for i in range(len(video_list)) if video_list[i] in selected_files]
return indices return indices
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment