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
6640e494
Unverified
Commit
6640e494
authored
Dec 20, 2023
by
Ivan Magazinnik
Committed by
GitHub
Dec 20, 2023
Browse files
Improve io.videoreader pyav backend performance (#8173)
parent
ffc58ef4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
torchvision/io/video_reader.py
torchvision/io/video_reader.py
+2
-2
No files found.
torchvision/io/video_reader.py
View file @
6640e494
...
...
@@ -192,9 +192,9 @@ class VideoReader:
frame
=
next
(
self
.
_c
)
pts
=
float
(
frame
.
pts
*
frame
.
time_base
)
if
"video"
in
self
.
pyav_stream
:
frame
=
torch
.
tensor
(
frame
.
to_rgb
().
to_ndarray
()).
permute
(
2
,
0
,
1
)
frame
=
torch
.
as_
tensor
(
frame
.
to_rgb
().
to_ndarray
()).
permute
(
2
,
0
,
1
)
elif
"audio"
in
self
.
pyav_stream
:
frame
=
torch
.
tensor
(
frame
.
to_ndarray
()).
permute
(
1
,
0
)
frame
=
torch
.
as_
tensor
(
frame
.
to_ndarray
()).
permute
(
1
,
0
)
else
:
frame
=
None
except
av
.
error
.
EOFError
:
...
...
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