Map image paths from predicted data to GT as the first are typically absolute whereas the latter are relative to the project path.
(strings, substrings)
| 99 | |
| 100 | |
| 101 | def _map(strings, substrings): |
| 102 | """Map image paths from predicted data to GT as the first are typically absolute |
| 103 | whereas the latter are relative to the project path.""" |
| 104 | |
| 105 | lookup = dict() |
| 106 | strings_ = strings.copy() |
| 107 | substrings_ = substrings.copy() |
| 108 | while strings_: |
| 109 | string = strings_.pop() |
| 110 | for s in substrings_: |
| 111 | if string.endswith(s): |
| 112 | lookup[string] = s |
| 113 | substrings_.remove(s) |
| 114 | break |
| 115 | return lookup |
| 116 | |
| 117 | |
| 118 | def conv_obj_to_assemblies(eval_results_obj, keypoint_names): |
no test coverage detected