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
RODNet
Commits
363d79a8
"vscode:/vscode.git/clone" did not exist on "e2fd2b9c7e8fb15f15d821369fdd769ec52e2b50"
Commit
363d79a8
authored
Jan 12, 2022
by
yizhou-wang
Browse files
Create convert_rodnet_to_rod2021.py
parent
389ff84c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
0 deletions
+33
-0
tools/format_transform/convert_rodnet_to_rod2021.py
tools/format_transform/convert_rodnet_to_rod2021.py
+33
-0
No files found.
tools/format_transform/convert_rodnet_to_rod2021.py
0 → 100644
View file @
363d79a8
import
os
from
cruw.cruw
import
CRUW
rodnet_res_dir
=
'/mnt/disk1/CRUW/ROD2021/RODNet/results/rodnet-hg1wi-win16'
convert_res_dir
=
'/mnt/disk1/CRUW/ROD2021/RODNet/results/rodnet-hg1wi-win16-convert'
SEQ_NAMES
=
[
'2019_05_28_CM1S013'
,
'2019_05_28_MLMS005'
,
'2019_05_28_PBMS006'
,
'2019_05_28_PCMS004'
,
'2019_05_28_PM2S012'
,
'2019_05_28_PM2S014'
,
'2019_09_18_ONRD004'
,
'2019_09_18_ONRD009'
,
'2019_09_29_ONRD012'
,
'2019_10_13_ONRD048'
]
dataset
=
CRUW
(
data_root
=
'/mnt/disk1/CRUW'
)
seq_names
=
os
.
listdir
(
rodnet_res_dir
)
if
not
os
.
path
.
exists
(
convert_res_dir
):
os
.
makedirs
(
convert_res_dir
)
for
seq_name
in
seq_names
:
if
seq_name
.
upper
()
in
SEQ_NAMES
:
txt_name_in
=
os
.
path
.
join
(
rodnet_res_dir
,
seq_name
,
'rod_res.txt'
)
txt_name_out
=
os
.
path
.
join
(
convert_res_dir
,
seq_name
.
upper
()
+
'.txt'
)
with
open
(
txt_name_in
,
'r'
)
as
f
:
data
=
f
.
readlines
()
f_out
=
open
(
txt_name_out
,
'w'
)
for
line
in
data
:
frameid
,
class_name
,
rid
,
aid
,
conf
=
line
.
rstrip
().
split
()
rid
=
int
(
rid
)
aid
=
int
(
aid
)
r
=
dataset
.
range_grid
[
rid
]
a
=
dataset
.
angle_grid
[
aid
]
conf
=
float
(
conf
)
if
conf
>
1
:
conf
=
1.0
f_out
.
write
(
"%s %.4f %.4f %s %.4f
\n
"
%
(
frameid
,
r
,
a
,
class_name
,
conf
))
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