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
922db308
Unverified
Commit
922db308
authored
Dec 27, 2021
by
Aditya Oke
Committed by
GitHub
Dec 27, 2021
Browse files
Update code to Python 3.7 compliance (#5125)
* Upgrade to py37 * Update
parent
5335006b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
5 additions
and
5 deletions
+5
-5
torchvision/datasets/_optical_flow.py
torchvision/datasets/_optical_flow.py
+2
-2
torchvision/datasets/food101.py
torchvision/datasets/food101.py
+1
-1
torchvision/io/_video_opt.py
torchvision/io/_video_opt.py
+1
-1
torchvision/models/optical_flow/raft.py
torchvision/models/optical_flow/raft.py
+1
-1
No files found.
torchvision/datasets/_optical_flow.py
View file @
922db308
...
@@ -338,10 +338,10 @@ class FlyingThings3D(FlowDataset):
...
@@ -338,10 +338,10 @@ class FlyingThings3D(FlowDataset):
directions
=
(
"into_future"
,
"into_past"
)
directions
=
(
"into_future"
,
"into_past"
)
for
pass_name
,
camera
,
direction
in
itertools
.
product
(
passes
,
cameras
,
directions
):
for
pass_name
,
camera
,
direction
in
itertools
.
product
(
passes
,
cameras
,
directions
):
image_dirs
=
sorted
(
glob
(
str
(
root
/
pass_name
/
split
/
"*/*"
)))
image_dirs
=
sorted
(
glob
(
str
(
root
/
pass_name
/
split
/
"*/*"
)))
image_dirs
=
sorted
(
[
Path
(
image_dir
)
/
camera
for
image_dir
in
image_dirs
]
)
image_dirs
=
sorted
(
Path
(
image_dir
)
/
camera
for
image_dir
in
image_dirs
)
flow_dirs
=
sorted
(
glob
(
str
(
root
/
"optical_flow"
/
split
/
"*/*"
)))
flow_dirs
=
sorted
(
glob
(
str
(
root
/
"optical_flow"
/
split
/
"*/*"
)))
flow_dirs
=
sorted
(
[
Path
(
flow_dir
)
/
direction
/
camera
for
flow_dir
in
flow_dirs
]
)
flow_dirs
=
sorted
(
Path
(
flow_dir
)
/
direction
/
camera
for
flow_dir
in
flow_dirs
)
if
not
image_dirs
or
not
flow_dirs
:
if
not
image_dirs
or
not
flow_dirs
:
raise
FileNotFoundError
(
raise
FileNotFoundError
(
...
...
torchvision/datasets/food101.py
View file @
922db308
...
@@ -51,7 +51,7 @@ class Food101(VisionDataset):
...
@@ -51,7 +51,7 @@ class Food101(VisionDataset):
self
.
_labels
=
[]
self
.
_labels
=
[]
self
.
_image_files
=
[]
self
.
_image_files
=
[]
with
open
(
self
.
_meta_folder
/
f
"
{
split
}
.json"
,
"r"
)
as
f
:
with
open
(
self
.
_meta_folder
/
f
"
{
split
}
.json"
)
as
f
:
metadata
=
json
.
loads
(
f
.
read
())
metadata
=
json
.
loads
(
f
.
read
())
self
.
classes
=
sorted
(
metadata
.
keys
())
self
.
classes
=
sorted
(
metadata
.
keys
())
...
...
torchvision/io/_video_opt.py
View file @
922db308
...
@@ -71,7 +71,7 @@ def _validate_pts(pts_range: Tuple[int, int]) -> None:
...
@@ -71,7 +71,7 @@ def _validate_pts(pts_range: Tuple[int, int]) -> None:
assert
(
assert
(
pts_range
[
0
]
<=
pts_range
[
1
]
pts_range
[
0
]
<=
pts_range
[
1
]
),
"""Start pts should not be smaller than end pts, got
),
"""Start pts should not be smaller than end pts, got
start pts: {
0
:d} and end pts: {
1
:d}"""
.
format
(
start pts: {:d} and end pts: {:d}"""
.
format
(
pts_range
[
0
],
pts_range
[
0
],
pts_range
[
1
],
pts_range
[
1
],
)
)
...
...
torchvision/models/optical_flow/raft.py
View file @
922db308
...
@@ -74,7 +74,7 @@ class BottleneckBlock(nn.Module):
...
@@ -74,7 +74,7 @@ class BottleneckBlock(nn.Module):
"""Slightly modified BottleNeck block (extra relu and biases)"""
"""Slightly modified BottleNeck block (extra relu and biases)"""
def
__init__
(
self
,
in_channels
,
out_channels
,
*
,
norm_layer
,
stride
=
1
):
def
__init__
(
self
,
in_channels
,
out_channels
,
*
,
norm_layer
,
stride
=
1
):
super
(
BottleneckBlock
,
self
).
__init__
()
super
().
__init__
()
# See note in ResidualBlock for the reason behind bias=True
# See note in ResidualBlock for the reason behind bias=True
self
.
convnormrelu1
=
ConvNormActivation
(
self
.
convnormrelu1
=
ConvNormActivation
(
...
...
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