Skip to content
Snippets Groups Projects
Commit b1e5e55c authored by Andi Gerken's avatar Andi Gerken
Browse files

Workaround for issue #24

parent 8097ad54
Branches
Tags
3 merge requests!37Added calculation of individual ids,!34Added script to update individual ids, added docstrings massively,!32Added quiver plot in evaluation.
Pipeline #50122 passed
......@@ -6,6 +6,7 @@
# Released under GNU 3.0 License
# email andi.gerken@gmail.com
from ast import Import
import robofish.io
import robofish.evaluate
from robofish.io import utils
......@@ -431,8 +432,17 @@ def evaluate_quiver(
max_files=None,
bins=25,
):
"""Plot the flow of movement in the files."""
import torch
"""BETA: Plot the flow of movement in the files."""
try:
import torch
from fish_models.models.pascals_lstms.attribution import SocialVectors
except ImportError:
print(
"Either torch or fish_models is not installed.",
"The social vector should come from robofish io.",
"This is a known issue (#24)",
)
return
if poses_from_paths is None:
poses_from_paths, file_settings = utils.get_all_poses_from_paths(paths)
......@@ -480,8 +490,6 @@ def evaluate_quiver(
# print(tank_directions[x,y] - tank_directions_speed[x,y])
tank_count[x, y] = len(d)
from fish_models.models.pascals_lstms.attribution import SocialVectors
sv = SocialVectors(torch.tensor(poses_from_paths[0]))
sv_r = torch.tensor(sv.social_vectors_without_focal_zeros)[:, :, :-1].reshape(
(-1, 3)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment