Skip to content
Snippets Groups Projects
Commit 43fa75dd authored by marc131183's avatar marc131183
Browse files

quicksave

parent 7abf6302
No related branches found
No related tags found
No related merge requests found
Pipeline #35802 passed
......@@ -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
......@@ -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(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment