|
6 | 6 | from numpy.typing import NDArray |
7 | 7 | from tqdm import tqdm |
8 | 8 |
|
9 | | -from valor_lite.cache import CacheWriter, DataType |
| 9 | +from valor_lite.cache import ( |
| 10 | + CacheWriter, |
| 11 | + DataType, |
| 12 | + convert_type_mapping_to_schema, |
| 13 | +) |
10 | 14 | from valor_lite.exceptions import EmptyCacheError |
11 | 15 | from valor_lite.object_detection.annotation import ( |
12 | 16 | Bitmask, |
@@ -56,20 +60,14 @@ def __init__( |
56 | 60 | } |
57 | 61 | json.dump(types, f, indent=2) |
58 | 62 |
|
59 | | - datum_metadata_schema = ( |
60 | | - [(k, v.to_arrow()) for k, v in datum_metadata_types.items()] |
61 | | - if datum_metadata_types |
62 | | - else [] |
| 63 | + datum_metadata_schema = convert_type_mapping_to_schema( |
| 64 | + datum_metadata_types |
63 | 65 | ) |
64 | | - groundtruth_metadata_schema = ( |
65 | | - [(k, v.to_arrow()) for k, v in groundtruth_metadata_types.items()] |
66 | | - if groundtruth_metadata_types |
67 | | - else [] |
| 66 | + groundtruth_metadata_schema = convert_type_mapping_to_schema( |
| 67 | + groundtruth_metadata_types |
68 | 68 | ) |
69 | | - prediction_metadata_schema = ( |
70 | | - [(k, v.to_arrow()) for k, v in prediction_metadata_types.items()] |
71 | | - if prediction_metadata_types |
72 | | - else [] |
| 69 | + prediction_metadata_schema = convert_type_mapping_to_schema( |
| 70 | + prediction_metadata_types |
73 | 71 | ) |
74 | 72 |
|
75 | 73 | self._null_gt_metadata = { |
|
0 commit comments