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
"tutorials/vscode:/vscode.git/clone" did not exist on "1bbc885b40cb739845368c92227c3fd975dd5a2c"
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
Show 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):
...
@@ -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
):
...
...
torchvision/datasets/ucf101.py
View file @
f01b533e
...
@@ -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
...
...
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