Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
V
VOB
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Petra Gospodnetic
VOB
Commits
d64b0591
Commit
d64b0591
authored
4 years ago
by
gospodnetic
Browse files
Options
Downloads
Patches
Plain Diff
Arrange logs per models and output graphs ind data/ folder
parent
088310b7
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
LogContainer.py
+5
-4
5 additions, 4 deletions
LogContainer.py
Vis.py
+24
-6
24 additions, 6 deletions
Vis.py
object_space_exploration_per_approach_methods.json
+1
-0
1 addition, 0 deletions
object_space_exploration_per_approach_methods.json
vob.py
+18
-6
18 additions, 6 deletions
vob.py
with
48 additions
and
16 deletions
LogContainer.py
+
5
−
4
View file @
d64b0591
...
@@ -19,10 +19,6 @@ class LogContainer:
...
@@ -19,10 +19,6 @@ class LogContainer:
for
method
in
self
.
methods_per_approach
[
approach
]:
for
method
in
self
.
methods_per_approach
[
approach
]:
self
.
approaches_per_method
[
method
]
=
approach
self
.
approaches_per_method
[
method
]
=
approach
pp
=
pprint
.
PrettyPrinter
(
indent
=
4
)
print
(
"
Methods per approach:
"
)
pp
.
pprint
(
self
.
methods_per_approach
)
def
add_log
(
self
,
log
):
def
add_log
(
self
,
log
):
method
=
log
.
VPC
[
"
method
"
]
method
=
log
.
VPC
[
"
method
"
]
if
method
in
self
.
approaches_per_method
:
if
method
in
self
.
approaches_per_method
:
...
@@ -38,3 +34,8 @@ class LogContainer:
...
@@ -38,3 +34,8 @@ class LogContainer:
def
print_status
(
self
):
def
print_status
(
self
):
for
approach
in
self
.
logs_per_approach
:
for
approach
in
self
.
logs_per_approach
:
print
(
"
Approach
'
{}
'
has {} logs
"
.
format
(
approach
,
len
(
self
.
logs_per_approach
[
approach
])))
print
(
"
Approach
'
{}
'
has {} logs
"
.
format
(
approach
,
len
(
self
.
logs_per_approach
[
approach
])))
def
print_methods_per_approache
(
self
):
pp
=
pprint
.
PrettyPrinter
(
indent
=
4
)
print
(
"
Methods per approach:
"
)
pp
.
pprint
(
self
.
methods_per_approach
)
This diff is collapsed.
Click to expand it.
Vis.py
+
24
−
6
View file @
d64b0591
...
@@ -7,12 +7,14 @@ import numpy as np
...
@@ -7,12 +7,14 @@ import numpy as np
class
Vis
:
class
Vis
:
def
set_logs
(
self
,
log_container
):
def
set_logs
(
self
,
log_container
):
self
.
log_container
=
log_container
self
.
log_container
=
log_container
self
.
figures
=
[]
def
generate_graphs
(
self
):
def
generate_graphs
(
self
):
for
approach
in
self
.
log_container
.
logs_per_approach
:
for
approach
in
self
.
log_container
.
logs_per_approach
:
logs
=
self
.
log_container
.
logs_per_approach
[
approach
]
logs
=
self
.
log_container
.
logs_per_approach
[
approach
]
plt
.
figure
(
num
=
approach
)
fig
=
plt
.
figure
()
ax
=
fig
.
add_subplot
(
111
)
for
log
in
logs
:
for
log
in
logs
:
per_method_coverage
=
[]
per_method_coverage
=
[]
per_method_coverage
.
append
(
per_method_coverage
.
append
(
...
@@ -20,11 +22,27 @@ class Vis:
...
@@ -20,11 +22,27 @@ class Vis:
log
.
get_cumulative_coverage_per_vp
()))
log
.
get_cumulative_coverage_per_vp
()))
y
=
np
.
array
(
per_method_coverage
[
-
1
])
y
=
np
.
array
(
per_method_coverage
[
-
1
])
x
=
np
.
array
(
range
(
len
(
y
)))
x
=
np
.
array
(
range
(
len
(
y
)))
plt
.
plot
(
x
,
y
,
c
=
"
0.4
"
,
alpha
=
0.2
)
ax
.
plot
(
x
,
y
,
c
=
"
0.4
"
,
alpha
=
0.2
)
plt
.
xlim
(
0
,
45
)
ax
.
set_
xlim
(
0
,
45
)
plt
.
ylim
(
0
,
100
)
ax
.
set_
ylim
(
0
,
100
)
plt
.
xlabel
(
"
Number of viewpoints
"
)
ax
.
set_xlabel
(
"
Number of viewpoints
"
)
plt
.
ylabel
(
"
Coverage [%]
"
)
ax
.
set_ylabel
(
"
Coverage [%]
"
)
fig
.
suptitle
(
approach
)
self
.
figures
.
append
(
fig
)
# It will show all currently created figures.
def
show_graphs
(
self
):
plt
.
show
()
plt
.
show
()
def
save_graphs
(
self
,
prefix
=
""
,
output_path
=
""
):
for
idx
,
figure
in
enumerate
(
self
.
figures
):
label
=
figure
.
_suptitle
.
get_text
()
figure
.
suptitle
(
""
)
if
prefix
!=
""
:
filename
=
output_path
+
prefix
+
"
-
"
+
label
else
:
filename
=
output_path
+
label
figure
.
savefig
(
filename
)
This diff is collapsed.
Click to expand it.
object_space_exploration_per_approach_methods.json
+
1
−
0
View file @
d64b0591
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
"UniformSphereCentroid"
],
"UniformSphereCentroid"
],
"VertexBased"
:
[
"VertexBased"
:
[
"VertexCentroid"
,
"VertexCentroid"
,
"VertexBBoxCenter"
,
"VertexNormal"
],
"VertexNormal"
],
"GeometryBased"
:
[
"GeometryBased"
:
[
"Area"
,
"Area"
,
...
...
This diff is collapsed.
Click to expand it.
vob.py
+
18
−
6
View file @
d64b0591
...
@@ -20,26 +20,38 @@ def main():
...
@@ -20,26 +20,38 @@ def main():
with
open
(
methods_per_approach_filename
)
as
methods_per_approach_file
:
with
open
(
methods_per_approach_filename
)
as
methods_per_approach_file
:
methods_per_approach
=
json
.
load
(
methods_per_approach_file
)
methods_per_approach
=
json
.
load
(
methods_per_approach_file
)
log_container
=
LogContainer
(
methods_per_approach
)
# log_container = LogContainer(methods_per_approach)
log_containers_per_model
=
{}
logs
=
[]
logs
=
[]
for
filename
in
ovp_paths
:
for
filename
in
ovp_paths
:
log
=
Log
(
filename
)
try
:
try
:
logs
.
append
(
L
og
(
filename
)
)
logs
.
append
(
l
og
)
except
Exception
as
e
:
except
Exception
as
e
:
print
(
"
Error: {}
\n
Skipping file
"
.
format
(
e
))
print
(
"
Error: {}
\n
Skipping file
"
.
format
(
e
))
continue
continue
model_name
=
log
.
model
[
"
name
"
]
if
model_name
not
in
log_containers_per_model
:
print
(
model_name
)
log_containers_per_model
[
model_name
]
=
LogContainer
(
methods_per_approach
)
try
:
try
:
log_container
.
add_log
(
L
og
(
filename
)
)
log_container
s_per_model
[
model_name
]
.
add_log
(
l
og
)
except
Exception
as
e
:
except
Exception
as
e
:
print
(
"
Error: {}
\n
Skipping file
"
.
format
(
e
))
print
(
"
Error: {}
\n
Skipping file
"
.
format
(
e
))
continue
continue
print
(
"
Loaded {} log files.
"
.
format
(
len
(
logs
)))
print
(
"
Loaded {} log files.
"
.
format
(
len
(
logs
)))
log_container
.
print_status
()
vis
=
Vis
()
vis
=
Vis
()
vis
.
set_logs
(
log_container
)
for
model
in
log_containers_per_model
:
print
(
"
Model name: {}
"
.
format
(
model
))
log_containers_per_model
[
model
].
print_status
()
vis
.
set_logs
(
log_containers_per_model
[
model
])
vis
.
generate_graphs
()
vis
.
save_graphs
(
prefix
=
model
,
output_path
=
"
./data/
"
)
# vis.show_graphs()
vis
.
generate_graphs
()
if
__name__
==
"
__main__
"
:
if
__name__
==
"
__main__
"
:
main
()
main
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment