Commit d7236abd authored by lucas_miranda's avatar lucas_miranda
Browse files

Added draft of rule_based_annotation function in preprocess.py

parent 0c80a6ad
......@@ -454,7 +454,10 @@ def rule_based_tagging(
animal_ids = coordinates._animal_ids
undercond = "_" if len(animal_ids) > 1 else ""
vid_name = re.findall("(.*?)_", tracks[vid_index])[0]
try:
vid_name = re.findall("(.*?)_", tracks[vid_index])[0]
except IndexError:
vid_name = tracks[vid_index]
coords = coordinates.get_coords()[vid_name]
speeds = coordinates.get_coords(speed=1)[vid_name]
......
......@@ -26,6 +26,7 @@ import deepof.utils
import deepof.visuals
import matplotlib.pyplot as plt
import numpy as np
import os
import pandas as pd
import warnings
......@@ -644,10 +645,10 @@ class coordinates:
tag_dict[key] = deepof.pose_utils.rule_based_tagging(
list(self._tables.keys()),
self._videos,
self._tables,
self,
idx,
recog_limit=1,
path=self._path,
path=os.path.join(self._path,"Videos"),
hparams=hparams,
)
return table_dict(
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment