Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
M
maskrcnn
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
人工智能
maskrcnn
Commits
fdb9c687
Commit
fdb9c687
authored
Apr 11, 2019
by
qianyizhang
Committed by
Francisco Massa
Apr 11, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix python2 compatibility (#662)
* fix py2 * fix py2
parent
59d445df
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
segmentation_mask.py
maskrcnn_benchmark/structures/segmentation_mask.py
+5
-3
No files found.
maskrcnn_benchmark/structures/segmentation_mask.py
View file @
fdb9c687
import
cv2
import
cv2
import
copy
import
torch
import
torch
import
numpy
as
np
import
numpy
as
np
from
maskrcnn_benchmark.layers.misc
import
interpolate
from
maskrcnn_benchmark.layers.misc
import
interpolate
...
@@ -195,7 +195,7 @@ class PolygonInstance(object):
...
@@ -195,7 +195,7 @@ class PolygonInstance(object):
polygons
=
valid_polygons
polygons
=
valid_polygons
elif
isinstance
(
polygons
,
PolygonInstance
):
elif
isinstance
(
polygons
,
PolygonInstance
):
polygons
=
polygons
.
polygons
.
copy
(
)
polygons
=
copy
.
copy
(
polygons
.
polygons
)
else
:
else
:
RuntimeError
(
RuntimeError
(
...
@@ -523,7 +523,9 @@ class SegmentationMask(object):
...
@@ -523,7 +523,9 @@ class SegmentationMask(object):
next_segmentation
=
self
.
__getitem__
(
self
.
iter_idx
)
next_segmentation
=
self
.
__getitem__
(
self
.
iter_idx
)
self
.
iter_idx
+=
1
self
.
iter_idx
+=
1
return
next_segmentation
return
next_segmentation
raise
StopIteration
raise
StopIteration
()
next
=
__next__
# Python 2 compatibility
def
__repr__
(
self
):
def
__repr__
(
self
):
s
=
self
.
__class__
.
__name__
+
"("
s
=
self
.
__class__
.
__name__
+
"("
...
...
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