MCPcopy Create free account
hub / github.com/DeepLabCut/DeepLabCut / load_test_images

Function load_test_images

deeplabcut/benchmark/metrics.py:242–253  ·  view source on GitHub ↗

Returns the names of the test images for the benchmark, in the order corresponding to the test indices.

(h5file: str, metadata: str)

Source from the content-addressed store, hash-verified

240
241
242def load_test_images(h5file: str, metadata: str) -> list[str]:
243 """Returns the names of the test images for the benchmark, in the order
244 corresponding to the test indices."""
245 df = pd.read_hdf(h5file)
246 test_indices = _load_test_indices(metadata)
247 df_test = df.iloc[test_indices]
248 test_images = []
249 for img_path in df_test.index:
250 if not isinstance(img_path, str):
251 img_path = os.path.join(*img_path)
252 test_images.append(img_path)
253 return test_images
254
255
256def _load_test_indices(shuffle_metadata_path: str) -> list[int]:

Callers 1

calc_map_from_objFunction · 0.85

Calls 1

_load_test_indicesFunction · 0.85

Tested by

no test coverage detected