Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Pinard Clement
drone-depth-validation-set
Commits
eeb5a1a2
Commit
eeb5a1a2
authored
Dec 30, 2020
by
Clément Pinard
Browse files
use metadata directly by filter_models in stead of path
parent
c4cf76fa
Changes
1
Hide whitespace changes
Inline
Side-by-side
filter_colmap_model.py
View file @
eeb5a1a2
...
...
@@ -88,7 +88,7 @@ def slerp_quats(quat_df, prefix=""):
return
pd
.
DataFrame
(
slerp
(
total_index
).
as_quat
(),
index
=
quat_df
.
index
)
def
filter_colmap_model
(
input_images_colmap
,
output_images_colmap
,
metadata
_path
,
def
filter_colmap_model
(
input_images_colmap
,
output_images_colmap
,
metadata
,
filter_degree
=
3
,
filter_time
=
0.1
,
threshold_t
=
0.01
,
threshold_q
=
5e-3
,
visualize
=
False
,
**
env
):
...
...
@@ -98,7 +98,6 @@ def filter_colmap_model(input_images_colmap, output_images_colmap, metadata_path
images_dict
=
rm
.
read_images_binary
(
input_images_colmap
)
else
:
print
(
input_images_colmap
.
ext
)
metadata
=
pd
.
read_csv
(
metadata_path
).
set_index
(
"db_id"
,
drop
=
False
).
sort_values
(
"time"
)
framerate
=
metadata
[
"framerate"
].
iloc
[
0
]
filter_length
=
2
*
int
(
filter_time
*
framerate
)
+
1
...
...
@@ -259,9 +258,9 @@ def filter_colmap_model(input_images_colmap, output_images_colmap, metadata_path
print
(
"number of not localized by colmap : {}/{} ({:.2f}%)"
.
format
(
colmap_outliers
,
total_frames
,
100
*
colmap_outliers
/
total_frames
))
print
(
"Total number of outliers : {} / {} ({:.2f}%)"
.
format
(
sum
(
metadata
[
"outlier"
]),
total_frames
,
100
*
sum
(
metadata
[
"outlier"
])
/
total_frames
))
print
(
"Total number of outliers
for valid sequence
: {} / {} ({:.2f}%)"
.
format
(
sum
(
metadata
[
"outlier"
]),
len
(
metadata
)
,
100
*
sum
(
metadata
[
"outlier"
])
/
len
(
metadata
)
))
if
visualize
:
plt
.
show
()
...
...
@@ -292,6 +291,7 @@ def filter_colmap_model(input_images_colmap, output_images_colmap, metadata_path
if
__name__
==
'__main__'
:
args
=
parser
.
parse_args
()
env
=
vars
(
args
)
interpolated_frames
=
filter_colmap_model
(
metadata_path
=
args
.
metadata
,
**
env
)
metadata
=
pd
.
read_csv
(
args
.
metadata
).
set_index
(
"db_id"
,
drop
=
False
).
sort_values
(
"time"
)
interpolated_frames
=
filter_colmap_model
(
metadata
=
metadata
,
**
env
)
with
open
(
args
.
interpolated_frames_list
,
"w"
)
as
f
:
f
.
write
(
"
\n
"
.
join
(
interpolated_frames
)
+
"
\n
"
)
Write
Preview
Supports
Markdown
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