Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
vision
Commits
f01b533e
Unverified
Commit
f01b533e
authored
Jan 06, 2022
by
Philip Meier
Committed by
GitHub
Jan 06, 2022
Browse files
fix UCF101 on Windows (#5129)
parent
b5aa0915
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
test/test_datasets.py
test/test_datasets.py
+1
-1
torchvision/datasets/ucf101.py
torchvision/datasets/ucf101.py
+1
-1
No files found.
test/test_datasets.py
View file @
f01b533e
...
...
@@ -854,7 +854,7 @@ class UCF101TestCase(datasets_utils.VideoDatasetTestCase):
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
):
...
...
torchvision/datasets/ucf101.py
View file @
f01b533e
...
...
@@ -108,7 +108,7 @@ class UCF101(VisionDataset):
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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment