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

Function _to_assemblies

tests/core/inferenceutils/test_map_computation.py:287–302  ·  view source on GitHub ↗
(
    data: dict[str, np.ndarray],
    ground_truth: bool,
)

Source from the content-addressed store, hash-verified

285
286
287def _to_assemblies(
288 data: dict[str, np.ndarray],
289 ground_truth: bool,
290) -> dict[str, list[inferenceutils.Assembly]]:
291 images = list(data.keys())
292 raw_data = np.stack([data[i] for i in images], axis=0)
293
294 # mask not visible entries
295 mask = raw_data[..., 2] <= 0
296 raw_data[mask] = np.nan
297
298 # set the "score" to 1 for ground truth
299 if ground_truth:
300 raw_data[~mask, 2] = 1
301
302 return {images[i]: assembly for i, assembly in inferenceutils._parse_ground_truth_data(raw_data).items()}
303
304
305def _to_coco_ground_truth(

Callers 1

_evaluateFunction · 0.85

Calls 2

keysMethod · 0.80
itemsMethod · 0.80

Tested by

no test coverage detected