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
ModelZoo
SOLOv2-pytorch
Commits
ad5c27e1
Commit
ad5c27e1
authored
Oct 15, 2018
by
myownskyW7
Browse files
change assert to AssertionError
parent
de4dd5a5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
mmdet/datasets/coco.py
mmdet/datasets/coco.py
+8
-4
No files found.
mmdet/datasets/coco.py
View file @
ad5c27e1
...
@@ -210,8 +210,10 @@ class CocoDataset(Dataset):
...
@@ -210,8 +210,10 @@ class CocoDataset(Dataset):
if
len
(
proposals
)
==
0
:
if
len
(
proposals
)
==
0
:
idx
=
self
.
_rand_another
(
idx
)
idx
=
self
.
_rand_another
(
idx
)
continue
continue
assert
proposals
.
shape
[
1
]
==
4
or
proposals
.
shape
[
if
not
(
proposals
.
shape
[
1
]
==
4
or
proposals
.
shape
[
1
]
==
5
):
1
]
==
5
,
'proposals should have shapes (n, 4) or (n, 5)'
raise
AssertionError
(
'proposals should have shapes (n, 4) or (n, 5), '
'but found {}'
.
format
(
proposals
.
shape
))
if
proposals
.
shape
[
1
]
==
5
:
if
proposals
.
shape
[
1
]
==
5
:
scores
=
proposals
[:,
4
]
scores
=
proposals
[:,
4
]
proposals
=
proposals
[:,
:
4
]
proposals
=
proposals
[:,
:
4
]
...
@@ -274,8 +276,10 @@ class CocoDataset(Dataset):
...
@@ -274,8 +276,10 @@ class CocoDataset(Dataset):
img
=
mmcv
.
imread
(
osp
.
join
(
self
.
img_prefix
,
img_info
[
'file_name'
]))
img
=
mmcv
.
imread
(
osp
.
join
(
self
.
img_prefix
,
img_info
[
'file_name'
]))
if
self
.
proposals
is
not
None
:
if
self
.
proposals
is
not
None
:
proposal
=
self
.
proposals
[
idx
][:
self
.
num_max_proposals
]
proposal
=
self
.
proposals
[
idx
][:
self
.
num_max_proposals
]
assert
proposal
.
shape
[
1
]
==
4
or
proposal
.
shape
[
if
not
(
proposal
.
shape
[
1
]
==
4
or
proposal
.
shape
[
1
]
==
5
):
1
]
==
5
,
'proposals should have shape (n, 4) or (n, 5)'
raise
AssertionError
(
'proposals should have shapes (n, 4) or (n, 5), '
'but found {}'
.
format
(
proposal
.
shape
))
def
prepare_single
(
img
,
scale
,
flip
,
proposal
=
None
):
def
prepare_single
(
img
,
scale
,
flip
,
proposal
=
None
):
_img
,
img_shape
,
pad_shape
,
scale_factor
=
self
.
img_transform
(
_img
,
img_shape
,
pad_shape
,
scale_factor
=
self
.
img_transform
(
...
...
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