Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
io
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
bioroboticslab
robofish
io
Commits
bc5ea988
Commit
bc5ea988
authored
4 months ago
by
Andi Gerken
Browse files
Options
Downloads
Patches
Plain Diff
Added evaluation to show all tracks in one plot.
parent
113fe09c
No related branches found
No related tags found
1 merge request
!54
robofish-io-evaluate2 and lazy imports
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/robofish/evaluate/app.py
+1
-0
1 addition, 0 deletions
src/robofish/evaluate/app.py
src/robofish/evaluate/evaluate.py
+32
-0
32 additions, 0 deletions
src/robofish/evaluate/evaluate.py
with
33 additions
and
0 deletions
src/robofish/evaluate/app.py
+
1
−
0
View file @
bc5ea988
...
...
@@ -37,6 +37,7 @@ def function_dict() -> dict:
"
follow_iid
"
:
base
.
evaluate_follow_iid
,
"
individual_speed
"
:
base
.
evaluate_individual_speed
,
"
individual_iid
"
:
base
.
evaluate_individual_iid
,
"
single_plot_tracks
"
:
base
.
evaluate_single_plot_tracks
,
# "quiver": base.evaluate_quiver, # Quiver has issues with multiple paths and raises exceptions. The function is not used for now.
"
all
"
:
base
.
evaluate_all
,
}
...
...
This diff is collapsed.
Click to expand it.
src/robofish/evaluate/evaluate.py
+
32
−
0
View file @
bc5ea988
...
...
@@ -627,6 +627,38 @@ def evaluate_quiver(
return
fig
def
evaluate_single_plot_tracks
(
paths
:
Iterable
[
Union
[
str
,
Path
]],
labels
:
Iterable
[
str
]
=
None
,
predicate
:
Callable
[[
robofish
.
io
.
Entity
],
bool
]
=
None
,
poses_from_paths
:
Iterable
[
Iterable
[
np
.
ndarray
]]
=
None
,
max_files
:
int
=
None
,
):
"""
Evaluate the tracks of the entities as a plot.
"""
if
poses_from_paths
is
None
:
poses_from_paths
,
file_settings
=
utils
.
get_all_poses_from_paths
(
paths
,
predicate
,
max_files
=
max_files
)
fig
,
ax
=
plt
.
subplots
(
1
,
len
(
poses_from_paths
),
figsize
=
(
8
*
len
(
poses_from_paths
),
8
)
)
if
len
(
poses_from_paths
)
==
1
:
ax
=
[
ax
]
cmap
=
plt
.
get_cmap
(
"
Blues
"
)
for
i
,
poses_per_path
in
enumerate
(
poses_from_paths
):
for
fi
,
poses
in
enumerate
(
poses_per_path
):
for
e
in
poses
:
ax
[
i
].
plot
(
e
[:,
0
],
e
[:,
1
],
c
=
cmap
(
fi
/
len
(
poses_per_path
)),
alpha
=
0.5
)
ax
[
i
].
set_title
(
labels
[
i
])
ax
[
i
].
set_xlabel
(
"
x [cm]
"
)
ax
[
i
].
set_ylabel
(
"
y [cm]
"
)
return
fig
def
evaluate_social_vector
(
paths
:
Iterable
[
Union
[
str
,
Path
]],
labels
:
Iterable
[
str
]
=
None
,
...
...
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