MCPcopy Index your code
hub / github.com/DeepLabCut/DeepLabCut / parse_ground_truth_data_file

Function parse_ground_truth_data_file

deeplabcut/core/inferenceutils.py:1041–1055  ·  view source on GitHub ↗
(h5_file)

Source from the content-addressed store, hash-verified

1039
1040
1041def parse_ground_truth_data_file(h5_file):
1042 df = pd.read_hdf(h5_file)
1043 try:
1044 df.drop("single", axis=1, level="individuals", inplace=True)
1045 except KeyError:
1046 pass
1047 # Cast columns of dtype 'object' to float to avoid TypeError
1048 # further down in _parse_ground_truth_data.
1049 cols = df.select_dtypes(include="object").columns
1050 if cols.to_list():
1051 df[cols] = df[cols].astype("float")
1052 n_individuals = len(df.columns.get_level_values("individuals").unique())
1053 n_bodyparts = len(df.columns.get_level_values("bodyparts").unique())
1054 data = df.to_numpy().reshape((df.shape[0], n_individuals, n_bodyparts, -1))
1055 return _parse_ground_truth_data(data)
1056
1057
1058def _parse_ground_truth_data(data):

Callers

nothing calls this directly

Calls 2

_parse_ground_truth_dataFunction · 0.85
uniqueMethod · 0.80

Tested by

no test coverage detected