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
192f53e4
Commit
192f53e4
authored
Dec 11, 2018
by
Kai Chen
Browse files
minor fix
parent
86dc1bc3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
mmdet/datasets/voc.py
mmdet/datasets/voc.py
+3
-3
No files found.
mmdet/datasets/voc.py
View file @
192f53e4
...
@@ -20,7 +20,7 @@ class VOCDataset(CustomDataset):
...
@@ -20,7 +20,7 @@ class VOCDataset(CustomDataset):
self
.
cat2label
=
{
cat
:
i
+
1
for
i
,
cat
in
enumerate
(
self
.
CLASSES
)}
self
.
cat2label
=
{
cat
:
i
+
1
for
i
,
cat
in
enumerate
(
self
.
CLASSES
)}
def
load_annotations
(
self
,
ann_file
):
def
load_annotations
(
self
,
ann_file
):
self
.
img_infos
=
[]
img_infos
=
[]
img_ids
=
mmcv
.
list_from_file
(
ann_file
)
img_ids
=
mmcv
.
list_from_file
(
ann_file
)
for
img_id
in
img_ids
:
for
img_id
in
img_ids
:
filename
=
'JPEGImages/{}.jpg'
.
format
(
img_id
)
filename
=
'JPEGImages/{}.jpg'
.
format
(
img_id
)
...
@@ -31,9 +31,9 @@ class VOCDataset(CustomDataset):
...
@@ -31,9 +31,9 @@ class VOCDataset(CustomDataset):
size
=
root
.
find
(
'size'
)
size
=
root
.
find
(
'size'
)
width
=
int
(
size
.
find
(
'width'
).
text
)
width
=
int
(
size
.
find
(
'width'
).
text
)
height
=
int
(
size
.
find
(
'height'
).
text
)
height
=
int
(
size
.
find
(
'height'
).
text
)
self
.
img_infos
.
append
(
img_infos
.
append
(
dict
(
id
=
img_id
,
filename
=
filename
,
width
=
width
,
height
=
height
))
dict
(
id
=
img_id
,
filename
=
filename
,
width
=
width
,
height
=
height
))
return
self
.
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'
]
...
...
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