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
3f5df4f0
Unverified
Commit
3f5df4f0
authored
Nov 01, 2018
by
Kai Chen
Committed by
GitHub
Nov 01, 2018
Browse files
Merge pull request #89 from ychfan/master
Add support for string ids for COCO dataset
parents
86e25e41
9dd4334b
Changes
1
Show 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 @
3f5df4f0
...
@@ -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