Skip to content
Snippets Groups Projects
Commit 2e0506a2 authored by François  LAURENT's avatar François LAURENT
Browse files

fixes larvatagger.jl#41 on the Python side

parent 5b19bd27
No related branches found
No related tags found
No related merge requests found
Pipeline #82395 failed
...@@ -18,6 +18,11 @@ class Labels: ...@@ -18,6 +18,11 @@ class Labels:
@property @property
def tracking(self): def tracking(self):
if not all([isinstance(dep, dict) for dep in self._tracking]): if not all([isinstance(dep, dict) for dep in self._tracking]):
if 1 < len(self._tracking):
# if any labels file is found, assume the other files are its
# data dependencies, and exclude the labels file
self._tracking = [dep for dep in self._tracking
if not dep.name.endswith(".labels")]
self._tracking = [{"filename": dep.name, "sha1": self._checksum(dep)} \ self._tracking = [{"filename": dep.name, "sha1": self._checksum(dep)} \
for dep in self._tracking] for dep in self._tracking]
return self._tracking return self._tracking
......
...@@ -8,7 +8,7 @@ def get_5point_spines(spine): ...@@ -8,7 +8,7 @@ def get_5point_spines(spine):
arrays. arrays.
""" """
if isinstance(spine, list): if isinstance(spine, list):
return [get_5point_spines(s) for s in spine] return np.vstack([get_5point_spines(s) for s in spine])
elif spine.shape[1] == 22: elif spine.shape[1] == 22:
return np.hstack([spine[:,0:2], (spine[:,4:6]+spine[:,6:8])/2, return np.hstack([spine[:,0:2], (spine[:,4:6]+spine[:,6:8])/2,
spine[:,10:12], (spine[:,14:16]+spine[:,16:18])/2, spine[:,20:22]]) spine[:,10:12], (spine[:,14:16]+spine[:,16:18])/2, spine[:,20:22]])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment