From 7fe1bd13f0d5b0d10eb68cdfd7317c4a65292118 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Laurent?= <francois.laurent@posteo.net> Date: Thu, 12 May 2022 19:42:54 +0200 Subject: [PATCH] version increment --- pyproject.toml | 2 +- src/maggotuba/models/predict_model.py | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 581818d..24de448 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "MaggotUBA-adapter" -version = "0.2.0" +version = "0.3.0" description = "Interface between MaggotUBA and the Nyx tagging UI" authors = ["François Laurent"] license = "MIT" diff --git a/src/maggotuba/models/predict_model.py b/src/maggotuba/models/predict_model.py index a6f0742..589aacf 100644 --- a/src/maggotuba/models/predict_model.py +++ b/src/maggotuba/models/predict_model.py @@ -1,5 +1,6 @@ from taggingbackends.data.trxmat import TrxMat from taggingbackends.data.chore import load_spine +import taggingbackends.data.fimtrack as fimtrack from taggingbackends.data.labels import Labels from taggingbackends.features.skeleton import get_5point_spines from randomforest import RandomForest @@ -46,13 +47,17 @@ def predict_model(backend): if run == "spine": run, data = next(iter(data.items())) t = t[run] + elif file.name.endswith(".csv"): + print("assuming 30 fps") + t, data = fimtrack.read_spines(file, fps=30) + run = "NA" else: # TODO: support more file formats continue # downsample the skeleton if isinstance(data, dict): for larva in data: - data[larva] = np.vstack([get_5point_spines(spine) for spine in data[larva]]) + data[larva] = get_5point_spines(data[larva]) else: data = get_5point_spines(data) # load the model -- GitLab