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
9dd4334b
Unverified
Commit
9dd4334b
authored
Oct 31, 2018
by
Yuchen Fan
Committed by
GitHub
Oct 31, 2018
Browse files
Add support for string ids for COCO dataset
parent
86e25e41
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
mmdet/datasets/coco.py
mmdet/datasets/coco.py
+2
-2
No files found.
mmdet/datasets/coco.py
View file @
9dd4334b
...
@@ -16,14 +16,14 @@ class CocoDataset(CustomDataset):
...
@@ -16,14 +16,14 @@ class CocoDataset(CustomDataset):
self
.
img_ids
=
self
.
coco
.
getImgIds
()
self
.
img_ids
=
self
.
coco
.
getImgIds
()
img_infos
=
[]
img_infos
=
[]
for
i
in
self
.
img_ids
:
for
i
in
self
.
img_ids
:
info
=
self
.
coco
.
loadImgs
(
i
)[
0
]
info
=
self
.
coco
.
loadImgs
(
[
i
]
)[
0
]
info
[
'filename'
]
=
info
[
'file_name'
]
info
[
'filename'
]
=
info
[
'file_name'
]
img_infos
.
append
(
info
)
img_infos
.
append
(
info
)
return
img_infos
return
img_infos
def
get_ann_info
(
self
,
idx
):
def
get_ann_info
(
self
,
idx
):
img_id
=
self
.
img_infos
[
idx
][
'id'
]
img_id
=
self
.
img_infos
[
idx
][
'id'
]
ann_ids
=
self
.
coco
.
getAnnIds
(
imgIds
=
img_id
)
ann_ids
=
self
.
coco
.
getAnnIds
(
imgIds
=
[
img_id
]
)
ann_info
=
self
.
coco
.
loadAnns
(
ann_ids
)
ann_info
=
self
.
coco
.
loadAnns
(
ann_ids
)
return
self
.
_parse_ann_info
(
ann_info
)
return
self
.
_parse_ann_info
(
ann_info
)
...
...
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