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
43fa75dd
Commit
43fa75dd
authored
4 years ago
by
marc131183
Browse files
Options
Downloads
Patches
Plain Diff
quicksave
parent
7abf6302
No related branches found
No related tags found
No related merge requests found
Pipeline
#35802
passed
4 years ago
Stage: test
Stage: package
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/conversion_scripts/convert_marc.py
+0
-8
0 additions, 8 deletions
src/conversion_scripts/convert_marc.py
src/robofish/evaluate/evaluate.py
+20
-20
20 additions, 20 deletions
src/robofish/evaluate/evaluate.py
with
20 additions
and
28 deletions
src/conversion_scripts/convert_marc.py
+
0
−
8
View file @
43fa75dd
...
...
@@ -37,13 +37,5 @@ def convertTrajectory(path, save_path, categories):
category
=
categories
[
1
],
positions
=
ar
[:,
[
3
,
4
]],
orientations
=
ar
[:,
[
5
]]
)
# convert orientation from radians to orientation vector
ori_vec
=
np
.
array
([
np
.
cos
(
ar
[:,
5
]),
np
.
sin
(
ar
[:,
5
])]).
T
# get new trajectory with x, y, ori_x, ori_y
temp
=
np
.
append
(
ar
[:,
[
3
,
4
]],
ori_vec
,
axis
=
1
)
# convert x,y from m to cm
temp
[:,
[
0
,
1
]]
=
temp
[:,
[
0
,
1
]]
*
100
new
.
create_single_entity
(
type_
=
"
fish
"
,
name
=
"
fish_2
"
,
poses
=
temp
,
monotonic_step
=
50
)
new
.
validate
()
new
.
save
(
save_path
)
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/robofish/evaluate/evaluate.py
+
20
−
20
View file @
43fa75dd
...
...
@@ -19,26 +19,26 @@ from typing import Iterable
from
scipy
import
stats
def
get_all_poses_from_paths
(
paths
:
Iterable
(
str
)):
"""
This function reads all poses from given paths.
Args:
paths: An array of strings, with files or folders
Returns:
An array, containing poses with the shape [paths][files][entities, timesteps, 4]
"""
# Open all files, shape (paths, files)
files_per_path
=
[
robofish
.
io
.
read_multiple_files
(
p
)
for
p
in
paths
]
# Read all poses from the files, shape (paths, files)
poses_per_path
=
[[
f
.
get_poses
()
for
f
in
files
]
for
files
in
files_per_path
]
# close all files
for
p
in
files_per_path
:
for
f
in
p
:
f
.
close
()
return
poses_per_path
#
def get_all_poses_from_paths(paths: Iterable(str)):
#
"""This function reads all poses from given paths.
#
Args:
#
paths: An array of strings, with files or folders
#
Returns:
#
An array, containing poses with the shape [paths][files][entities, timesteps, 4]
#
"""
#
# Open all files, shape (paths, files)
#
files_per_path = [robofish.io.read_multiple_files(p) for p in paths]
#
# Read all poses from the files, shape (paths, files)
#
poses_per_path = [[f.get_poses() for f in files] for files in files_per_path]
#
# close all files
#
for p in files_per_path:
#
for f in p:
#
f.close()
#
return poses_per_path
def
evaluate_speed
(
...
...
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