Returns the names of the test images for the benchmark, in the order corresponding to the test indices.
(h5file: str, metadata: str)
| 240 | |
| 241 | |
| 242 | def 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 | |
| 256 | def _load_test_indices(shuffle_metadata_path: str) -> list[int]: |
no test coverage detected