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
699cb914
Unverified
Commit
699cb914
authored
Jul 29, 2019
by
Kai Chen
Committed by
GitHub
Jul 29, 2019
Browse files
Format the code and add yapf to travis (#1079)
* format the codebase with yapf * add yapf to travis
parent
86cc430a
Changes
22
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
7 deletions
+8
-7
tools/analyze_logs.py
tools/analyze_logs.py
+3
-3
tools/convert_datasets/pascal_voc.py
tools/convert_datasets/pascal_voc.py
+5
-4
No files found.
tools/analyze_logs.py
View file @
699cb914
...
@@ -51,9 +51,9 @@ def plot_curve(log_dicts, args):
...
@@ -51,9 +51,9 @@ def plot_curve(log_dicts, args):
for
j
,
metric
in
enumerate
(
metrics
):
for
j
,
metric
in
enumerate
(
metrics
):
print
(
'plot curve of {}, metric is {}'
.
format
(
print
(
'plot curve of {}, metric is {}'
.
format
(
args
.
json_logs
[
i
],
metric
))
args
.
json_logs
[
i
],
metric
))
assert
metric
in
log_dict
[
epochs
[
if
metric
not
in
log_dict
[
epochs
[
0
]]:
0
]],
'{} does not contain metric {}'
.
format
(
raise
KeyError
(
'{} does not contain metric {}'
.
format
(
args
.
json_logs
[
i
],
metric
)
args
.
json_logs
[
i
],
metric
)
)
if
'mAP'
in
metric
:
if
'mAP'
in
metric
:
xs
=
np
.
arange
(
1
,
max
(
epochs
)
+
1
)
xs
=
np
.
arange
(
1
,
max
(
epochs
)
+
1
)
...
...
tools/convert_datasets/pascal_voc.py
View file @
699cb914
...
@@ -69,16 +69,17 @@ def cvt_annotations(devkit_path, years, split, out_file):
...
@@ -69,16 +69,17 @@ def cvt_annotations(devkit_path, years, split, out_file):
years
=
[
years
]
years
=
[
years
]
annotations
=
[]
annotations
=
[]
for
year
in
years
:
for
year
in
years
:
filelist
=
osp
.
join
(
devkit_path
,
'VOC{}/ImageSets/Main/{}.txt'
.
format
(
filelist
=
osp
.
join
(
devkit_path
,
year
,
split
))
'VOC{}/ImageSets/Main/{}.txt'
.
format
(
year
,
split
))
if
not
osp
.
isfile
(
filelist
):
if
not
osp
.
isfile
(
filelist
):
print
(
'filelist does not exist: {}, skip voc{} {}'
.
format
(
print
(
'filelist does not exist: {}, skip voc{} {}'
.
format
(
filelist
,
year
,
split
))
filelist
,
year
,
split
))
return
return
img_names
=
mmcv
.
list_from_file
(
filelist
)
img_names
=
mmcv
.
list_from_file
(
filelist
)
xml_paths
=
[
xml_paths
=
[
osp
.
join
(
devkit_path
,
'VOC{}/Annotations/{}.xml'
.
format
(
osp
.
join
(
devkit_path
,
year
,
img_name
))
for
img_name
in
img_names
'VOC{}/Annotations/{}.xml'
.
format
(
year
,
img_name
))
for
img_name
in
img_names
]
]
img_paths
=
[
img_paths
=
[
'VOC{}/JPEGImages/{}.jpg'
.
format
(
year
,
img_name
)
'VOC{}/JPEGImages/{}.jpg'
.
format
(
year
,
img_name
)
...
...
Prev
1
2
Next
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