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
389ff84c
Commit
389ff84c
authored
Dec 03, 2021
by
yizhou-wang
Browse files
Create generate_demo_videos.py
parent
f9633b77
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
0 deletions
+25
-0
tools/vis/generate_demo_videos.py
tools/vis/generate_demo_videos.py
+25
-0
No files found.
tools/vis/generate_demo_videos.py
0 → 100644
View file @
389ff84c
import
os
overwrite
=
False
framerate
=
"20"
result_root
=
"results"
model_name
=
"rodnet-hg1wi-win16-wobg-mnet8-dcnv3-20200716-135222"
model_res_root
=
os
.
path
.
join
(
result_root
,
model_name
)
video_root
=
os
.
path
.
join
(
result_root
,
model_name
,
"demos"
)
if
not
os
.
path
.
exists
(
video_root
):
os
.
makedirs
(
video_root
)
for
seq
in
sorted
(
os
.
listdir
(
model_res_root
)):
if
not
os
.
path
.
isdir
(
os
.
path
.
join
(
model_res_root
,
seq
)):
continue
if
seq
==
'demos'
:
continue
img_root
=
os
.
path
.
join
(
model_res_root
,
seq
,
'rod_viz'
)
video_path
=
os
.
path
.
join
(
video_root
,
seq
+
"_demo.mp4"
)
if
not
overwrite
and
os
.
path
.
exists
(
video_path
):
print
(
"video exists. skip..."
)
continue
cmd
=
"ffmpeg -r "
+
framerate
+
" -i "
+
img_root
+
"/%010d.jpg -c:v libx264 -vf fps="
+
framerate
+
\
" -pix_fmt yuv420p "
+
video_path
print
(
cmd
)
os
.
system
(
cmd
)
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