Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions deeplabcut/refine_training_dataset/outlier_frames.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ def extract_outlier_frames(
* ``'uncertain'`` looks for frames with confidence below p_bound
* ``'manual'`` launches a GUI from which the user can choose the frames
* ``'list'`` looks for user to provide a list of frame numbers to use, 'frames2use'. In this case, ``'extractionalgorithm'`` is forced to be ``'uniform.'``

frames2use: list[str], optional, default=None
If ``'outlieralgorithm'`` is ``'list'``, provide the list of frames here.

Expand Down Expand Up @@ -405,7 +405,7 @@ def extract_outlier_frames(
elif outlieralgorithm == "jump":
temp_dt = df_temp.diff(axis=0) ** 2
temp_dt.drop("likelihood", axis=1, level="coords", inplace=True)
sum_ = temp_dt.sum(axis=1, level=1)
sum_ = temp_dt.groupby(level="bodyparts", axis=1).sum()
ind = df_temp.index[(sum_ > epsilon**2).any(axis=1)].tolist()
Indices.extend(ind)
elif outlieralgorithm == "fitting":
Expand Down Expand Up @@ -440,7 +440,7 @@ def extract_outlier_frames(
else:
raise ValueError(f'outlieralgorithm {outlieralgorithm} not recognized!')

# Run always except when the outlieralgorithm == manual.
# Run always except when the outlieralgorithm == manual.
if not outlieralgorithm == "manual":
Indices = np.sort(list(set(Indices))) # remove repetitions.
print(
Expand Down
2 changes: 1 addition & 1 deletion examples/testscript.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ def make_frame(t):
print("RELABELING")
DF = pd.read_hdf(file, "df_with_missing")
DLCscorer = np.unique(DF.columns.get_level_values(0))[0]
DF.columns.set_levels([scorer.replace(DLCscorer, scorer)], level=0, inplace=True)
DF.columns = DF.columns.set_levels([scorer.replace(DLCscorer, scorer)], level=0)
DF = DF.drop("likelihood", axis=1, level=2)
DF.to_csv(
os.path.join(
Expand Down
2 changes: 1 addition & 1 deletion examples/testscript_multianimal.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@
print("RELABELING")
DF = pd.read_hdf(file, "df_with_missing")
DLCscorer = np.unique(DF.columns.get_level_values(0))[0]
DF.columns.set_levels([scorer.replace(DLCscorer, SCORER)], level=0, inplace=True)
DF.columns = DF.columns.set_levels([scorer.replace(DLCscorer, SCORER)], level=0)
DF = DF.drop("likelihood", axis=1, level=3)
DF.to_csv(
os.path.join(
Expand Down
5 changes: 2 additions & 3 deletions tests/test_crossvalutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# Licensed under GNU Lesser General Public License v3.0
#
import numpy as np
import pickle
import pandas as pd
from deeplabcut.pose_estimation_tensorflow.lib import crossvalutils


Expand Down Expand Up @@ -98,8 +98,7 @@ def test_benchmark_paf_graphs_montblanc(evaluation_data_and_metadata_montblanc):
[BEST_GRAPH_MONTBLANC],
split_inds=[metadata["data"]["trainIndices"], metadata["data"]["testIndices"]],
)
with open("tests/data/montblanc_map.pickle", "rb") as file:
results_gt = pickle.load(file)
results_gt = pd.read_pickle("tests/data/montblanc_map.pickle")
np.testing.assert_equal(
results[1].loc["purity"].to_numpy().squeeze(),
results_gt[0].loc["purity", 6].to_numpy(),
Expand Down