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
OpenDAS
mmdetection3d
Commits
ccbe2416
Commit
ccbe2416
authored
Apr 27, 2020
by
zhangwenwei
Browse files
Reformat Eval logs to support tensorboard
parent
b3b20620
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
18 deletions
+22
-18
.gitlab-ci.yml
.gitlab-ci.yml
+1
-1
mmdet3d/core/evaluation/kitti_utils/eval.py
mmdet3d/core/evaluation/kitti_utils/eval.py
+13
-15
mmdet3d/datasets/kitti_dataset.py
mmdet3d/datasets/kitti_dataset.py
+3
-2
tools/train.py
tools/train.py
+5
-0
No files found.
.gitlab-ci.yml
View file @
ccbe2416
variables
:
PYTORCH_IMAGE
:
registry.sensetime.com/eig-research/pytorch:
pytorch
1.3.1-cuda10.1-devel
PYTORCH_IMAGE
:
registry.sensetime.com/eig-research/pytorch:1.3.1-cuda10.1-
cudnn7-
devel
stages
:
-
linting
...
...
mmdet3d/core/evaluation/kitti_utils/eval.py
View file @
ccbe2416
...
...
@@ -681,7 +681,6 @@ def kitti_eval(gt_annos,
# mAP threshold array: [num_minoverlap, metric, class]
# mAP result: [num_class, num_diff, num_minoverlap]
curcls_name
=
class_to_name
[
curcls
]
ret_dict
[
curcls_name
]
=
{}
for
i
in
range
(
min_overlaps
.
shape
[
0
]):
# prepare results for print
result
+=
(
'{} AP@{:.2f}, {:.2f}, {:.2f}:
\n
'
.
format
(
...
...
@@ -702,18 +701,17 @@ def kitti_eval(gt_annos,
# prepare results for logger
for
idx
in
range
(
3
):
postfix
=
'{}_{}'
.
format
(
difficulty
[
idx
],
min_overlaps
[
i
,
idx
,
j
])
if
i
==
0
:
postfix
=
f
'
{
difficulty
[
idx
]
}
_strict'
else
:
postfix
=
f
'
{
difficulty
[
idx
]
}
_loose'
prefix
=
f
'KITTI/
{
curcls_name
}
'
if
mAP3d
is
not
None
:
ret_dict
[
curcls_name
][
'3D_{}'
.
format
(
postfix
)]
=
mAP3d
[
j
,
idx
,
i
]
ret_dict
[
f
'
{
prefix
}
_3D_
{
postfix
}
'
]
=
mAP3d
[
j
,
idx
,
i
]
if
mAPbev
is
not
None
:
ret_dict
[
curcls_name
][
'BEV_{}'
.
format
(
postfix
)]
=
mAPbev
[
j
,
idx
,
i
]
ret_dict
[
f
'
{
prefix
}
_BEV_
{
postfix
}
'
]
=
mAPbev
[
j
,
idx
,
i
]
if
mAPbbox
is
not
None
:
ret_dict
[
curcls_name
][
'2D_{}'
.
format
(
postfix
)]
=
mAPbbox
[
j
,
idx
,
i
]
ret_dict
[
f
'
{
prefix
}
_2D_
{
postfix
}
'
]
=
mAPbbox
[
j
,
idx
,
i
]
# calculate mAP over all classes if there are multiple classes
if
len
(
current_classes
)
>
1
:
...
...
@@ -735,14 +733,14 @@ def kitti_eval(gt_annos,
# prepare results for logger
ret_dict
[
'Overall'
]
=
dict
()
for
idx
in
range
(
3
):
postfix
=
'{
}'
.
format
(
difficulty
[
idx
]
)
postfix
=
f
'
{
difficulty
[
idx
]
}
'
if
mAP3d
is
not
None
:
ret_dict
[
'Overall'
][
'3D_{}'
.
format
(
postfix
)
]
=
mAP3d
[
idx
,
0
]
ret_dict
[
f
'KITTI/Overall_3D_
{
postfix
}
'
]
=
mAP3d
[
idx
,
0
]
if
mAPbev
is
not
None
:
ret_dict
[
'
Overall
'
][
'
BEV_{
}'
.
format
(
postfix
)
]
=
mAPbev
[
idx
,
0
]
ret_dict
[
f
'KITTI/
Overall
_
BEV_
{
postfix
}
'
]
=
mAPbev
[
idx
,
0
]
if
mAPbbox
is
not
None
:
ret_dict
[
'Overall'
][
'2D_{}'
.
format
(
postfix
)
]
=
mAPbbox
[
idx
,
0
]
print
(
result
)
ret_dict
[
f
'KITTI/Overall_2D_
{
postfix
}
'
]
=
mAPbbox
[
idx
,
0
]
return
result
,
ret_dict
...
...
mmdet3d/datasets/kitti_dataset.py
View file @
ccbe2416
...
...
@@ -9,6 +9,7 @@ import torch
import
torch.utils.data
as
torch_data
from
mmdet.datasets
import
DATASETS
from
mmdet.utils
import
print_log
from
..core.bbox
import
box_np_ops
from
.pipelines
import
Compose
from
.utils
import
remove_dontcare
...
...
@@ -317,10 +318,10 @@ class KittiDataset(torch_data.Dataset):
else
:
ap_result_str
,
ap_dict
=
kitti_eval
(
gt_annos
,
result_files
,
self
.
class_names
)
print_log
(
ap_result_str
,
logger
=
logger
)
if
tmp_dir
is
not
None
:
tmp_dir
.
cleanup
()
return
ap_dict
,
tmp_dir
return
ap_dict
def
bbox2result_kitti
(
self
,
net_outputs
,
...
...
tools/train.py
View file @
ccbe2416
from
__future__
import
division
import
argparse
import
copy
import
logging
import
os
import
os.path
as
osp
import
time
...
...
@@ -103,6 +104,10 @@ def main():
log_file
=
osp
.
join
(
cfg
.
work_dir
,
'{}.log'
.
format
(
timestamp
))
logger
=
get_root_logger
(
log_file
=
log_file
,
log_level
=
cfg
.
log_level
)
# add a logging filter
logging_filter
=
logging
.
Filter
(
'mmdet'
)
logging_filter
.
filter
=
lambda
record
:
record
.
find
(
'mmdet'
)
!=
-
1
# init the meta dict to record some important information such as
# environment info and seed, which will be logged
meta
=
dict
()
...
...
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